11import { AccumulatorMap } from '../jsutils/AccumulatorMap.js' ;
2- import { invariant } from '../jsutils/invariant.js' ;
32import type { ObjMap } from '../jsutils/ObjMap.js' ;
43
54import type {
@@ -10,7 +9,6 @@ import type {
109 OperationDefinitionNode ,
1110 SelectionSetNode ,
1211} from '../language/ast.js' ;
13- import { OperationTypeNode } from '../language/ast.js' ;
1412import { Kind } from '../language/kinds.js' ;
1513
1614import type { GraphQLObjectType } from '../type/definition.js' ;
@@ -52,7 +50,6 @@ interface CollectFieldsContext {
5250 schema : GraphQLSchema ;
5351 fragments : ObjMap < FragmentDetails > ;
5452 variableValues : VariableValues ;
55- operation : OperationDefinitionNode ;
5653 runtimeType : GraphQLObjectType ;
5754 visitedFragmentNames : Set < string > ;
5855 hideSuggestions : boolean ;
@@ -86,7 +83,6 @@ export function collectFields(
8683 fragments,
8784 variableValues,
8885 runtimeType,
89- operation,
9086 visitedFragmentNames : new Set ( ) ,
9187 hideSuggestions,
9288 } ;
@@ -115,7 +111,6 @@ export function collectSubfields(
115111 schema : GraphQLSchema ,
116112 fragments : ObjMap < FragmentDetails > ,
117113 variableValues : VariableValues ,
118- operation : OperationDefinitionNode ,
119114 returnType : GraphQLObjectType ,
120115 fieldDetailsList : FieldDetailsList ,
121116 hideSuggestions : boolean ,
@@ -128,7 +123,6 @@ export function collectSubfields(
128123 fragments,
129124 variableValues,
130125 runtimeType : returnType ,
131- operation,
132126 visitedFragmentNames : new Set ( ) ,
133127 hideSuggestions,
134128 } ;
@@ -170,7 +164,6 @@ function collectFieldsImpl(
170164 fragments,
171165 variableValues,
172166 runtimeType,
173- operation,
174167 visitedFragmentNames,
175168 hideSuggestions,
176169 } = context ;
@@ -203,7 +196,6 @@ function collectFieldsImpl(
203196 }
204197
205198 const newDeferUsage = getDeferUsage (
206- operation ,
207199 variableValues ,
208200 fragmentVariableValues ,
209201 selection ,
@@ -237,7 +229,6 @@ function collectFieldsImpl(
237229 const fragName = selection . name . value ;
238230
239231 const newDeferUsage = getDeferUsage (
240- operation ,
241232 variableValues ,
242233 fragmentVariableValues ,
243234 selection ,
@@ -309,7 +300,6 @@ function collectFieldsImpl(
309300 * not disabled by the "if" argument.
310301 */
311302function getDeferUsage (
312- operation : OperationDefinitionNode ,
313303 variableValues : VariableValues ,
314304 fragmentVariableValues : VariableValues | undefined ,
315305 node : FragmentSpreadNode | InlineFragmentNode ,
@@ -330,11 +320,6 @@ function getDeferUsage(
330320 return ;
331321 }
332322
333- invariant (
334- operation . operation !== OperationTypeNode . SUBSCRIPTION ,
335- '`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.' ,
336- ) ;
337-
338323 return {
339324 label : typeof defer . label === 'string' ? defer . label : undefined ,
340325 parentDeferUsage,
0 commit comments