Skip to main content

hayate-graphql

Hayate ecosystem: Start here · Production golden app · Tested compatibility

GraphQL over HTTP for Hayate, powered directly by graphql-core.

hayate-graphql is deliberately a small hosting layer. Hayate owns HTTP and request context; graphql-core owns the GraphQL language, schema, validation, coercion, execution, and introspection. The package does not introduce another schema DSL.

Status: alpha (0.1.x), typed. GET and JSON POST, media negotiation, Hayate context, bounded execution, the official GraphQL-over-HTTP audit, and Workerd/Pyodide execution are covered. See DESIGN.md for the package boundary and CHANGELOG.md for release history.

Install

uv add hayate-graphql

Usage

from graphql import GraphQLField, GraphQLObjectType, GraphQLSchema, GraphQLString
from hayate import Hayate
from hayate_graphql import GraphQL

schema = GraphQLSchema(
    query=GraphQLObjectType(
        "Query",
        {"hello": GraphQLField(GraphQLString, resolve=lambda *_: "world")},
    )
)

app = Hayate()
GraphQL(schema, path="/graphql").mount(app)

Resolvers receive the Hayate Context as GraphQL's context value by default:

def resolve_viewer(root, info):
    principal = info.context.get("principal")
    return {"name": principal.name}

An async context factory can create a different value and inspect validated request extensions:

async def context_value(c, request):
    return {"request": c.req, "principal": c.get("principal")}


GraphQL(schema, context_value=context_value).mount(app)

Operational limits are enabled by default and can be tuned or disabled explicitly:

GraphQL(
    schema,
    max_body_size=1024 * 1024,
    max_tokens=10_000,  # None disables the parser token limit
    max_depth=20,  # None disables the operation depth limit
    allow_introspection=False,
).mount(app)

HTTP behavior

  • GET queries and JSON POST requests
  • application/graphql-response+json and legacy application/json negotiation
  • correct separation of transport, request, and execution errors
  • mutations rejected over GET
  • body, token, and operation-depth limits
  • optional introspection disabling and custom validation rules

Multipart uploads, a schema DSL, federation, UI assets, and subscription transports are outside the initial package boundary.

Verification

uv run pytest
uv run mypy src tests
uv run ruff check .
npm ci
npm run audit
uv build
scripts/check_workerd.sh dist/hayate_graphql-0.1.0-py3-none-any.whl

The Workerd check requires Node.js 24, builds a portable Pyodide bundle, starts a local Workerd instance, and executes a real GraphQL request through Hayate's Workers adapter.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hayate_graphql-0.1.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

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

hayate_graphql-0.1.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file hayate_graphql-0.1.0.tar.gz.

File metadata

  • Download URL: hayate_graphql-0.1.0.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for hayate_graphql-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fca11ced3b03844e98485a1bfb07ab4a703bf84b7a0d9988747501672f0d92d8
MD5 5f2a1aabbc77628cf7fc6d0577d1915e
BLAKE2b-256 b875caac1251636946c6cf09a1fa85f11feeb40ad2aeff18860eacfbfdc8139d

See more details on using hashes here.

Provenance

The following attestation bundles were made for hayate_graphql-0.1.0.tar.gz:

Publisher: release.yml on hayatepy/hayate-graphql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hayate_graphql-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: hayate_graphql-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for hayate_graphql-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 88ee7d73c68e9b9199c35267a5e48056e7eb450ccb46b6622bc2548eac236d97
MD5 90f6f09bdd8f470a55641d12c6ae6723
BLAKE2b-256 70805a980c125b3bdeb044803008ad24915c5e78373d11cb91650cf073814a88

See more details on using hashes here.

Provenance

The following attestation bundles were made for hayate_graphql-0.1.0-py3-none-any.whl:

Publisher: release.yml on hayatepy/hayate-graphql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page