GraysQL Hapi Plugin
Use GraysQL with HapiJS.
Why this Plugin ?
You can write reusable plugins that exposes GraphQL queries, and join the full schema before creating a GraphQLHTTP Server.
Install
npm install --save hapi-graysql
Hapi GraphQL Server Example
For the full Hapi GraphQL Server Example Check the examples
folder:
;;;; ; { try const SCHEMAPATH = Path const server = ; server; //Main Plugins await server; // load-from-dir extension exposes load method // Load the main schema await serverGQL; // Now every plugin loads its own schema. /* await server.register({ register: MYPLUGIN-THATUSES-HAPI-GRAYSQL, options: { option1: 'example opt' } }); */ // Build up the GraphQL Full Schema const schema = serverGQL; // Register HapiGraphQL Plugin // Enabling graphiql let us test the Server. await server; await serverstart; console; catche console; }
Options
The options
key accepts the following:
extensions
: An optional array of strings containing a validGraysQL
extension name see more here.options
: Any number of custom keys. This keys will be passed to GraysQL Constructor see more here.