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+jsonand legacyapplication/jsonnegotiation- 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fca11ced3b03844e98485a1bfb07ab4a703bf84b7a0d9988747501672f0d92d8
|
|
| MD5 |
5f2a1aabbc77628cf7fc6d0577d1915e
|
|
| BLAKE2b-256 |
b875caac1251636946c6cf09a1fa85f11feeb40ad2aeff18860eacfbfdc8139d
|
Provenance
The following attestation bundles were made for hayate_graphql-0.1.0.tar.gz:
Publisher:
release.yml on hayatepy/hayate-graphql
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hayate_graphql-0.1.0.tar.gz -
Subject digest:
fca11ced3b03844e98485a1bfb07ab4a703bf84b7a0d9988747501672f0d92d8 - Sigstore transparency entry: 2333838938
- Sigstore integration time:
-
Permalink:
hayatepy/hayate-graphql@ec7fc62271320a5de40bf08f6a129820bf0c1334 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/hayatepy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ec7fc62271320a5de40bf08f6a129820bf0c1334 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88ee7d73c68e9b9199c35267a5e48056e7eb450ccb46b6622bc2548eac236d97
|
|
| MD5 |
90f6f09bdd8f470a55641d12c6ae6723
|
|
| BLAKE2b-256 |
70805a980c125b3bdeb044803008ad24915c5e78373d11cb91650cf073814a88
|
Provenance
The following attestation bundles were made for hayate_graphql-0.1.0-py3-none-any.whl:
Publisher:
release.yml on hayatepy/hayate-graphql
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hayate_graphql-0.1.0-py3-none-any.whl -
Subject digest:
88ee7d73c68e9b9199c35267a5e48056e7eb450ccb46b6622bc2548eac236d97 - Sigstore transparency entry: 2333838959
- Sigstore integration time:
-
Permalink:
hayatepy/hayate-graphql@ec7fc62271320a5de40bf08f6a129820bf0c1334 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/hayatepy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ec7fc62271320a5de40bf08f6a129820bf0c1334 -
Trigger Event:
push
-
Statement type: