Python package that converts GraphQL query into dictionary.
Project description
gql-query-utils
Python package with graphql queries utilities.
Install
Install with pip
:
pip install gql-query-utils
Utilities
Convert graphql query string into dictionary
from gql_query_utils.utils import query_to_dict
query_dict = query_to_dict("""
query GetThisStuff {
viewer {
personal(criteria: {
name: "PETER",
lastName: "SCHMIDT"
}) {
name
address
}
}
}""")
print(query_dict)
Output:
{
"query": {
"viewer": {
"personal": {
"__args": {
"criteria": {
"name": "PETER",
"lastName": "SCHMIDT"
}
},
"name": true,
"address": true
}
}
}
}
Usage
from gql_query_utils.utils import query_to_dict
query_to_dict(""" ${GQL_QUERY} """)
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gql_query_utils-1.0.1.tar.gz
(6.1 kB
view hashes)
Built Distribution
Close
Hashes for gql_query_utils-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11453857551afc9617ea26d33bb8fbdd995fa732652b5cddefc2a8398cc4ad96 |
|
MD5 | ea84a618ebbebce9f3e60f01f83f89cd |
|
BLAKE2b-256 | 68fb0f3c35ea8b852fd8f7bbb708722c75f81179e67cdfb6ada48091065e2260 |