graphene icon indicating copy to clipboard operation
graphene copied to clipboard

Cannot recognize query whose operation name contains space

Open ExHix opened this issue 3 years ago • 2 comments

I met a query whose operation name contains space

schema = Schema(query=Query)
result = schema.execute(
    '''
      query user login ($un: String, $pw: String) {
        r: User (username: $un, password: $pw) {
          id, username, token
        }
      }
    ''',
    variables={'un': "test", 'pw': "123"}
)
print(result.data)

This code printed out None. But if I remove this space, everything works fine. I wonder if it is graphene itself issue.

ExHix avatar Jul 02 '22 02:07 ExHix

http://spec.graphql.org/draft/#sec-Names Spaces are not allowed in GraphQL names.

erikwrede avatar Jul 02 '22 09:07 erikwrede

But there should be an error in result.errors!

erikwrede avatar Jul 02 '22 13:07 erikwrede