File tree Expand file tree Collapse file tree 1 file changed +2
-14
lines changed Expand file tree Collapse file tree 1 file changed +2
-14
lines changed Original file line number Diff line number Diff line change @@ -29,9 +29,6 @@ import {
2929 getNamedType ,
3030 GraphQLError
3131} from 'graphql' ;
32- import {
33- simpleEstimator
34- } from './estimators' ;
3532
3633declare module 'graphql/type/definition' {
3734 export interface GraphQLField < TSource , TContext , TArgs = { [ argName : string ] : any } > {
@@ -71,7 +68,7 @@ export interface QueryComplexityOptions {
7168 createError ?: ( max : number , actual : number ) => GraphQLError ,
7269
7370 // An array of complexity estimators to use for estimating the complexity
74- estimators ? : Array < ComplexityEstimator > ;
71+ estimators : Array < ComplexityEstimator > ;
7572}
7673
7774function queryComplexityMessage ( max : number , actual : number ) : string {
@@ -126,16 +123,7 @@ export default class QueryComplexity {
126123
127124 this . includeDirectiveDef = this . context . getSchema ( ) . getDirective ( 'include' ) ;
128125 this . skipDirectiveDef = this . context . getSchema ( ) . getDirective ( 'skip' ) ;
129-
130- if ( ! options . estimators ) {
131- console . warn (
132- 'DEPRECATION WARNING: Estimators should be configured in the queryComplexity options.'
133- ) ;
134- }
135-
136- this . estimators = options . estimators || [
137- simpleEstimator ( )
138- ] ;
126+ this . estimators = options . estimators
139127
140128 this . OperationDefinition = {
141129 enter : this . onOperationDefinitionEnter ,
You can’t perform that action at this time.
0 commit comments