Skip to content

Instantly share code, notes, and snippets.

@arnabkd
Created May 12, 2018 20:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arnabkd/a18b088c2913860362192ac67e7e02d9 to your computer and use it in GitHub Desktop.
Save arnabkd/a18b088c2913860362192ac67e7e02d9 to your computer and use it in GitHub Desktop.
const express = require('express')
const graphqlHTTP = require('express-graphql')
import schema from './schema'
// The root provides a resolver function for each API endpoint
const root = {
hello: () => 'World'
}
const app = express()
app.use('/graphql', graphqlHTTP({
schema: schema,
rootValue: root,
graphiql: true,
}))
app.listen(4000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment