Skip to content

raise GraphQLError inside resolver gives me "Received incompatible instance error" after bumping from 3.0.0b7 to 3.0.0b8 #1367

Closed
@zhoudaxia233

Description

@zhoudaxia233
  • What is the current behavior?
  • In graphene-django 3.0.0b8
class Query(ObjectType):
    me = graphene.Field(UserNode)
    def resolve_me(root, info):
        if user.is_anonymous or not user.is_active:
            raise GraphQLError("Unauthenticated.")
        return user

If I send the query without logging in, I get
"Received incompatible instance "<Promise at 0x7ff118d710b1 rejected with GraphQLError('Unauthenticated.')>"."

However, in 3.0.0b7, if I send the same query without logging in, I get
"Unauthenticated." (And this is the behavior I expected.)

  • Please tell us about your environment:

    • Version: graphene-django==3.0.0b8 graphql-core==3.1.7 graphql-relay==3.1.1
    • Platform: Ubuntu

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions