This is a modern GraphQL Type Generator web wrapper built with Next.js 15, featuring a stunning glassmorphism UI and comprehensive developer experience. This project eliminates the need for an extra codegen step in your development process.
- Stunning glassmorphism design with animated gradient backgrounds
- Responsive layout that works beautifully on all devices
- Dark/Light mode toggle with system preference detection πβοΈ
- Animated blob backgrounds with custom CSS animations
- Hover effects and smooth transitions throughout
- Clean, uncluttered interface optimized for both simple and advanced users
- Full-height output area that expands to use all available space
- Interactive copyable examples with hover-to-reveal copy buttons
- GraphQL Endpoint Mode - Connect to live GraphQL APIs with custom headers
- Schema Definition Mode - Paste GraphQL schema definitions directly
- Seamless switching between input modes with preserved state
- Real-time schema validation with error highlighting and helpful messages
- Visual guidance and format hints for schema definitions
- Line count display for schema definition input
- Real-time validation with debounced input (300ms) for smooth typing
- GraphQL spec compliance using official GraphQL parser
- Visual error highlighting with dynamic border colors and status icons
- Helpful error messages with line/column information and suggestions
- Validation state indicators - loading, valid, error states with appropriate badges
- Form integration - prevents generation with invalid schemas
- User-friendly error descriptions with improvement suggestions for common mistakes
- Next.js 15 with App Router for optimal performance
- Server Actions replacing traditional API routes
- TypeScript support with full type safety
- Advanced state management with Zustand for optimal performance
- Keyboard shortcuts for power users β¨οΈ
Ctrl+Enter
: Generate typesCtrl+D
: Download typesEscape
: Cancel requests or clearCtrl+Shift+T
: Toggle themeCtrl+/
: Show shortcuts help
- URL parameter support for quick sharing and bookmarking
- TypeScript Types - Basic schema types (default)
- TypeScript Operations - Query/mutation types for operations
- GraphQL Request SDK - Ready-to-use SDK with fetch methods
- Typed Document Node - Pre-compiled DocumentNode for better performance
- React Query Hooks - TanStack Query hooks for React applications
- TypeScript Resolvers - Server-side resolver type signatures
- Smart Dependencies - Automatically includes required base plugins
- Format Validation - Ensures operations are provided when needed
- Real-time generation metrics (time, file size, type count)
- Request cancellation with AbortController
- Performance tracking using high-precision timers
- Smart file size formatting (B/KB/MB)
- Visual format indicators showing which formats were generated
- Public & Private GraphQL endpoints with custom header support π
- Direct schema definition input for offline development π
- Authentication headers (Bearer tokens, API keys, custom headers)
- GraphQL Operations Input for client SDK generation
- Copy to clipboard with visual feedback π
- Download as .ts file with proper TypeScript MIME type π
- Error handling with user-friendly messages
- Loading states with cancel functionality
- State persistence - Form data persists across browser sessions
- Comprehensive metadata with targeted keywords and descriptions
- Structured data (JSON-LD) for enhanced search engine understanding
- Open Graph & Twitter Cards for social media sharing
- Dynamic sitemap.xml with proper priorities and change frequencies
- robots.txt with crawl guidelines and sitemap reference
- Web app manifest for PWA capabilities
- About page with detailed feature descriptions and technical information
You can find the deployed page on GraphQL Type Generator.
To run locally:
# Install dependencies
yarn install
# Run the development server
yarn dev
Open http://localhost:3000 with your browser to see the result.
-
Endpoint Mode:
- Select "Endpoint URL" tab
- Enter your GraphQL endpoint in the input field
- Add custom headers if needed (for private APIs)
- Click "Generate Types" or use
Ctrl+Enter
-
Schema Definition Mode:
- Select "Schema Definition" tab
- Paste or type your GraphQL schema directly
- Real-time validation provides instant feedback on schema correctness
- Visual indicators show validation status (valid/error/validating)
- Use the provided examples as templates
- Click "Generate Types" or use
Ctrl+Enter
(disabled until schema is valid)
-
Advanced Configuration:
- Click "Output Formats" to access advanced options
- Select multiple output formats (TypeScript, React Query, etc.)
- Add GraphQL operations for client SDK generation
- Configure custom headers for authentication
-
URL Parameter: Pass the endpoint as a query parameter:
https://graphql-codegen.vercel.app/?graphqlApiEndpoint=https://your-api.com/graphql
-
Keyboard Shortcuts: Use
Ctrl+Enter
to generate,Ctrl+D
to download, orCtrl+/
for help
type Query {
user: User
posts: [Post!]!
}
type User {
id: ID!
name: String!
email: String!
}
type Post {
id: ID!
title: String!
content: String!
author: User!
}
- Star Wars API:
https://swapi-graphql.netlify.app/.netlify/functions/index
- Countries API:
https://countries.trevorblades.com/
- SpaceX API:
https://spacex-production.up.railway.app/
- GitHub GraphQL API:
https://api.github.com/graphql
- Header:
Authorization: Bearer YOUR_GITHUB_TOKEN
- Header:
- Shopify Admin API:
https://YOUR_SHOP.myshopify.com/admin/api/2023-10/graphql.json
- Header:
X-Shopify-Access-Token: YOUR_ACCESS_TOKEN
- Header:
- Hasura GraphQL:
https://YOUR_HASURA_PROJECT.hasura.app/v1/graphql
- Header:
x-hasura-admin-secret: YOUR_ADMIN_SECRET
- Header:
- Secure server-side processing - All GraphQL introspection happens on our servers
- No data storage - We don't store your schemas, endpoints, or generated code
- No tracking - We don't track your usage or collect personal information
- Open source - Full transparency with publicly available code
This project uses cutting-edge web technologies:
- Next.js 15 with App Router for superior performance and developer experience
- Server Actions instead of API routes for type-safe server functions
- Tailwind CSS with shadcn/ui for beautiful, accessible components
- TypeScript for complete type safety throughout the application
- next-themes for seamless dark/light mode switching
- GraphQL Tools for schema parsing, introspection, and validation
- Next.js 15 - React framework with App Router
- React 19 - Latest React with concurrent features
- TypeScript 5.6 - Type-safe JavaScript
- Zustand - Lightweight state management
- Tailwind CSS - Utility-first CSS framework
- shadcn/ui - High-quality React components
- next-themes - Theme management
- GraphQL Codegen - Code generation
- GraphQL Tools - Schema utilities
- β Real-time Schema Validation - Live validation with error highlighting and helpful messages
- β Schema Definition Input - Direct schema paste/type functionality
- β Dual Input Modes - Toggle between endpoint URL and schema definition
- β Comprehensive SEO - Metadata, structured data, sitemap, robots.txt
- β Interactive Copy Examples - Hover-to-reveal copy buttons on all examples
- β About Page - Detailed information and feature descriptions
- β Enhanced Privacy Messaging - Accurate server-side processing claims
- β Full-Height Output - Textarea expands to use all available space
- β UI Polish - Removed redundant format display, improved layout
- β Enhanced UX - Better visual guidance and error handling
- Schema Introspection Visualization - Interactive schema explorer
- Configuration Presets - Save and reuse common configurations
- Auto-generation from URLs - Automatically generate when URL contains endpoint
- Schema Suggestions - Auto-complete and intelligent schema suggestions
- Schema Diff Comparison - Compare schemas between versions
- Batch Processing - Handle multiple endpoints simultaneously
- Advanced Caching - Smart caching for repeated schema requests
- Loading Skeletons - Better loading states with skeleton UI
- Export History - Track and manage previous generations
- Plugin System - Custom codegen plugin integration
- Team Collaboration - Share configurations and schemas
- API Documentation - Auto-generate docs from schema
- Performance Analytics - Track usage patterns and optimization
- β Modern UI Redesign - Glassmorphism with animated backgrounds
- β Dark/Light Mode - Theme switching with system preference
- β Copy to Clipboard - With visual feedback and success states
- β Download Functionality - Save as TypeScript files
- β Keyboard Shortcuts - Complete shortcut system with help modal
- β Performance Metrics - Real-time generation tracking
- β Request Cancellation - Abort long-running requests
- β Custom Headers Support - Authentication headers, API keys, and custom headers
- β Next.js 15 Migration - App Router with server actions
- β shadcn/ui Integration - Modern component library
- β TypeScript 5.6 - Latest TypeScript features
- β Multiple Output Formats - TypeScript, React Query, GraphQL Request, Resolvers, etc.
- β Advanced State Management - Zustand for optimal performance and clean architecture
- β Modal-based UI - Clean interface with progressive disclosure
- β GraphQL Operations Support - Client SDK generation with operation inputs
- β Smart Format Dependencies - Automatic plugin dependency resolution
- β State Persistence - Form data persists across browser sessions
- β Schema Definition Input - Direct schema paste functionality
- β Real-time Schema Validation - Live validation with GraphQL spec compliance and helpful error messages
- β Dual Input Modes - Endpoint URL and Schema Definition switching
- β SEO Optimization - Complete SEO package with metadata, structured data, sitemap
- β Copyable Examples - Interactive copy functionality for all code examples
- β Enhanced About Page - Comprehensive tool information and features
- β Privacy & Security - Accurate messaging about server-side processing
- β UI/UX Polish - Full-height output, improved layout, better visual hierarchy
Contributions are welcome! Please feel free to submit a Pull Request. The project is designed with extensibility in mind, making it easy to add new features.
This project is open source and available under the MIT License.