Skip to content

Releases: productdevbook/nitro-graphql

v1.8.0

25 Dec 18:54

Choose a tag to compare

   🚀 Features

   🏡 Chore

    View changes on GitHub

v1.7.1

24 Dec 20:26

Choose a tag to compare

   💅 Refactors

   🏡 Chore

    View changes on GitHub

v1.7.0

21 Dec 18:36

Choose a tag to compare

   🚀 Features

   🐞 Bug Fixes

   🏡 Chore

    View changes on GitHub

v2.0.0-beta.36

14 Dec 07:48

Choose a tag to compare

v2.0.0-beta.36 Pre-release
Pre-release

No significant changes

    View changes on GitHub

v2.0.0-beta.34

03 Dec 19:45

Choose a tag to compare

v2.0.0-beta.34 Pre-release
Pre-release

No significant changes

    View changes on GitHub

v2.0.0-beta.33

03 Dec 17:31

Choose a tag to compare

v2.0.0-beta.33 Pre-release
Pre-release

❄️ Nitro GraphQL v2.0.0-beta.33 ❄️

A Fresh Winter Release

    *  .  *       .   *   .    *    .   *  .     *
  .    ❄️    .       ❄️      .   ❄️   .       ❄️
    .    *    .   *     .   *    .    *   .    *
       ❄️        ❄️         ❄️        ❄️

The first public beta of the next generation Nitro GraphQL!


🎉 What's New in v2?

This is a complete rewrite bringing modern framework support and powerful new features. If you're coming from v1.x, this is a significant upgrade!

⚡ Core Framework Migration

Before (v1) After (v2)
Nitro v2 Nitro v3
H3 v1 H3 v2
Nitro Module only Vite Plugin + Nitro Module
Limited path control Full path customization

✨ Major Features

🔌 Dual Plugin Architecture

The module now works as both a Vite Plugin AND a Nitro Module:

// vite.config.ts
import graphql from 'nitro-graphql'
import { nitro } from 'nitro/vite'

export default defineConfig({
  plugins: [
    graphql(),  // Must be before nitro()
    nitro()
  ]
})

🎛️ Full File Generation Control

Complete control over every generated file:

graphql: {
  scaffold: {
    graphqlConfig: false,           // Skip graphql.config.ts
    serverSchema: 'lib/schema.ts',  // Custom path
  },
  paths: {
    serverGraphql: 'packages/api/graphql',
    clientGraphql: 'packages/web/graphql',
  }
}

🛠️ New Debug Dashboard

Visual debugging at `/_nitro/graphql/debug` (dev mode):

  • Inspect loaded schemas
  • View registered resolvers
  • Check virtual file system
  • Monitor configuration

🚀 Smart Chunk Optimization

GraphQL code now split into optimized chunks:

  • ~98% size reduction in main bundle
  • Automatic chunking for schemas, resolvers, directives
  • Rolldown-ready for Vite 7+

📦 Client Utilities with ofetch

Modern client generation using `ofetch`:

// Auto-generated SDK
import { sdk } from '#graphql/client'

const { data } = await sdk.getUser({ id: '1' })

🔧 Breaking Changes from v1

Import Path Changes

// ❌ Before (v1)
import { defineQuery } from 'nitro-graphql'
import { something } from 'h3'

// ✅ After (v2)
import { defineQuery } from 'nitro-graphql/define'
import { something } from 'nitro/h3'

Context Declaration

// server/graphql/context.d.ts
declare module 'nitro/h3' {
  interface H3EventContext {
    // Your custom context
  }
}

API Renames

  • `defineType()` → `defineField()`

🐛 Bug Fixes

  • Type System Improvements

    • Handle `__typename` property correctly
    • Better literal type inference
    • Enhanced `ResolverReturnType` helper
  • Framework Fixes

    • Custom status codes in GraphQL Yoga responses
    • Apollo Server multiple `start()` calls resolved
    • Custom type paths respected in TS config

📚 New Examples & Documentation

