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.7.0.tar.gz (9.0 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.7.0.tar.gz.

File metadata

File hashes

Hashes for macss_modular_api_graphql_client-0.7.0.tar.gz
Algorithm Hash digest
SHA256 dd3b1d16f54b89bff9177f4c906c0a7a9c2d808ca2004a906d8ce80a0b7a4742
MD5 77413f2d7840db22d0e6933dec29393b
BLAKE2b-256 32e1b9248cb338f59260c14e0e9fe6e04157f0dec45619c639a7d44083046d11

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for macss_modular_api_graphql_client-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 21d10dd7ea14da9a23765f25248188b4eb21be7a4f100da9cdbc685fd7faebe9
MD5 d4e49dc308b5194a1fd72c6775eae5aa
BLAKE2b-256 93fd415c6761a85a4743cbd6b009401b9b1f517dcea323603c5ff1c9f0247a74

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