django-graphql-apollo-react-demo icon indicating copy to clipboard operation
django-graphql-apollo-react-demo copied to clipboard

update to code to resolve object pk's properly

Open mbrochh opened this issue 7 years ago • 0 comments

something like this:

class ProductSizeType(DjangoObjectType):
    class Meta:
        model = models.ProductSize
        interfaces = (graphene.Node, )
        local_fields = {
            'pk': graphene.Field(graphene.Int),
        }

    def resolve_pk(self, args, context, info):
        return self.pk


mbrochh avatar Jul 07 '17 07:07 mbrochh