On Tree Fails on defaultBranchRef

{
  repository(owner: "sindresorhus", name: "refined-github") {
    defaultBranchRef {
      target {
        ... on Tree {
          entries {
            name
          }
        }
      }
    }
  }
}

Returns {}

on Commit works fine

The target GitObject doesn’t implement Tree, you need to get its tree and query the tree’s entries.

{
  repository(owner: "sindresorhus", name: "refined-github") {
    defaultBranchRef {
      target {
        ... on Commit {
          tree {
            entries {
              name
            }
          }
        }
      }
    }
  }
}