Skip to content

Releases: productdevbook/nitro-graphql

v1.3.0

26 Aug 12:47
Compare
Choose a tag to compare

   🚨 Breaking Changes

   🚀 Features

   🐞 Bug Fixes

    View changes on GitHub

v1.2.0

21 Aug 13:58
Compare
Choose a tag to compare

   🚀 Features

    View changes on GitHub

v1.1.0

26 Jul 09:30
Compare
Choose a tag to compare

   🚨 Breaking Changes

   🚀 Features

   🐞 Bug Fixes

  • Correct order of arguments in defu for merged configuration in client and server code generation  -  by @productdevbook (246d7)
    View changes on GitHub

v1.0.0

19 Jul 07:40
Compare
Choose a tag to compare

🚀 Nitro GraphQL v1.0.0 - Production Ready Release

"GraphQL is not just a query language; it's a new way to think about APIs and client-server interaction."

We're thrilled to announce Nitro GraphQL v1.0.0 - the first stable release of our comprehensive GraphQL integration for the Nitro ecosystem! This milestone represents months of development, community feedback, and battle-testing to create the most developer-friendly GraphQL solution for Nitro-powered applications.

🎯 What is Nitro GraphQL?

Nitro GraphQL is a standalone module that seamlessly integrates GraphQL servers into any Nitro-based application with automatic type generation, file watching, and zero-configuration setup. Whether you're building with Nuxt, standalone Nitro, or any other Nitro-compatible framework, you can now add a production-ready GraphQL API in minutes.

✨ What's New in v1.0.0

🚀 Production-Ready Stability

  • Battle-tested architecture with comprehensive error handling
  • Memory-optimized hot reloading for development
  • Production-ready bundling with smart chunking and dynamic imports
  • Enhanced type safety throughout the entire codebase

🔧 Auto-Generated Client SDK (v0.5.0+)

One of our biggest features - automatic generation of type-safe GraphQL clients for Nuxt applications:

// Automatically generated from your GraphQL files
import { createGraphQLClient } from '#graphql/client'

const client = createGraphQLClient()
const { users } = await client.GetUsers() // Fully typed!

📝 Enhanced Type Generation

  • Server types: Complete TypeScript definitions for resolvers and schema (#graphql/server)
  • Client types: Auto-generated operation types and SDK (#graphql/client)
  • Hot reload support: Types update automatically during development
  • Improved codegen options for better type safety and performance

🎮 Developer Experience Improvements

  • Named export pattern: Export multiple resolvers from single files
  • Auto-discovery: Automatically scans and loads GraphQL files
  • Zero configuration: Sensible defaults with optional customization
  • File-based organization: Domain-driven resolver and schema structure
  • Built-in Apollo Sandbox: Interactive GraphQL playground

🌐 Universal Framework Support

Works seamlessly with any Nitro-powered framework:

  • Nuxt.js: First-class integration with dedicated module
  • Standalone Nitro: Direct integration for custom applications
  • Any Nitro-compatible framework: Universal compatibility

🏗️ Key Features

Multi-Framework GraphQL Support

  • GraphQL Yoga: Lightweight, performant GraphQL server
  • Apollo Server: Enterprise-grade GraphQL implementation
  • Seamless switching between frameworks

Intelligent File Organization

server/graphql/
├── schema.graphql              # Main schema
├── users/
│   ├── user.graphql           # User schema
│   ├── user-queries.resolver.ts
│   └── create-user.resolver.ts
└── posts/
    ├── post.graphql
    └── post-queries.resolver.ts

Powerful Utilities

  • defineResolver() - Complete resolver definitions
  • defineQuery() - Query-only resolvers
  • defineMutation() - Mutation-only resolvers
  • defineSubscription() - Real-time subscriptions
  • defineType() - Custom type resolvers
  • defineSchema() - Schema validation with Zod/Valibot

Type-Safe Development

Auto-generated TypeScript types for seamless development:

Server-side types (#graphql/server):

import type { User, Post, CreateUserInput } from '#graphql/server'

export const userResolver = defineResolver({
  Query: {
    users: async (): Promise<User[]> => {
      return await db.users.findMany() // Fully typed
    }
  }
})

Client-side types (#graphql/client):

import type { GetUsersQuery, CreateUserInput } from '#graphql/client'

const users = ref<GetUsersQuery['users']>([])
const createUser = async (input: CreateUserInput) => {
  return await client.CreateUser({ input }) // Type-safe
}

Advanced Features

  • Custom scalars (DateTime, JSON, etc.)
  • Error handling patterns
  • Authentication & authorization
  • Database integration (Prisma, Drizzle compatible)
  • Health check endpoints

📊 Performance & Reliability

Optimized for Production

  • Smart bundling: Efficient code splitting for optimal performance
  • Memory management: Optimized hot reloading without memory leaks
  • Type caching: Intelligent type generation caching
  • Minimal overhead: Lightweight runtime with maximum functionality

Enhanced Error Handling

  • Comprehensive error reporting during development
  • Production-safe error messages
  • Type-safe error handling in resolvers
  • Detailed logging for debugging

🔄 Migration & Breaking Changes

Named Exports (Breaking Change)

The module now requires named exports for all resolvers:

// ❌ v0.x (deprecated)
export default defineResolver({ ... })

// ✅ v1.0.0 (required)
export const userResolver = defineResolver({ ... })
export const postResolver = defineResolver({ ... })

Updated Import Paths

More explicit import paths for better developer experience:

// Import utilities
import { defineResolver } from 'nitro-graphql/utils/define'

// Auto-imports still work (recommended)
export const resolver = defineResolver({ ... })

🚀 Quick Start

Installation

# Choose your GraphQL framework
pnpm add nitro-graphql graphql-yoga graphql
# or
pnpm add nitro-graphql @apollo/server graphql

Configuration

// nitro.config.ts
export default defineNitroConfig({
  modules: ['nitro-graphql'],
  graphql: {
    framework: 'graphql-yoga', // or 'apollo-server'
  },
})

Your First Schema

# server/graphql/schema.graphql
type Query {
  hello: String!
  users: [User!]!
}

type User {
  id: ID!
  name: String!
  email: String!
}

Your First Resolver

// server/graphql/hello.resolver.ts
export const helloResolver = defineResolver({
  Query: {
    hello: () => 'Hello from GraphQL!',
    users: async (_, __, { storage }) => {
      return await storage.getItem('users') || []
    },
  },
})

That's it! Your GraphQL API is ready at /api/graphql 🎉

📈 Community & Ecosystem Growth

Growing Adoption

  • Production deployments across various industries
  • Active community contributing features and improvements
  • Framework integrations expanding the ecosystem

Community Contributions

Special thanks to our contributors who helped make v1.0.0 possible:

  • Enhanced type safety improvements
  • Client SDK development
  • Documentation enhancements
  • Bug fixes and performance optimizations

🔮 What's Next?

Planned Features

  • Subscription support for real-time applications
  • Advanced caching strategies
  • Database adapter ecosystem (Prisma, Drizzle, etc.)
  • VS Code extension for enhanced development
  • Performance monitoring tools

Community Roadmap

  • Framework examples and integrations
  • Video tutorials and learning resources
  • Testing utilities and best practices
  • Deployment guides for various platforms

🙏 Acknowledgments

This release wouldn't be possible without:

  • Our amazing community for feedback and contributions
  • The Nitro team for building an incredible foundation
  • GraphQL ecosystem maintainers for excellent tooling
  • Early adopters who tested and provided valuable feedback

🚨 Important Notes

Node.js Requirements

  • Node.js 20.x or later required
  • pnpm recommended as package manager
  • Corepack enabled for optimal experience

TypeScript Support

  • Full TypeScript support with auto-generated types
  • IDE integration with IntelliSense and autocompletion
  • Type safety from schema to runtime

📚 Resources

🎉 Get Started Today

npx create-nitro-app my-graphql-app
cd my-graphql-app
pnpm add nitro-graphql graphql-yoga graphql

Ready to revolutionize your API development? Nitro GraphQL v1.0.0 brings the power of GraphQL to the Nitro ecosystem with unmatched developer experience and production-ready reliability.


Happy coding! 🚀

The Nitro GraphQL Team


📋 Full Changelog

v1.0.0 (2024-12-XX)

  • 🎉 MAJOR: First stable release
  • 🚀 FEAT: Production-ready architecture
  • 📝 DOCS: Updated README with GraphQL philosophy
  • 🔧 BREAKING: Named exports required for resolvers
  • PERF: Optimized bundling and memory usage

v0.5.0 (Previous)

  • 🚀 FEAT: Auto-generate Nuxt ofetch GraphQL client for quick start
  • 📦 DEPS: Update dependencies in pnpm-workspace.yaml

v0.4.0 (Previous)

  • 🛠️ FIX: Remove unused GraphQL mutation variable types from SDK
  • 🔧 FEAT: Add codegen options to client type generation
  • 🔥 FIX: Hot reload client types
  • 🎯 FIX: Improve type definitions for server options

v0.3.0 (Previous)

  • 🚀 FEAT: Create default GraphQL server directory and examples
  • 🔧 FIX: Update GraphQL schema definitions
  • 📝 DOCS: Add...
Read more

v0.5.0

19 Jul 07:18
Compare
Choose a tag to compare

   🚀 Features

   🐞 Bug Fixes

  • Remove unused GraphQL mutation variable types from sdk.ts and update client codegen plugins  -  by @productdevbook in #12 (c18c2)
    View changes on GitHub

v0.4.0

17 Jul 18:45
Compare
Choose a tag to compare

   🚀 Features

   🐞 Bug Fixes

    View changes on GitHub

v0.3.0

16 Jul 18:40
Compare
Choose a tag to compare

   🚀 Features

   🐞 Bug Fixes

    View changes on GitHub

v0.2.0

15 Jul 13:08
Compare
Choose a tag to compare

   🚀 Features

  • Implement GraphQL file watcher and automatic type generation  -  by @productdevbook (9ed16)
  • Add createResolver utility and move generated types to .nitro directory  -  by @productdevbook (37ef8)
  • Add Resolvers interface to types for improved type safety  -  by @productdevbook (5b4e0)
  • Enhance Apollo Sandbox HTML with caching and improve resolver type definitions  -  by @productdevbook (10a1d)
  • Add playground path handling and include dependencies in tsdown config  -  by @productdevbook (073ca)
  • Implement schema hot reload for development mode  -  by @productdevbook (401a4)
  • Refactor module configuration to use nitro options  -  by @productdevbook (4fbf6)
  • Add client type generation and watcher for GraphQL files  -  by @productdevbook (f0ed4)
  • Enhance todos resolver with createdAt field and improve error handling in client code generation  -  by @productdevbook (6e8e8)
  • Update ESLint rules, enhance package exports, and improve client and GraphQL watchers with dynamic imports  -  by @productdevbook (095f7)
  • Add comments and posts functionality with GraphQL resolvers and schema definitions  -  by @productdevbook (ff4eb)
  • Rename package from nitro-graphql-yoga to nitro-graphql  -  by @productdevbook (8cbfb)
  • Rename dependency from nitro-graphql-yoga to nitro-graphql in pnpm-lock.yaml  -  by @productdevbook (bbc11)
  • Add Nuxt.js playground example with nitro-graphql integration  -  by @productdevbook (e5822)
  • Add GraphQL queries and mutations for user management in Nuxt.js playground  -  by @productdevbook (e43e3)
  • Enhance GraphQL client patterns for Nuxt.js support and update dependencies  -  by @productdevbook (1de7f)
  • Update package version, add perfect-debounce dependency, and improve TypeScript path aliases  -  by @productdevbook (fac87)
  • Add pnpm workspace configuration and enhance TypeScript support for GraphQL Yoga  -  by @productdevbook (10b1b)
  • Update package version, refine type definitions, and reintroduce Nitro options for GraphQL Yoga  -  by @productdevbook (65b84)
  • Update tsconfig references to include shared configuration  -  by @productdevbook (54b05)
  • Update GraphQL configuration and types, refactor package.json exports  -  by @productdevbook (e0102)
  • Update package.json for ESM support and adjust tsdown configuration  -  by @productdevbook (5fe4f)
  • Update ESLint and tsdown configurations for improved file handling and type definitions  -  by @productdevbook (50806)
  • Client type generate  -  by @productdevbook (4d254)
  • Enhance Nuxt integration with new module options and client type generation  -  by @productdevbook (2babe)
  • Add GraphQL endpoint definition and ensure type generation for server and client  -  by @productdevbook (2d9c0)
  • Add new scalar types for client type generation in GraphQL  -  by @productdevbook (46ef5)
  • Update GraphQL client import paths and add ofetch utility for GraphQL requests  -  by @productdevbook (e61eb)
  • Add fetch functionality for todos and posts, and enhance user creation and todo/post addition forms  -  by @productdevbook (ac290)
  • Update version to 0.0.5 and add graphql as a dependency  -  by @productdevbook (f79b4)
  • Update type imports and enhance Nuxt module setup for better type handling  -  by @productdevbook (deb53)
  • Implement GraphQL health check endpoint and enhance runtime configuration options  -  by @productdevbook (5a5bf)
  • Update import paths for GraphQL types and enhance resolver context handling  -  by @productdevbook (af53b)
  • Refactor type imports and enhance GraphQL schema definitions  -  by @productdevbook (a8bd5)
  • Add schema and define schemas for GraphQL integration  -  by @productdevbook (f4a9f)
  • Remove deprecated GraphQL code generation files and refactor imports for client and server type generation  -  by @productdevbook (df27c)
  • Add new dependencies and refactor resolver exports for improved modularity  -  by @productdevbook (cda32)
  • Refactor resolvers to use defineQuery, defineMutation, and defineSubscription for improved structure and type safety  -  by @productdevbook (5ccdb)
  • Streamline GraphQL configuration by removing unused client options and enhancing framework integration  -  by @productdevbook (d8552)
  • Replace graphql-yoga with @graphql-tools/schema for improved schema creation and type safety  -  by @productdevbook (c1a9c)
  • Update GraphQL handlers to use 'graphql-yoga' and add new GraphQL route implementation  -  by @productdevbook (25dc4)
  • Refactor Apollo Server initialization and handler export for improved clarity and performance  -  by @productdevbook (eea82)
  • Remove GraphQL Yoga configuration and refactor utility functions for improved clarity and structure  -  by @productdevbook (a9834)
  • Add GraphQL server imports and define schema interfaces for improved type safety and structure  -  by @productdevbook (09f09)
  • Remove GraphQL Yoga configuration and refactor utility functions for improved clarity and structure  -  by @productdevbook (d7e14)
  • Remove createMergedSchema function and update tsdown configuration for cleaner structure  -  by @productdevbook (4ce82)
  • Add Apollo Server integration and update GraphQL Yoga configuration for improved functionality  -  by @productdevbook (b63e5)
  • Add schema path mapping for GraphQL types in TypeScript configuration  -  by @productdevbook (80e05)
  • Add graphql-config dependency  -  by @productdevbook (be4bd)
  • Add GitHub Actions workflow for automated release process  -  by @productdevbook (aca5f)
  • Add CI workflow configuration for automat...
Read more