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 {
29
29
getNamedType ,
30
30
GraphQLError
31
31
} from 'graphql' ;
32
- import {
33
- simpleEstimator
34
- } from './estimators' ;
35
32
36
33
declare module 'graphql/type/definition' {
37
34
export interface GraphQLField < TSource , TContext , TArgs = { [ argName : string ] : any } > {
@@ -71,7 +68,7 @@ export interface QueryComplexityOptions {
71
68
createError ?: ( max : number , actual : number ) => GraphQLError ,
72
69
73
70
// An array of complexity estimators to use for estimating the complexity
74
- estimators ? : Array < ComplexityEstimator > ;
71
+ estimators : Array < ComplexityEstimator > ;
75
72
}
76
73
77
74
function queryComplexityMessage ( max : number , actual : number ) : string {
@@ -126,16 +123,7 @@ export default class QueryComplexity {
126
123
127
124
this . includeDirectiveDef = this . context . getSchema ( ) . getDirective ( 'include' ) ;
128
125
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
139
127
140
128
this . OperationDefinition = {
141
129
enter : this . onOperationDefinitionEnter ,
You can’t perform that action at this time.
0 commit comments