fastify-apollo

2.1.0 • Public • Published

fastify-apollo

Install

npm install --save fastify fastify-apollo graphql

Register plugin

fastify.register(require("fastify-apollo"), {
    graphql: { schema, rootValue },
    graphiql: {
      endpointURL: "/"
    },
    prefix: "/api",
    printSchema: true // `/api/schema`
});

GraphQL

Extends GraphQLServerOptions from Apollo.

const { graphqlFastify } = require("fastify-apollo");
 
fastify.register(graphqlFastify, {
  schema
})

GraphiQL

Uses resolveGraphiQLString under the hood. Extends GraphiQLData.

const { graphqlFastify } = require("fastify-apollo");
 
fastify.register(graphiqlFastify, {
  endpointURL: "/",
  prefix: "/graphiql"
})

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.1.0
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.1.0
    1

Package Sidebar

Install

npm i fastify-apollo

Weekly Downloads

1

Version

2.1.0

License

MIT

Last publish

Collaborators

  • coopnd