You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Notice that in the raw graphql I just mentioned name instead of Country.name. As the schema already lays out the return types of all queries, graphql is able to figure it out automatically.
""" schema.graphql """
type Query {
...
countries(filter: CountryFilterInput): [Country!]!
...
}
type Country {
...
name: String!
...
}
Would it be possible to modify .select() to auto-select objects of the query type by their name?
Maybe something like:
For the following query on https://countries.trevorblades.com/
The snippet to generate this dynamically using gql is:
Notice that in the raw graphql I just mentioned
name
instead ofCountry.name
. As the schema already lays out the return types of all queries, graphql is able to figure it out automatically.Would it be possible to modify
.select()
to auto-select objects of the query type by their name?Maybe something like:
Resulting graphql
Note: The sgqlc library has a
__fields__()
method which can get the immediate scalars by name: https://github.com/profusion/sgqlc/blob/465a5e800f8b408ceafe25cde45ee0bde4912482/sgqlc/operation/__init__.py#L390The text was updated successfully, but these errors were encountered: