@@ -25,6 +25,8 @@ import { KnownTypeNamesRule } from './rules/KnownTypeNamesRule.js';
25
25
import { LoneAnonymousOperationRule } from './rules/LoneAnonymousOperationRule.js' ;
26
26
// SDL-specific validation rules
27
27
import { LoneSchemaDefinitionRule } from './rules/LoneSchemaDefinitionRule.js' ;
28
+ // TODO: Spec Section
29
+ import { MaxIntrospectionDepthRule } from './rules/MaxIntrospectionDepthRule.js' ;
28
30
// Spec Section: "Fragments must not form cycles"
29
31
import { NoFragmentCyclesRule } from './rules/NoFragmentCyclesRule.js' ;
30
32
// Spec Section: "All Variable Used Defined"
@@ -75,8 +77,11 @@ import { VariablesAreInputTypesRule } from './rules/VariablesAreInputTypesRule.j
75
77
import { VariablesInAllowedPositionRule } from './rules/VariablesInAllowedPositionRule.js' ;
76
78
import type { SDLValidationRule , ValidationRule } from './ValidationContext.js' ;
77
79
78
- // TODO: Spec Section
79
- import { MaxIntrospectionDepthRule } from './rules/MaxIntrospectionDepthRule.js' ;
80
+ /**
81
+ * Technically these aren't part of the spec but they are strongly encouraged
82
+ * validation rules.
83
+ */
84
+ export const recommendedRules = Object . freeze ( [ MaxIntrospectionDepthRule ] ) ;
80
85
81
86
/**
82
87
* This set includes all validation rules defined by the GraphQL spec.
@@ -115,8 +120,7 @@ export const specifiedRules: ReadonlyArray<ValidationRule> = Object.freeze([
115
120
VariablesInAllowedPositionRule ,
116
121
OverlappingFieldsCanBeMergedRule ,
117
122
UniqueInputFieldNamesRule ,
118
- // Technically this isn't part of the spec but it's a strongly encouraged validation rule.
119
- MaxIntrospectionDepthRule ,
123
+ ...recommendedRules ,
120
124
] ) ;
121
125
122
126
/**
0 commit comments