📖 Documentation Site

Live at nitro-graphql.pages.dev

🎮 New Examples

  • Drizzle ORM - Full database integration with Docker
  • Better Auth - Authentication middleware pattern
  • Vite + React - Modern React SPA setup
  • Vite + Vue - Vue 3 integration

📦 Installation

# npm
npm install nitro-graphql@beta graphql graphql-yoga

# pnpm
pnpm add nitro-graphql@beta graphql graphql-yoga

# yarn
yarn add nitro-graphql@beta graphql graphql-yoga

🏗️ Architecture Improvements

❄️ Modularized Setup (15 orchestrated steps)
❄️ AST-based resolver scanning with oxc-parser
❄️ Virtual modules for runtime imports
❄️ Multi-layer Nuxt support
❄️ Apollo Federation subgraph support
❄️ External GraphQL service types

🙏 Contributors

@productdevbook & Claude AI 🤖


    ❄️  ❄️  ❄️  ❄️  ❄️  ❄️  ❄️  ❄️  ❄️
    
         Happy coding this winter!
         
    ❄️  ❄️  ❄️  ❄️  ❄️  ❄️  ❄️  ❄️  ❄️

📖 Docs · 🐛 Issues · 💬 Discussions


📋 Full Changelog

🚀 Features

  • Add full file generation control and custom path system - #43
  • Migrate to Nitro v3 and H3 v2 with Vite support - #40
  • Add Nitro v3 Vite plugin integration with nitro: hook - #50
  • Add comprehensive GraphQL debug dashboard - #42
  • Add Apollo Federation subgraph support - #34
  • Modularize codebase and improve code generation - #56
  • Update client utils generation to support all frameworks
  • Update client generation to use 'ofetch'
  • Improve chunk naming logic for better optimization
  • Add `defineField()` function for type resolvers

🐞 Bug Fixes

  • Respect custom type paths in TypeScript configuration - #48
  • Handle custom status codes in GraphQL Yoga response
  • Resolve Apollo Server multiple start() calls issue - #39
  • Integrate Apollo Federation support in type generation - #37
  • Enhance ResolverReturnType to handle __typename and literal types
  • Update imports from 'h3' to 'nitro/h3'

📖 Documentation

  • Add comprehensive VitePress documentation site - #47
  • Improve resolver error detection and documentation - #41

🧪 Examples

  • Add Drizzle ORM integration example with Docker
  • Add Better Auth session middleware example
  • Add Vite + React integration example
  • Add Vite + Vue integration example
  • Add Nitro standalone example

Full Changelog: v1.5.0...v2.0.0-beta.33

v1.6.1

03 Dec 19:44

Choose a tag to compare

No significant changes

    View changes on GitHub

v1.6.0

03 Dec 17:19

Choose a tag to compare

Winter Release

Snowflake

✨ What's New

🎁 defineField Function

A brand new way to define your GraphQL field resolvers!

// ✅ New way (recommended)
export const myResolver = defineField({
  User: {
    fullName: (parent) => `${parent.firstName} ${parent.lastName}`
  }
})

// ⚠️ Old way (deprecated)
export const myResolver = defineType({ ... })

💡 Note: defineType still works but will be removed in a future version


🐛 Bug Fixes

  • 🔧 Fixed custom type paths in TypeScript configuration (#48)

📊 Release Info

🏷️
Version
1.6.0
📅
Date
Dec 2025
📦
Package
npm

📜 Full Changelog

Compare: v1.5.0...v1.6.0


Footer

Happy coding!

v1.5.0

22 Oct 19:23

Choose a tag to compare

   🚀 Features

Adds a new comprehensive debug dashboard at /_nitro/graphql/debug for inspecting GraphQL setup, resolver exports, and generated virtual modules.

CleanShot 2025-10-22 at 22 19 29@2x

   🐞 Bug Fixes

    View changes on GitHub

v1.4.0

05 Sep 07:07

Choose a tag to compare

   🚀 Features

    View changes on GitHub