Created
November 16, 2021 07:13
-
-
Save modster/ce7653d5d714f867ef2a989d296766f9 to your computer and use it in GitHub Desktop.
Define a simple API with express-graphql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://graphql.org/graphql-js/express-graphql/#graphqlhttp | |
// import { graphqlHTTP } from 'express-graphql'; // ES6 | |
var { graphqlHTTP } = require('express-graphql'); // CommonJS | |
graphqlHTTP({ | |
schema: GraphQLSchema, | |
graphiql?: ?boolean, | |
rootValue?: ?any, | |
context?: ?any, | |
pretty?: ?boolean, | |
formatError?: ?Function, | |
validationRules?: ?Array<any>, | |
}): Middleware |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment