Skip to main content

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

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.6.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.6.0.tar.gz.

File metadata

File hashes

Hashes for macss_modular_api_graphql_client-0.6.0.tar.gz
Algorithm Hash digest
SHA256 369f6ef7cc6459eed2e05363c463f43c2ee5090fcfa6b671a40d2551cc274970
MD5 7f5c8d2995483c76118ea4a47a48914f
BLAKE2b-256 ee638be9ee53d882f82cf98382add136c735d59f861c6b0a3da4746df921c57e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for macss_modular_api_graphql_client-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a09e5ad7e84daa3de18f3e049023a4eff5a263addd465c5712f1fc21b29f17d4
MD5 6a5a0fb8bdc9110723f9b63832d76afc
BLAKE2b-256 586e7dfbb1a57d3f2f54d6a8e2c470870ab9b1dcbdca4e3c38b3bf129ae4b0a5

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