-
Notifications
You must be signed in to change notification settings - Fork 819
Closed
Labels
Description
How can I use resolve
in relay.Node.Field
?
I have tried to use resolve
in DjangoFilterConnectionField(CategoryNode)
, and it works.
But it does not work when I use the same resolve
function in relay.Node.Field(CategoryNode)
This is my code:
#schema.py
class Query(graphene.ObjectType):
category = relay.Node.Field(CategoryNode)
all_categories = DjangoFilterConnectionField(CategoryNode)
def resolve_category(root, info, **kwargs):
print("###TESTING resolve_category###")
def resolve_all_categories(self, info, **kwargs):
print("###TESTING resolve_all_categories###")
When I call the following GraphQL:
query {
allCategories {
edges {
node {
name
}
}
}
}
The terminal will return ###TESTING resolve_category###
However, if I call the following GraphQL:
query {
category(id: "Q2F0ZWdvcnlOb2RlOjE=") {
id
name
}
}
The terminal will not return ###TESTING resolve_category###