Skip to content

Commit 46c0055

Browse files
committed
Update readme
1 parent 7d7b68b commit 46c0055

File tree

1 file changed

+59
-2
lines changed

1 file changed

+59
-2
lines changed

README.md

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,59 @@
1-
# graphql-query-to-dict
2-
Python package that converts GraphQL query into dictionary.
1+
# gql-query-utils
2+
Python package with graphql queries utilities.
3+
4+
## Install
5+
Install with `pip`:
6+
```commandline
7+
pip install gql-query-utils
8+
```
9+
10+
## Utilities
11+
12+
### Convert graphql query string into dictionary
13+
```python
14+
from gql_query_utils.utils import query_to_dict
15+
16+
query_dict = query_to_dict("""
17+
query GetThisStuff {
18+
viewer {
19+
personal(criteria: {
20+
name: "PETER",
21+
lastName: "SCHMIDT"
22+
}) {
23+
name
24+
address
25+
}
26+
}
27+
}""")
28+
29+
print(query_dict)
30+
```
31+
Output:
32+
```json
33+
{
34+
"query": {
35+
"viewer": {
36+
"personal": {
37+
"__args": {
38+
"criteria": {
39+
"name": "PETER",
40+
"lastName": "SCHMIDT"
41+
}
42+
},
43+
"name": true,
44+
"address": true
45+
}
46+
}
47+
}
48+
}
49+
```
50+
51+
## Usage
52+
53+
```python
54+
from gql_query_utils.utils import query_to_dict
55+
56+
query_to_dict(""" ${GQL_QUERY} """)
57+
```
58+
## License
59+
[MIT](./LICENSE)

0 commit comments

Comments
 (0)