Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Fastify) Apollo server Fastify integration #626 #1971

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -43,6 +43,7 @@ client reference ID, Apollo Server will now default to the values present in the
of the request (`apollographql-client-name`, `apollographql-client-reference-id` and
`apollographql-client-version` respectively). As a last resort, when those headers are not set,
the query extensions' `clientInfo` values will be used. [PR #1960](https://github.com/apollographql/apollo-server/pull/1960)
- Added `apollo-server-fastify` integration ([@rkorrelboom](https://github.com/rkorrelboom) in [#1971](https://github.com/apollostack/apollo-server/pull/1971))

### v2.2.2

Expand Down
20 changes: 20 additions & 0 deletions README.md
Expand Up @@ -86,6 +86,7 @@ Often times, Apollo Server needs to be run with a particular integration. To sta
- `apollo-server-express`
- `apollo-server-koa`
- `apollo-server-hapi`
- `apollo-server-fastify`
- `apollo-server-lambda`
- `apollo-server-azure-functions`
- `apollo-server-cloud-functions`
Expand Down Expand Up @@ -235,6 +236,25 @@ new ApolloServer({
})
```

## Fastify

```js
const { ApolloServer, gql } = require('apollo-server-fastify');
const { typeDefs, resolvers } = require('./module');

const server = new ApolloServer({
typeDefs,
resolvers,
});

const app = require('fastify')();

(async function () {
app.register(server.createHandler());
await app.listen(3000);
})();
```

### AWS Lambda

Apollo Server can be run on Lambda and deployed with AWS Serverless Application Model (SAM). It requires an API Gateway with Lambda Proxy Integration.
Expand Down