Thursday, May 27, 2021

TypeError: expressGraphQL is not a function

 You might get this error in your code.


TypeError: expressGraphQL is not a function


In that case, replace the below require startement.


old: 

const expressGraphQL = require("express-graphql");

with the new code as below:
const expressGraphQL = require("express-graphql").graphqlHTTP;

Reference: link

No comments:

Post a Comment