This repository has been archived by the owner. It is now read-only.
Run an Apollo Server on Fastify.
Switch branches/tags
Clone or download
Nickolena Coop
Nickolena Coop Merge pull request #8 from gj/patch-1
Fix typo
Latest commit fa19ecb Feb 26, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
.editorconfig
.gitignore
.travis.yml
LICENSE
README.md
example.js
graphiql.js
graphql.js
index.js
package-lock.json
package.json
schemas.js
test.js

README.md

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 { graphiqlFastify } = require("fastify-apollo");

fastify.register(graphiqlFastify, {
  endpointURL: "/",
  prefix: "/graphiql"
})