Last active
October 17, 2017 10:48
-
-
Save jschwarty/6b9ad1ffdb5c86457bd3740d515d16b2 to your computer and use it in GitHub Desktop.
GraphQL Express server with desire to mock data for schema
This file contains hidden or 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 graphqlHTTP = require('express-graphql'); | |
const express = require('express'); | |
import { schema } from './schema/schema'; | |
// Can I use something from graphql-tools with my schema... | |
// import { <something-here> } from 'graphql-tools'; | |
// ...and then feed it to my express() server below? | |
const port = 3000; | |
express() | |
.use('/graphql', graphqlHTTP({schema: schema, pretty: true, graphiql: true})) | |
.listen(port); | |
console.log(`GraphQL server running on http://localhost:${port}/graphql`); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try this: