Skip to Content
GraphQL Zeus - TypeScript-first GraphQL Client
Zeus, the Olympian god of thunder, wielding a lightning bolt.

GraphQL with Divine Precision

TypeScript-first GraphQL client with complete type safety

Strike your queries with lightning-fast type inference. Build GraphQL clients with absolute type safety and zero runtime overhead.

Why GraphQL Zeus?

GraphQL Zeus is the ultimate TypeScript-first GraphQL client that gives you complete end-to-end type safety, intuitive query building, and zero runtime overhead.

Quick Example

See how Zeus transforms your GraphQL development:

import { Chain } from './zeus'; // Create a type-safe client const chain = Chain('https://your-api.com/graphql'); // Write a fully typed query const user = await chain('query')({ user: [ { id: '123' }, // arguments are type-checked { id: true, name: true, email: true, posts: { title: true, content: true, createdAt: true, }, }, ], }); // The response is fully typed! console.log(user.user.name); // TypeScript knows this exists console.log(user.user.posts[0].title); // Nested types work perfectly

Feature Comparison

FeatureZeusApollo Clienturqlgraphql-request
Type Safety✅ Full⚠️ Partial⚠️ Partial⚠️ Partial
IntelliSense✅ Complete❌ Limited❌ Limited❌ Limited
Bundle Size✅ Zero overhead⚠️ ~100kb✅ ~15kb✅ ~5kb
Setup Time✅ < 1 minute⚠️ 10+ minutes⚠️ 5+ minutes⚠️ 5+ minutes
Subscriptions✅ WS + SSE✅ WS only✅ WS only❌ No
Custom Scalars✅ Built-in⚠️ Manual⚠️ Manual⚠️ Manual

Key Features

Complete Type Safety

Zeus generates TypeScript types directly from your GraphQL schema. Every query, mutation, and subscription is fully typed with IntelliSense support:

// Zeus knows your schema intimately const result = await chain('query')({ products: [ { category: 'electronics' }, // TypeScript validates this { id: true, name: true, price: true, // TypeScript suggests all available fields }, ], }); // Result type is automatically inferred type ProductResult = typeof result;

Selector Composition

Create reusable selection sets and compose them:

import { Selector } from './zeus'; // Create reusable selectors const userFields = Selector('User')({ id: true, name: true, email: true, }); const postFields = Selector('Post')({ id: true, title: true, content: true, author: userFields, // Compose selectors }); // Use them in queries const posts = await chain('query')({ posts: postFields, });

Multiple Integration Options

Zeus works with any GraphQL client:

  • Chain - Direct, type-safe queries
  • Thunder - Custom fetch with full control
  • TypedDocumentNode - Compatible with Apollo, urql, React Query
  • Subscriptions - WebSocket and SSE support

Real-time Subscriptions

Built-in support for both WebSocket and SSE subscriptions:

import { Subscription, SSESubscription } from './zeus'; // WebSocket subscriptions const sub = Subscription('wss://api.com/graphql'); sub('subscription')({ messageAdded: { id: true, content: true, author: { name: true }, }, }).on((data) => { console.log('New message:', data.messageAdded); }); // SSE subscriptions const sse = SSESubscription('https://api.com/graphql'); const stream = sse('subscription')({ liveMetrics: { timestamp: true, activeUsers: true, }, }); stream.on((data) => { console.log('Metrics:', data.liveMetrics); });

Get Started in 30 Seconds

# Install Zeus npm install graphql-zeus # Generate your client npx zeus https://your-api.com/graphql ./src # Start using it import { Chain } from './src/zeus'; const chain = Chain('https://your-api.com/graphql');

Ready to get started? Installation Guide →

Community & Support

Last updated on