@autotelic/apollo-server-fastify
TypeScript icon, indicating that this package has built-in type declarations

4.1.1 • Public • Published

apollo-server-fastify

This is a self contained version of apollo-server-fastify, completely detached from the Apollo Server monorepo. It has been modified to be compatible with Fastify v3.

Usage

Only compatible with Fastify v3 or higher.

npm install @autotelic/apollo-server-fastify
const { ApolloServer } = require('apollo-server-fastify');
const { typeDefs, resolvers } = require('./module');

const server = new ApolloServer({
  typeDefs,
  resolvers,
  context: ({ request, reply }) => ({
    fastifyReq: request,
    fastifyReply: reply,
  }),
});

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

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

Readme

Keywords

none

Package Sidebar

Install

npm i @autotelic/apollo-server-fastify

Weekly Downloads

1

Version

4.1.1

License

MIT

Unpacked Size

60.9 kB

Total Files

21

Last publish

Collaborators

  • autotelic