We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When trying to obtain a key named type from a specific GraphQL type, it raises an error.
type
The problem could be because the type attribute is already assigned to DSLType in
DSLType
gql/gql/dsl.py
Lines 51 to 53 in fce2782
.graphql
type Query { my_restaurant: Restaurant } enum RestaurantType { italian indian fast_food } type Restaurant { type: RestaurantType! address: String name: String }
Restaurant.type
from schema import schema from gql import Client from gql.dsl import DSLSchema client = Client(schema=schema) ds = DSLSchema(client) query = ds.Query.my_restaurant.select( ds.Restaurant.type )
Error Traceback (most recent call last): File "/opt/project/src/apps/graphql/tests/test_graphql.py", line 80, in test_restaurant query = ds.Query.my_restaurant.select( File "/usr/local/lib/python3.8/site-packages/gql/dsl.py", line 91, in select selections=FrozenList(added_selections) File "/usr/local/lib/python3.8/site-packages/gql/dsl.py", line 73, in selections yield selection_field(_field).ast File "/usr/local/lib/python3.8/site-packages/gql/dsl.py", line 127, in selection_field raise TypeError(f'Received incompatible query field: "{field}".') TypeError: Received incompatible query field: "Restaurant".
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Description
When trying to obtain a key named
type
from a specific GraphQL type, it raises an error.The problem could be because the
type
attribute is already assigned toDSLType
ingql/gql/dsl.py
Lines 51 to 53 in fce2782
Steps to reproduce
.graphql
file with the schema. For example:Restaurant.type
The text was updated successfully, but these errors were encountered: