Skip to content

Commit

Permalink
docs(hooks): pass values to the next function
Browse files Browse the repository at this point in the history
  • Loading branch information
Andras Toth committed Nov 16, 2015
1 parent a822459 commit c12fa8e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ mutation deleteX {
You can specify pre- and post-resolve hooks on fields in order to manipulate arguments and data passed in to the database resolve function, and returned by the GraphQL resolve function.

You can add hooks to type fields and query fields (singular & plural queries, mutations) too.
By passing arguments to the `next` function, you can modify the parameters of the next hook or the return value of the `resolve` function.

Examples:
- Query, mutation hooks (`viewer`, `singular`, `plural`, `mutation`)
Expand Down

1 comment on commit c12fa8e

@tothandras
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as you receive:

// for example
// but you can change the arguments before passing them to `next`
singular: {
   pre: (next, root, args, context) => next(root, args, context) 
},

Please sign in to comment.