Open JElgar opened 3 years ago
A workaround for this seems to be using
only_fields
instead of fields
I couldn't spot this in the documentation but I may have missed it?
I found only_fields
in the graphene_django
source and it seems to be depreciated so I'm not sure if this is a long-term solution?
When using DjangoObjectType from
graphene_django
it is possible to reduce the fields by setting thefields
in the Meta class.For example:
As expected the output if I try and query something that is not the id:
However when using
graphene_django_extras
this is not working:When using the same snippet as above but with the import
from graphene_django_extras import DjangoObjectType
The output when querying not the id is:
The expected would be the same as the original response (the error). Am I doing something wrong here?