File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change
1
+ import type { ASTNode , GraphQLError , ValidationContext } from 'graphql' ;
2
+
3
+ export interface ComplexityLimitRuleOptions {
4
+ onCost ?: ( cost : number , context : ValidationContext ) => void ;
5
+ createError ?: ( cost : number , node : ASTNode ) => GraphQLError ;
6
+ formatErrorMessage ?: ( cost : number ) => string ;
7
+
8
+ scalarCost ?: number ;
9
+ objectCost ?: number ;
10
+ listFactor ?: number ;
11
+ introspectionListFactor ?: number ;
12
+ }
13
+
14
+ export function createComplexityLimitRule (
15
+ maxCost : number ,
16
+ options ?: ComplexityLimitRuleOptions ,
17
+ ) : ( ctx : ValidationContext ) => any ;
Original file line number Diff line number Diff line change 2
2
"name" : " graphql-validation-complexity" ,
3
3
"version" : " 0.4.2" ,
4
4
"description" : " Query complexity validation for GraphQL.js" ,
5
+ "typings" : " index.d.ts" ,
5
6
"files" : [
6
7
" lib"
7
8
],
You can’t perform that action at this time.
0 commit comments