Skip to content

Instantly share code, notes, and snippets.

@callmephilip
Created July 20, 2016 18:03
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 callmephilip/4c73fb95543ad88ea25ca6d329fd5bf9 to your computer and use it in GitHub Desktop.
Save callmephilip/4c73fb95543ad88ea25ca6d329fd5bf9 to your computer and use it in GitHub Desktop.
import graphqlHTTP from 'express-graphql';
const app = express();
app.use('/graphql', graphqlHTTP(function(request) {
return {
schema: MyGraphQLSchema,
graphiql: true,
context: sessionToken: request.headers && request.headers.authorization
};
}));
app.listen(3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment