-
Notifications
You must be signed in to change notification settings - Fork 54
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
"Type ... doesn't have any fields" error on GitHub GraphQL schema. #34
Comments
When working with union types you only can query on cases and not on whole field. To adjust your example to Here is an example of a correct query: module WorkingQuery = [%graphql
{|
query issueMilestone($owner: String!, $repo: String!, $number: Int!) {
repository(owner:$owner, name:$repo) {
issue(number:$number) {
id
milestone { id }
timelineItems(itemTypes:[CLOSED_EVENT],last:1) {
totalCount
nodes {
... on ClosedEvent {
closer {
... on PullRequest {
id
milestone { id }
}
... on Commit {
associatedPullRequests(first: 2) {
nodes {
id
milestone { id }
}
}
}
}
}
}
}
}
}
}
|}
]; If it doesn't solve your issue please reopen 🙂 |
@Zimmi48 Added it to the troubleshooting section in README: https://github.com/baransu/graphql_ppx_re#type--doesnt-have-any-fields |
Thank you so much for the quick answer! If this hadn't been a migration from |
I am using GitHub's GraphQL API. The following query worked fine with
ppx_graphql
(the__typename
were required though) but it does not work withgraphql_ppx_re
:The error is:
Given that it is GitHub's GraphQL schema, I am pretty confident that this is a valid schema.
Since this error looks specific to the handling of union types, I think it is the same as mhallin/graphql_ppx#74.
Is it a bug or a known limitation? Is there a known workaround? Thanks!
The text was updated successfully, but these errors were encountered: