Skip to content

Conversation

@noelleleigh
Copy link
Contributor

The documentation for serving GraphQL over HTTP recommends that the operation name be specified by an operationName parameter.

The GraphQLTestCase.query() method ends up creating a request that uses snake_case operation_name instead. This PR addresses that.

I wasn't sure how to write a complete test for this using GraphQLTestCase itself since it requires a database, so I settled for just testing the arguments that were used for Client.post().

Copy link
Member

@jkimbo jkimbo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good find! Looks like this was a bug because the GraphQLView only looks for operationName:

operation_name = request.GET.get("operationName") or data.get("operationName")

@jkimbo jkimbo merged commit dc5c971 into graphql-python:master Apr 19, 2020
@noelleleigh noelleleigh deleted the fix-op_name-argument branch April 19, 2020 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants