graphql-http / use/fastify
Ƭ HandlerOptions<Context
>: HandlerOptions
<FastifyRequest
, RequestContext
, Context
>
Handler options when using the fastify adapter.
Name | Type |
---|---|
Context |
extends OperationContext = undefined |
▸ createHandler<Context
>(options
): RouteHandler
Create a GraphQL over HTTP spec compliant request handler for the fastify framework.
import Fastify from 'fastify'; // yarn add fastify
import { createHandler } from 'graphql-http/lib/use/express';
import { schema } from './my-graphql-schema';
const fastify = Fastify();
fastify.all('/graphql', createHandler({ schema }));
fastify.listen({ port: 4000 });
console.log('Listening to port 4000');
Name | Type |
---|---|
Context |
extends OperationContext = undefined |
Name | Type |
---|---|
options |
HandlerOptions <Context > |
RouteHandler