From e90bfabaf674a3d51eeddb820cea6bf8467fa9e9 Mon Sep 17 00:00:00 2001 From: Mikhail Novikov Date: Mon, 24 Jul 2017 14:43:11 +0300 Subject: [PATCH] Update apollo-server docs * Add fieldResolver option * Copy other missing options from apollo-server-core docstring --- docs/source/setup.md | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/docs/source/setup.md b/docs/source/setup.md index 936af28d1..ce8bddf59 100644 --- a/docs/source/setup.md +++ b/docs/source/setup.md @@ -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, - // 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 } ```