Skip to content
TypeWire

@tahanabavi/typefetch-graphql

v0.1.0

GraphQL transport for TypeFetch contracts — one client, one middleware chain, and selection sets generated from your Zod response schema.

Endpoint fields

FieldRequiredMeaning
operationyes"query" or "mutation"
root—The single field to unwrap, so response describes data.user rather than data. Also the field the variables attach to as arguments.
document—A hand-written operation. Omit it to have one generated.
operationName—Defaults to the endpoint id in PascalCase (user.get → UserGet).
variableTypes—GraphQL types for variables the Zod type cannot name — { id: "ID!" }.
errorPolicy—"none" (default) or "all". See below.

Everything transport-independent — auth, permission, errors, mockData, headers, test — works exactly as it does for an HTTP endpoint.