-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System.InvalidOperationException: Cannot access child value on Newtonsoft.Json.Linq.JValue #234
Comments
Hi @terrajobst 👋 There appears to be strange things going on with PAT scopes and what the GraphQL query returns. I've created a repository here with your repro: When a use a PAT with no scopes, I see the same exception as you: When I run the same query with a repo scoped PAT, it works fine: There appears to be some information missing when a no-scope PAT is used. 😕 This can be fixed with the following null check: Unfortunately this doesn't make it with with the default
If you're running this from a GitHub Actions workflow, you could simply embed a no-scope PAT in the code. GitHub will automatically delete any scoped PATs pushed to a public repository, but it will leave no-scope PATs alone. 🙂 A no-scope PAT should be able to access all public information. I'll ping the API team about this tomorrow and see if they know what's going on! |
For reference, here is the query that it having problems:
It works fine in https://developer.github.com/v4/explorer/ but no-scope and GitHub Actions tokens trip it up. 😢 |
In my case, I was using an OAuth2 token with the Your workaround only solved part of the issue; I don't seem to get complete query results. Something causes the query to exclude issues; maybe there is another issue with the |
I think there are only a few event types missing. For example, any
If you run the following query in https://developer.github.com/v4/explorer/, do you notice any missing issue? query {
repository(name: "runtime", owner: "dotnet") {
issues(first: 100) {
nodes
{
number title
}
}
}
} |
No, the only important ones are the ones that I
Nope, the query result looks good to me. |
This issue seams not to be resolved? I have encountered the very same thing recently. |
Repro
This query crashes. The involved repo is public, so you should be able to repro it from your end.
Code
Expected behavior
The query succeeds.
Actual behavior
The query crashes
System.InvalidOperationException
:The text was updated successfully, but these errors were encountered: