Home > Software engineering >  Syntax/pre-compilation issue with graphql and express
Syntax/pre-compilation issue with graphql and express

Time:04-15

Hi I am following this video to make a booking system enter image description here

CodePudding user response:

To fix the error TypeError: graphqlHttp is not a function, replace

const graphqlHttp = require('express-graphql');

with

const { graphqlHTTP } = require('express-graphql');

(Notice the different case for HTTP, versus Http)

Of course, in the other lines, graphqlHttp must be replaced by graphqlHTTP.

https://graphql.org/graphql-js/express-graphql/

  • Related