Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot recognize query whose operation name contains space #1435

Open
ExHix opened this issue Jul 2, 2022 · 2 comments
Open

Cannot recognize query whose operation name contains space #1435

ExHix opened this issue Jul 2, 2022 · 2 comments
Labels

Comments

@ExHix
Copy link

ExHix commented Jul 2, 2022

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 ExHix added the 🐛 bug label Jul 2, 2022
@erikwrede
Copy link
Member

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

@erikwrede
Copy link
Member

But there should be an error in result.errors!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants