A strongly-typed GraphQL client generator that produces TypeScript types and helper functions from your GraphQL schema. Current stable version 7.2.1 (2024) releases frequently. Key differentiators: generates a complete client library (not just types), supports aliases, union/interface resolution, typedDocumentNode for Apollo/urql, custom scalars, and Thunder helper for custom fetch. Unlike graphql-codegen, Zeus provides a builder-pattern client that enforces typed selections without code generation on queries. Works in Node, browser, React Native.
npm install graphql-zeusNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Generates a client from a GraphQL endpoint, then executes a typed query with variables.
Regenerate client with v7 CLI. Import typedGql from './zeus/typedDocumentNode' instead of './zeus'.
Use the same syntax for both queries and mutations; pass operation type as first argument.
Replace Chain usage with Gql or Thunder.
Ensure type strings match schema; e.g., $('id', 'String!') not $('id', 'string')If scalars are missing, define them with ZeusScalars to avoid runtime errors.
Run npx graphql-zeus <endpoint> ./zeus --typescript and ensure import path matches the folder name.
Check that variables defined with $() match the schema type exactly, including required (!) and that variables object keys match.
Use __alias in the query object to match expected response shape: { __alias: { myCards: { drawCard: { ... } } } }