I am experiencing an issue with get_node
method in a django object type definition. The method doesn't seem to be called in my case.
I even tried debugging with pdb
by pausing execution inside the get_node
method, didn't work either.
This is a sample of my code
class DocumentGQL(DjangoObjectType):
class Meta:
model = Document
interfaces = (graphene.relay.Node,)
@classmethod
def get_node(cls, info, id):
logger.info(id)
...
class Query(graphene.ObjectType):
document = graphene.relay.Node.Field(DocumentGQL)
And console output
"POST /graphql/ HTTP/1.1" 200 26
Graphql Query
{
document(id:"e551a1e5-6fae-47c2-be87-3feeb802bf7f"){
description
id
}
}
Graphql output
{
"data": {
"document": null
}
}
I believe I followed the docs when doing this. Am I missing something? Kindly assist.