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

Added json dump if passing in a dict, added operation_name #17

Closed
wants to merge 2 commits into from
Closed

Conversation

cjmaio
Copy link

@cjmaio cjmaio commented May 31, 2017

Checks if query (previously query_str) is a dict, and converts using json.dumps otherwise leaves it be.

Adds in the ability to pass in an operation_name to execute

'variables': variable_values or {}
}
if operation_name:
payload.operationName = operation_name
Copy link

Choose a reason for hiding this comment

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

you may always pass operationName, using the same trick as done for variables:

 'operationName': operation_name or ''

@xin7c
Copy link

xin7c commented Apr 15, 2019

I am using gql v0.1.0
But I could not find
"if operation_name:
payload.operationName = operation_name"
in source code.
So, I can't add operation_name like this:
r = client.execute(query, variable_values=json.dumps(params), operation_name="query_from_me")

It take me An error:
TypeError: execute() got an unexpected keyword argument 'operation_name'

So ... why ?

@Cito
Copy link
Member

Cito commented May 15, 2020

Looks like this is outdated now, so I'm closing this. (Also, print_ast should always return str, so I don't understand the purpose of this. Please re-submit if you think it still makes sense.)

@Cito Cito closed this May 15, 2020
@Cito
Copy link
Member

Cito commented May 16, 2020

The operation_name was good though, it has now been added in the v2 and v3 (master) branch. Should have been done earlier.

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.

4 participants