Serve a GraphQL Schema as Middleware in Express

Share this video with your friends

Send Tweet

If we have a GraphQL Schema expressed in terms of JavaScript, then we have a convenient package available to us that let’s us easily serve up our schema on any endpoint in an Express Server. In this video, we’ll use the express-graphql package to serve up our GraphQL Schema as middleware, and also learn how to enable the GraphiQL tool in order to query our GraphQL Schema.

online
online
~ 7 years ago

Hi there, I've get an error that I paste it below

module.js:472 throw err; Error: Cannot find module 'graphql'

Best

dvls
dvls
~ 7 years ago

make sure i have a '/', as in '/graphql'. I saw this same issue.

Brendan Whiting
Brendan Whiting
~ 6 years ago

FYI at the bottom of vim it seems to be saying that your index.js file is jsx