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

Switch operation_name to operationName in GraphQLTestCase #936

Merged
merged 4 commits into from
Apr 19, 2020
Merged

Switch operation_name to operationName in GraphQLTestCase #936

merged 4 commits into from
Apr 19, 2020

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.

None yet

2 participants