0.0.1 • Published 6 years ago

fastify-gql-plugin v0.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

fastify-gql

A GraphQL plugins based on Hapi-graphql-2 and Express-graphql

Installation

Using npm:

npm i --save fastify-gql

Using yarn:

yarn add fastify-gql

Usage

Please checkout __mock__ folder to have more info on schema

const fastifyGQLPlugin = require("fastify-gql");
const Fastify = require("fastify");

/**....**/

const fastify = Fastify();
    fastify.register(fastifyGQLPlugin, {
        query: {
            schema: SCHEMA, // executableSchema made from typeDefs and resolvers
            graphiql: true, // options to have Graphiql 
        },
        route: {
            path: "/graphql", // defined route
        },
    });

fastify.listen()

/**....**/