-
Notifications
You must be signed in to change notification settings - Fork 184
Using gql
for query editing
#272
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
Comments
You can use the DSL module to create requests programmatically. To convert a |
I was able to convert a query to import gql
dg = gql.gql("""
query getContinents {
continents {
code
name
}
}
""")
from graphql import print_ast
print(print_ast(dg))
However, I don't see any methods that allow to traverse the tree to find |
It is not enough for editing to just use DSL to create queries. This one is addressed.
However, two more questions are still left.
|
This not really a gql question but instead a graphql-core question. You might want to look at the dsl module source code which does exactly that. |
Can
qgl
be used to programmatically modify queries?For example to transform this request.
To this one.
gql.gql()
parses the input intographql
ASTDocumentNode
, but it is not clear which methods are available to modify it, and how to write the query back as a string.The text was updated successfully, but these errors were encountered: