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.

Variable types

Inferred from the request schema: z.string() → String!, z.number().int() → Int!, z.number() → Float!, z.boolean() → Boolean!, z.array(z.string()) → [String!]!, and .optional() drops the !.

Two cases need naming by hand, because nothing in the Zod type could say otherwise:

  • ID — z.string() generates String!, which a server expecting ID! rejects. Write variableTypes: { id: "ID!" }.

  • Input objects — a Zod object cannot name a GraphQL input type. Write variableTypes: { input: "CreateUserInput!" }.