GraphQL integration for Nitro, the universal JavaScript server framework built on h3. Version 1.8.0 is current; releases are stable but infrequent. It bridges Apollo Server 5 with Nitro via @as-integrations/h3, enabling declarative GraphQL endpoints with zero-config setup. Differentiates from manual Apollo integration by handling middleware, context, and error handling out of the box. Requires nitropack 2.x and h3 1.x. Ships TypeScript types.
npm install nitro-graphqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configures GraphQL schema and resolvers in a Nitro app using the plugin, with context injection.
Add 'nitro-graphql/plugin' to plugins array in nitro.config.ts and import/register nitroGraphqlPlugin in a Nitro plugin file.
Ensure context function returns an object synchronously or via Promise.
Specify 'schema' (string path or GraphQL schema) and 'resolvers' (path to directory or resolver map) in your graphql config.
Add 'moduleResolution': 'node' in tsconfig.json and install @types/node as devDependency.
Import with extension: import { createGraphqlEvent } from 'nitro-graphql/event.js'Verify import: import { nitroGraphqlPlugin } from 'nitro-graphql'. Ensure package is installed and not corrupted. Check for conflicting exports.Add 'schema' and 'resolvers' options to defineGraphqlConfig. Example: graphql: { schema: './schema.graphql', resolvers: './resolvers' }