Skip to content

Commit

Permalink
feat(app): Adding request to context
Browse files Browse the repository at this point in the history
  • Loading branch information
Tallyb committed Dec 2, 2016
1 parent dba1f3a commit 0a3163d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ module.exports = function(app, options) {
let graphiqlPath = options.graphiqlPath || '/graphiql';
let path = options.path || '/graphql';

app.use(path, bodyParser.json(), graphql.graphqlExpress({
schema: schema
app.use(path, bodyParser.json(), graphql.graphqlExpress(req => {
return {
schema,
context: req
};
}));
app.use(graphiqlPath, graphql.graphiqlExpress({
endpointURL: path
Expand Down

0 comments on commit 0a3163d

Please sign in to comment.