A hapi GraphQL server plugin for version 9.1.1. Provides a simple way to integrate GraphQL with hapi, supporting schema, resolvers, GraphiQL UI, subscriptions via nes, authentication strategies, and custom error formatting. Emits pre/post resolver events. Differentiates from other hapi GraphQL plugins by offering both string and GraphQLSchema instance support, and optional resolver routes defined as hapi routes with caching and auth benefits. Stable release with moderate cadence.
npm install graphiNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Registers Graphi plugin on a hapi server with a simple schema and resolver, then starts the server.
Ensure all async resolvers return a Promise explicitly.
Register nes plugin and ensure it supports the subscription options.
Use '' or false instead of 'disabled'.
Set authStrategy and graphiAuthStrategy to 'false' if no auth is needed for public endpoints.
Define routes with method 'graphql' or tag 'graphql' and path as '/resolverName'.
npm install graphi
const Graphi = require('graphi'); (no .default)Ensure schema is either a string (SDL) or a GraphQLSchema object.