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.4.7.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.4.7.tar.gz.

File metadata

File hashes

Hashes for macss_modular_api_graphql_client-0.4.7.tar.gz
Algorithm Hash digest
SHA256 5830059d2d017ba5137432f332438d20f162b08f520ead13767d15bcb71e2f23
MD5 ee9caf769d5ef7dfbafa0562053dd786
BLAKE2b-256 2416cff746551000f8594600cd6da7d6918e88a827767b4b5983e4e12858a906

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for macss_modular_api_graphql_client-0.4.7-py3-none-any.whl
Algorithm Hash digest
SHA256 75d8103da4641a6129a37ecb18f4093b8afc02b177abe41376ae336560f19582
MD5 fe936a1068acabfb3e38e3970bbeef70
BLAKE2b-256 2c2a18664e1b592859b05756d9232c13bb6f5a8989987a162b1519e021d23c7b

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