Skip to main content

Official MACSS outbound GraphQL client for Python.

Project description

macss-modular-api-graphql-client

Official MACSS outbound GraphQL client for Python.

Quick start

from modular_api_graphql_client import GraphqlRequest, ServiceClientConfig, graphql_client

result = graphql_client(
    config=ServiceClientConfig(
        service_id="users-graphql",
        base_url="https://api.example.test",
        redacted_summary="users-graphql@example",
        default_headers={"accept": "application/json"},
    ),
    request=GraphqlRequest(
        operation_id="users.query",
        document="query GetUsers { users { id } }",
        operation_name="GetUsers",
    ),
    decoder=lambda value: dict(value or {}),
)

if result.is_success:
    print(result.value.data)
    print(result.value.errors)
else:
    print(result.failure.message)

Current slice

  • query-only GraphQL POST requests to /graphql
  • normalized GraphqlResponse[T] with data, errors, extensions, and metadata
  • persistent GraphqlClient
  • one-shot graphql_client() helper
  • transport failures kept separate from GraphQL error envelopes

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

macss_modular_api_graphql_client-0.5.0.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file macss_modular_api_graphql_client-0.5.0.tar.gz.

File metadata

File hashes

Hashes for macss_modular_api_graphql_client-0.5.0.tar.gz
Algorithm Hash digest
SHA256 7bf9e871142adec5bfe359436f6d106c0d9487719fa16ec672a9bb343746d252
MD5 003f90ab963053ea1b99e1ef17e493e1
BLAKE2b-256 71d19ada7a06ab7d4a8eff7b6c7d864562a2c7b73fa5ea83b6101a739c81a089

See more details on using hashes here.

File details

Details for the file macss_modular_api_graphql_client-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for macss_modular_api_graphql_client-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 db5ad6bdcb03dcdc612d308b4be0f7e741c8bdd8d4d1c2c9ea779510b37ffa12
MD5 53a06ff377e933639a5be79ea0fc9a54
BLAKE2b-256 3118df79ddcce043a7d30683cd5b9bac6bdbca729c813fbe3cf03e691e8982c3

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