Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
koskimas authored Jun 27, 2017
1 parent 2c94a46 commit 4a5efc6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ const graphQlSchema = graphQlBuilder()
.model(Review)
.build();

// Execute a GraphQL query.
expressApp.get('/graphql', (req, res, next) => {
graphql(graphQlSchema, req.query.graph, {
// builder is an objection.js query builder.
Expand All @@ -191,13 +190,16 @@ expressApp.get('/graphql', (req, res, next) => {
builder.mergeContext({
user: req.user
});

// Or change the eager fetching algorithm.
builder.eagerAlgorithm(Model.JoinEagerAlgorithm);
}
}).then(result => {
res.send(result);
}).catch(err => {
next(err);
});
})
});

```

0 comments on commit 4a5efc6

Please sign in to comment.