-
Notifications
You must be signed in to change notification settings - Fork 180
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
Nested field resolver #101
Labels
question
Further information is requested
Comments
Hi, you also need to define |
Thanks, worked! |
NOTE for those of us coming from Google: |
A working example for nested queries, where an object works as a sort of a namespace: from ariadne import ObjectType, QueryType
from ariadne import gql
from ariadne import graphql_sync
from ariadne import make_executable_schema
from graphql import GraphQLResolveInfo
GRAPHQL_SCHEMA = gql('''
type Query {
sub: SubQuery!
}
type SubQuery {
hello: String!
}
''')
Query = QueryType()
@Query.field('sub')
def resolve_sub(*_):
return SubQuery
SubQuery = ObjectType('SubQuery')
@SubQuery.field('hello')
def resolve_hello(_, info: GraphQLResolveInfo):
return 'hi' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello!
I have a question about resolving in nested field. I don't realize if there is a bug or that functionality is not exist yet.
I have this schema and resolver:
But when I make the query to receive data
I get
And the resolver function is not called! Is this correct?
Thanks
The text was updated successfully, but these errors were encountered: