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.

Metadata

Release files for hayate-graphql 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hayate-graphql 0.1.0
File Size Uploaded Provenance
hayate_graphql-0.1.0.tar.gz 7.9 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for hayate-graphql 0.1.0
File Interpreter ABI Platform
hayate_graphql-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.2 kB

Release files / hayate_graphql-0.1.0.tar.gz

Download URL hayate_graphql-0.1.0.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
fca11ced3b03844e98485a1bfb07ab4a703bf84b7a0d9988747501672f0d92d8
BLAKE2b-256 checksum
How to use checksums
b875caac1251636946c6cf09a1fa85f11feeb40ad2aeff18860eacfbfdc8139d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 3, 2026.

Transparency log

Release files / hayate_graphql-0.1.0-py3-none-any.whl

Download URL hayate_graphql-0.1.0-py3-none-any.whl
Size 9.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
88ee7d73c68e9b9199c35267a5e48056e7eb450ccb46b6622bc2548eac236d97
BLAKE2b-256 checksum
How to use checksums
70805a980c125b3bdeb044803008ad24915c5e78373d11cb91650cf073814a88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 3, 2026.

Transparency log

Security for hayate-graphql 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for hayate_graphql-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 3, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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