Skip to content

Commit

Permalink
Merge pull request apollographql#123 from apollographql/add-default-f…
Browse files Browse the repository at this point in the history
…ield-resolver

Update apollo-server docs
  • Loading branch information
Sashko Stubailo authored Sep 22, 2017
2 parents 5e10512 + e90bfab commit 9843891
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions docs/source/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,30 @@ Apollo Server accepts a `GraphQLOptions` object as its single argument. The `Gra
const GraphQLOptions = {
schema: GraphQLSchema,

// values to be used as context and rootValue in resolvers
context?: any,
// rootValue passed to GraphQL execution
rootValue?: any,

// function used to format errors before returning them to clients
// the context passed to GraphQL execution
context?: any,

// Formatting function applied to all errors before response is sent
formatError?: Function,

// additional validation rules to be applied to client-specified queries
// a function called for logging events such as execution times
logFunction?: Function,
// a function applied to the parameters of every invocation of runQuery
formatParams?: Function,

// * - (optional) validationRules: extra validation rules applied to requests
validationRules?: Array<ValidationRule>,

// function applied for each query in a batch to format parameters before passing them to `runQuery`
formatParams?: Function,
// a function applied to each graphQL execution result
formatResponse?: Function

// function applied to each response before returning data to clients
formatResponse?: Function,
// a custom default field resolver
fieldResolver?: Function

// a boolean option that will trigger additional debug logging if execution errors occur
// a boolean that will print additional debug logging if execution errors occur
debug?: boolean
}
```
Expand Down

0 comments on commit 9843891

Please sign in to comment.