Run an Apollo Server for Fastify.
npm install --save fastify-apollo graphql
fastify.register(require("fastify-apollo"), {
graphql: { schema },
graphiql: true
});
Path | Renders |
---|---|
/{prefix} |
GraphQL endpoint |
/{prefix}/graphiql |
GraphiQL |
/{prefix}/schema |
GraphQL schema |
Defaults to "/".
options.prefix = "/api"
Extends GraphQLServerOptions from Apollo.
options.graphql = { schema }
Uses resolveGraphiQLString
under the hood. Extends GraphiQLData.
If no options are supplied for GraphiQL or it is truthy its endpointURL
will default to the prefix.
options.graphiql = true
Prints graphql schema...obviously requires graphql.
options.printSchema = true