Skip to main content

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

MIT

Project details


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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gql_query_utils-1.0.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file gql_query_utils-1.0.1.tar.gz.

File metadata

  • Download URL: gql_query_utils-1.0.1.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.15

File hashes

Hashes for gql_query_utils-1.0.1.tar.gz
Algorithm Hash digest
SHA256 d5a69513811930f48e698965c97bb69d967fcbe6cc30838666877dd611fece4a
MD5 f17f0131c89feeb51834db69b8c4f0a6
BLAKE2b-256 3a1aa517b3b28301e18f87030797d20c21f2da086d619d5f62d40311bc2d1822

See more details on using hashes here.

File details

Details for the file gql_query_utils-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for gql_query_utils-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 11453857551afc9617ea26d33bb8fbdd995fa732652b5cddefc2a8398cc4ad96
MD5 ea84a618ebbebce9f3e60f01f83f89cd
BLAKE2b-256 68fb0f3c35ea8b852fd8f7bbb708722c75f81179e67cdfb6ada48091065e2260

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page