Skip to content

Latest commit

 

History

History
68 lines (41 loc) · 1.5 KB

use_fastify.md

File metadata and controls

68 lines (41 loc) · 1.5 KB

graphql-http / use/fastify

Module: use/fastify

Table of contents

Interfaces

Type Aliases

Functions

Server/fastify

HandlerOptions

Ƭ HandlerOptions<Context>: HandlerOptions<FastifyRequest, RequestContext, Context>

Handler options when using the fastify adapter.

Type parameters

Name Type
Context extends OperationContext = undefined

createHandler

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');

Type parameters

Name Type
Context extends OperationContext = undefined

Parameters

Name Type
options HandlerOptions<Context>

Returns

RouteHandler