graphql-http / use/express
Ƭ HandlerOptions<Context
>: HandlerOptions
<Request
, RequestContext
, Context
>
Handler options when using the express adapter.
Name | Type |
---|---|
Context |
extends OperationContext = undefined |
▸ createHandler<Context
>(options
): Handler
Create a GraphQL over HTTP spec 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 <Context > |
Handler