__typename field requires specific token scopes?


#1

Is this a bug? It’s totally taken down the GitHawk iOS app. I can repro this currently in any query but just adding __typename to any part of the request. Then I remove the __typename and the request works fine.

Error message:

Your token has not been granted the required scopes to execute this query. The '__typename' field requires one of the following scopes: ['read:org'], but your token has only been granted the: ['notifications', 'repo', 'user'] scopes. Please modify your token's scopes at: https://github.com/settings/tokens.

What’s up?

Example failing query:

query {
  search(query:"repo:GitHawkApp/GitHawk is:pr is:open",type:ISSUE,first:10) {
    issueCount
    nodes {
    	__typename
      ... on Issue {
        title
      }
      ... on PullRequest {
        title
      }
		}
  }
}

Now this query works:

query {
  search(query:"repo:GitHawkApp/GitHawk is:pr is:open",type:ISSUE,first:10) {
    issueCount
    nodes {
      ... on Issue {
        title
      }
      ... on PullRequest {
        title
      }
		}
  }
}

#2

Hey @rnystrom!

Thanks for bringing this up! I’ve escalated this right now given the importance, we’ll have an update for you as soon as possible!


#3

Hello @rnystrom. I’ve just rolled back the PR that introduced this breaking change. The tl;dr is that we had intended to tighten the security around queries being made, but it seems that metadata (like __typename) used to pass through unhindered, and now it doesn’t.

My sincere apologies for the change.


#4

Thank you so much everyone!