2016-09-10 17:28:38 -05:00
|
|
|
import { GraphQLSchema, ValidationRule } from 'graphql';
|
2016-10-03 23:13:08 +03:00
|
|
|
import { LogFunction } from './runQuery';
|
2016-07-04 22:03:59 -07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* ExpressApolloOptions
|
|
|
|
*
|
|
|
|
* - schema: an executable GraphQL schema used to fulfill requests.
|
|
|
|
* - (optional) formatError: Formatting function applied to all errors before response is sent
|
|
|
|
* - (optional) rootValue: rootValue passed to GraphQL execution
|
|
|
|
* - (optional) context: the context passed to GraphQL execution
|
|
|
|
* - (optional) logFunction: a function called for logging events such as execution times
|
|
|
|
* - (optional) formatParams: a function applied to the parameters of every invocation of runQuery
|
|
|
|
* - (optional) validationRules: extra validation rules applied to requests
|
|
|
|
* - (optional) formatResponse: a function applied to each graphQL execution result
|
2016-09-12 15:02:41 -07:00
|
|
|
* - (optional) debug: a boolean that will print additional debug logging if execution errors occur
|
2016-07-04 22:03:59 -07:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
interface ApolloOptions {
|
2016-09-10 17:28:38 -05:00
|
|
|
schema: GraphQLSchema;
|
2016-07-04 22:03:59 -07:00
|
|
|
formatError?: Function;
|
|
|
|
rootValue?: any;
|
|
|
|
context?: any;
|
2016-09-10 17:28:38 -05:00
|
|
|
logFunction?: LogFunction;
|
2016-07-04 22:03:59 -07:00
|
|
|
formatParams?: Function;
|
2016-09-10 17:28:38 -05:00
|
|
|
validationRules?: Array<ValidationRule>;
|
2016-07-04 22:03:59 -07:00
|
|
|
formatResponse?: Function;
|
2016-09-12 15:02:41 -07:00
|
|
|
debug?: boolean;
|
2016-07-04 22:03:59 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
export default ApolloOptions;
|