graphql-http / use/express
▸ createHandler<Context
>(options
): Handler
Create a GraphQL over HTTP Protocol compliant request handler for the express framework.
import express from 'express'; // yarn add express
import { createHandler } from 'graphql-http/lib/use/express';
import { schema } from './my-graphql-schema';
const app = express();
app.all('/graphql', createHandler({ schema }));
app.listen({ port: 4000 });
console.log('Listening to port 4000');
Name | Type |
---|---|
Context |
extends OperationContext = undefined |
Name | Type |
---|---|
options |
HandlerOptions <Request <ParamsDictionary , any , any , ParsedQs , Record <string , any >>, undefined , Context > |
Handler