Closed ereyes01 closed 6 years ago
Hi, yes, GraphQL inline fragments and unions are supported (see #10 for more information), but not documented in README yet. I plan to do that, and tracking it in https://github.com/shurcooL/graphql/issues/3 issue.
The GraphQL query you posted can be expressed something like this:
var query struct {
Search struct {
Nodes []struct {
Issue struct {
Number int
} `graphql:"... on Issue"`
}
} `graphql:"search(first: 100, type: ISSUE, query: $searchQuery)"`
}
Awesome, and works great. Thanks!
Thanks for taking a crack at the client library...
How would you query a specific type when the schema specifies an interface or union as the return type?
For instance, say I try the following query to github:
The
search
query returns aSearchResultItem
, and in this case, I just want the issues. Is there a way using your library to specify the.. on Issue
part of the query above?