https://github.com/seangenabe/fastify-apollo-2
Fastify and Apollo Server integration
https://github.com/seangenabe/fastify-apollo-2
Last synced: 7 months ago
JSON representation
Fastify and Apollo Server integration
- Host: GitHub
- URL: https://github.com/seangenabe/fastify-apollo-2
- Owner: seangenabe
- License: mit
- Created: 2017-12-19T22:26:08.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-20T04:37:20.000Z (almost 8 years ago)
- Last Synced: 2025-03-18T05:56:57.993Z (7 months ago)
- Language: JavaScript
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
# fastify-apollo-2
A new take on [Fastify](https://github.com/fastify/fastify) and [Apollo Server](https://github.com/apollographql/apollo-server) integration. Based on the official hapi plugin.
## Usage
```js
// Register GraphQL endpoint
fastify.register(require('@seangenabe/fastify-apollo-2'), {
graphqlOptions: { schema },
prefix: '/graphql'
})
// Registry GraphiQL endpoint
fastify.register(require('@seangenabe/fastify-apollo-2/graphiql', {
graphiqlOptions: { endpointURL: '/graphql' },
prefix: '/graphiql'
})
```Reference:
* [GraphQL options](https://www.apollographql.com/docs/apollo-server/setup.html)
* [GraphiQL options](https://www.apollographql.com/docs/apollo-server/graphiql.html)