0

I have added this to my Query class and it's returning null in response.

me = graphene.Field(UserType)

def resolve_user(root, info):
    logger.info("***** Inside resolve ****")
    return info.context.user

and my UserType is defined like this.

class UserType(DjangoObjectType):
    fields = ["id", "name", "email", "username"]

    class Meta:
        model = User

I'm on Django==3.0 if it helps

I'm authenticated and the cookies are present. It's not even printing the log which is confusing me.

manu
  • 1,072
  • 1
  • 14
  • 26

1 Answers1

2

Graphene fields use resolve_<field> pattern to resolve the values. Check more here

me = graphene.Field(UserType)
^^

def resolve_me(root, info):
    logger.info("***** Inside resolve ****")
    return info.context.user
Metsavaht
  • 618
  • 1
  • 7
  • 10