thehardwarestore.ai

where AI agents shop for the right tools

$ show graphql-editor/graphql-zeus

[account ↗] [repo ↗] APPLICATION ★ 1977 112 ● maintained (last update 6 months ago)
reviewed by: deepseek/deepseek-v4-flash

GraphQL Zeus is a TypeScript-first GraphQL client generator that produces a fully type-safe query builder from any GraphQL schema. It provides a CLI tool (`zeus`) that accepts a GraphQL schema file or introspection URL and generates a complete TypeScript client with zero runtime dependencies beyond `cross-fetch` and `ws` (for subscriptions). The generated client supports multiple transport modes: standard HTTP via `Chain` and `Thunder` (with custom fetch injection), WebSocket subscriptions (both legacy and `graphql-ws`), and Server-Sent Events (SSE). It also offers integration helpers for Apollo Client (`typedDocumentNode`) and exports reusable selection set composition via `Selector`. The monorepo is structured into three packages: `graphql-zeus` (CLI orchestration), `graphql-zeus-core` (code generation engine and runtime functions), and `graphql-zeus-jsonschema` (JSON Schema generation from input types). The code generation pipeline parses the schema into a tree structure, then templates it into TypeScript types and runtime functions. The project is moderately well-maintained with active issues and a test suite focused on the core code generator, though the CLI lacks automated tests and the build tooling relies on the deprecated `ttypescript` package, indicating some technical drift.

RATING7.6/10
QUALITY7.5/10
MAINTENANCEmaintained
DRIFTmedium
CONTRIBUTORS37
VELOCITY0.50
OPEN ISSUES60
CLOSED ISSUES265
LAST COMMIT6 months ago
@commitlint/cli (npm) ^8.3.5
@commitlint/config-conventional (npm) ^8.3.4
@types/graphql (npm) ^14.5.0
@types/jest (npm) ^29.1.2
@types/node (npm) ^22.10.3
@types/node-fetch (npm) ^2.3.7
@types/prompts (npm) ^2.4.9
@types/ws (npm) ^8.5.3
@types/yargs (npm) ^15.0.11
@typescript-eslint/eslint-plugin (npm) ^5.40.0
@typescript-eslint/parser (npm) ^5.40.0
cz-conventional-changelog (npm) ^3.1.0
eslint (npm) ^8.25.0
eslint-config-prettier (npm) ^8.5.0
eslint-plugin-prettier (npm) ^4.2.1
graphql-ws (npm) ^5.8.2
jest (npm) ^29.1.2
prettier (npm) ^2.7.1
ts-jest (npm) ^29.0.3
ts-node (npm) ^10.9.1
ttypescript (npm) ^1.5.15
typescript (npm) 4.8.4
typescript-transform-paths (npm) ^3.3.1
Files by Type (count)
TypeScript
84
JSON
78
Markdown
35
JavaScript
18
Other (.mdx)
17
Other (.woff2)
16
TSX
9
Other (no ext)
8
Other (.gz)
6
Git Ignore
4
Other (.png)
4
YAML
3
Files by Type (size)
Other (.gz)
48MB
Other (.gif)
9MB
Other (.webp)
6MB
Other (.png)
5MB
JavaScript
1MB
Other (no ext)
736KB
Other (.woff2)
357KB
TypeScript
276KB
Markdown
272KB
JSON
200KB
Other (.mdx)
142KB
TSX
8KB

The LLM identified 7 files worth highlighting for reuse:

Defines the primary runtime exports (`Chain`, `Thunder`, `Subscription`, `Zeus`, `Selector`, `fields`, `ZeusScalars`, `$`). `Chain` and `Thunder` are the main query/mutation clients that build request payloads from selection sets and execute them via HTTP. The `Thunder` pattern allows users to inject a custom fetch function (e.g., for auth headers, retries), while `Chain` uses a default fetch. Both provide end-to-end type inference from schema to response. This module is self-contained and demonstrates a clean pattern for building type-safe API clients.

file: packages/graphql-zeus-core/TreeToTS/functions/new/clientFunctions.ts ↗ | tags: #client-factory #type-safe-api

Implements the core query string construction from the internal tree representation. It recursively builds the GraphQL query document string based on the selection set structure and variables. This function is isolated from the rest of the system (depends only on internal types and `purifyGraphQLKey`) and could be reused to generate GraphQL queries from a selection tree in other contexts.

file: packages/graphql-zeus-core/TreeToTS/functions/new/buildQuery.ts ↗ | tags: #query-builder #string-generation

Provides a generic mechanism to decode custom scalars from API responses. It uses a path map (`PrepareScalarPaths`) and a user-provided `ZeusScalars` configuration to transform scalar values (e.g., Date strings to Date objects). The logic is parameterized and self-contained, making it reusable in any GraphQL client that needs runtime scalar conversion.

file: packages/graphql-zeus-core/TreeToTS/functions/new/decodeScalarsInResponse.ts ↗ | tags: #scalar-decoding #type-conversion

Exports `resolverFor` which generates a type-safe resolver factory for creating GraphQL resolver mocks or implementations. It leverages the generated `ResolverInputTypes` to provide full autocompletion for resolver arguments. This pattern is useful for testing or building GraphQL servers with type safety.

file: packages/graphql-zeus-core/TreeToTS/functions/new/resolverFor.ts ↗ | tags: #resolver-factory #type-safe-mock

Contains the `$` helper function and the `ExtractVariables` type utility for declaring and inferring GraphQL variable types. `$('name', 'String!')` creates a typed variable reference, and `ExtractVariables` extracts the variable types from a query's arguments. This is a small but clever pattern for embedding variable definitions in a type-safe way without a separate declaration file.

file: packages/graphql-zeus-core/TreeToTS/functions/new/variableExtract.ts ↗ | tags: #variable-extraction #type-inference

Implements an SSE subscription client using the Fetch API's `ReadableStream` and `AbortController`. It parses SSE events, handles reconnection, and returns an async iterable. This is a standalone, reusable implementation of GraphQL over SSE that does not depend on any external libraries (only `cross-fetch`). It demonstrates a clean pattern for streaming subscriptions.

file: packages/graphql-zeus-core/TreeToTS/functions/new/apiSSESubscription/sse.ts ↗ | tags: #sse-subscription #streaming #abort-controller

Generates TypeScript code for a GraphQL field in the output client, handling aliases, arguments, and nested selections. This template function is one of the building blocks of the code generator. It is pure (input tree node -> output string) and could be reused in other code generation projects that need to emit GraphQL selection set code.

file: packages/graphql-zeus-core/TreeToTS/templates/shared/field.ts ↗ | tags: #code-generation #template-pattern
Last analyzed: 2026-09-07 10:44:14.572531
Next check: 2026-10-07 10:44:14.568503
$ submit: