DEV Community

Discussion on: Learn how YOU can build a Serverless GraphQL API on top of a Microservice architecture, part I

Collapse
 
greg_r_ profile image
Greg

trying follow along and getting error with graphql api's app.js....

graphql({
^

ReferenceError: graphql is not defined
at Object. (/Users/me/devl/projects/devto/graphql.api/app.js:6:1)

Is there source code I can compoare to see if I'm doing something wrong?

Collapse
 
softchris profile image
Chris Noring

hi Greg. Sorry you got stuck.. Yes you need a const { graphql } = require('graphql'), at the top, also ensure you have run npm init -y followed by npm install graphql at the root directory of this file

Collapse
 
greg_r_ profile image
Greg

thanks, that worked. enjoyed the article.