Created
May 12, 2018 20:34
-
-
Save arnabkd/a18b088c2913860362192ac67e7e02d9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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