File tree 2 files changed +20
-5
lines changed
2 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -1515,6 +1515,20 @@ describe('Execute: Handles inputs', () => {
1515
1515
} ) ;
1516
1516
} ) ;
1517
1517
1518
+ it ( 'when argument passed to a directive on a nested field' , ( ) => {
1519
+ const result = executeQueryWithFragmentArguments ( `
1520
+ query {
1521
+ ...a(value: true)
1522
+ }
1523
+ fragment a($value: Boolean!) on TestType {
1524
+ nested { echo(input: "echo") @skip(if: $value) }
1525
+ }
1526
+ ` ) ;
1527
+ expect ( result ) . to . deep . equal ( {
1528
+ data : { nested : { } } ,
1529
+ } ) ;
1530
+ } ) ;
1531
+
1518
1532
it ( 'when a nullable argument to a directive with a field default is not provided and shadowed by an operation variable' , ( ) => {
1519
1533
// this test uses the @defer directive and incremental delivery because the `if` argument for skip/include have no field defaults
1520
1534
const document = parse (
Original file line number Diff line number Diff line change @@ -56,7 +56,6 @@ interface CollectFieldsContext {
56
56
schema : GraphQLSchema ;
57
57
fragments : ObjMap < FragmentDetails > ;
58
58
variableValues : { [ variable : string ] : unknown } ;
59
- fragmentVariableValues ?: FragmentVariables ;
60
59
operation : OperationDefinitionNode ;
61
60
runtimeType : GraphQLObjectType ;
62
61
visitedFragmentNames : Set < string > ;
@@ -135,14 +134,16 @@ export function collectSubfields(
135
134
const newDeferUsages : Array < DeferUsage > = [ ] ;
136
135
137
136
for ( const fieldDetail of fieldGroup ) {
138
- const node = fieldDetail . node ;
139
- if ( node . selectionSet ) {
137
+ const selectionSet = fieldDetail . node . selectionSet ;
138
+ if ( selectionSet ) {
139
+ const { deferUsage, fragmentVariables } = fieldDetail ;
140
140
collectFieldsImpl (
141
141
context ,
142
- node . selectionSet ,
142
+ selectionSet ,
143
143
subGroupedFieldSet ,
144
144
newDeferUsages ,
145
- fieldDetail . deferUsage ,
145
+ deferUsage ,
146
+ fragmentVariables ,
146
147
) ;
147
148
}
148
149
}
You can’t perform that action at this time.
0 commit comments