
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.
⚡ Thunderous Type Safety
Complete end-to-end type inference from your GraphQL schema. TypeScript knows exactly what’s available at every level.
⚡ Lightning Fast
Build queries naturally with an intuitive, chainable API. No need to write GraphQL strings by hand.
🚀 Zero Runtime Overhead
All the magic happens at build time. Your production bundle stays lean and fast.
🔧 Works Everywhere
Compatible with Apollo Client, React Query, urql, and any GraphQL client through TypedDocumentNode.
📡 Real-time Ready
Built-in support for WebSocket and SSE subscriptions for real-time updates.
🎨 Custom Scalars
Full support for custom scalar encoding/decoding with complete type safety.
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 perfectlyFeature Comparison
| Feature | Zeus | Apollo Client | urql | graphql-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
💬 Discord Community
Join our Discord for help, discussions, and community support
🐛 GitHub Issues
Report bugs or request features on our GitHub repository
📖 Documentation
Explore our comprehensive documentation and guides