@@ -98,21 +98,16 @@ const collectSubfields = memoize3(
98
98
returnType : GraphQLObjectType ,
99
99
fieldDetailsList : FieldDetailsList ,
100
100
) => {
101
- const {
102
- schema,
103
- fragments,
104
- operation,
105
- variableValues,
106
- shouldProvideSuggestions,
107
- } = validatedExecutionArgs ;
101
+ const { schema, fragments, operation, variableValues, maskSuggestions } =
102
+ validatedExecutionArgs ;
108
103
return _collectSubfields (
109
104
schema ,
110
105
fragments ,
111
106
variableValues ,
112
107
operation ,
113
108
returnType ,
114
109
fieldDetailsList ,
115
- shouldProvideSuggestions ,
110
+ maskSuggestions ,
116
111
) ;
117
112
} ,
118
113
) ;
@@ -161,7 +156,7 @@ export interface ValidatedExecutionArgs {
161
156
validatedExecutionArgs : ValidatedExecutionArgs ,
162
157
) => PromiseOrValue < ExecutionResult > ;
163
158
enableEarlyExecution : boolean ;
164
- shouldProvideSuggestions : boolean ;
159
+ maskSuggestions : boolean ;
165
160
}
166
161
167
162
export interface ExecutionContext {
@@ -191,7 +186,7 @@ export interface ExecutionArgs {
191
186
) => PromiseOrValue < ExecutionResult >
192
187
> ;
193
188
enableEarlyExecution ?: Maybe < boolean > ;
194
- shouldProvideSuggestions ?: Maybe < boolean > ;
189
+ maskSuggestions ?: Maybe < boolean > ;
195
190
}
196
191
197
192
export interface StreamUsage {
@@ -322,7 +317,7 @@ export function experimentalExecuteQueryOrMutationOrSubscriptionEvent(
322
317
rootValue,
323
318
operation,
324
319
variableValues,
325
- shouldProvideSuggestions ,
320
+ maskSuggestions ,
326
321
} = validatedExecutionArgs ;
327
322
const rootType = schema . getRootType ( operation . operation ) ;
328
323
if ( rootType == null ) {
@@ -338,7 +333,7 @@ export function experimentalExecuteQueryOrMutationOrSubscriptionEvent(
338
333
variableValues ,
339
334
rootType ,
340
335
operation ,
341
- shouldProvideSuggestions ,
336
+ maskSuggestions ,
342
337
) ;
343
338
344
339
const { groupedFieldSet, newDeferUsages } = collectedFields ;
@@ -516,7 +511,6 @@ export function validateExecutionArgs(
516
511
subscribeFieldResolver,
517
512
perEventExecutor,
518
513
enableEarlyExecution,
519
- shouldProvideSuggestions,
520
514
} = args ;
521
515
522
516
// If the schema used for execution is invalid, throw an error.
@@ -570,14 +564,15 @@ export function validateExecutionArgs(
570
564
// FIXME: https://github.com/graphql/graphql-js/issues/2203
571
565
/* c8 ignore next */
572
566
const variableDefinitions = operation . variableDefinitions ?? [ ] ;
567
+ const maskSuggestions = args . maskSuggestions ?? false ;
573
568
574
569
const variableValuesOrErrors = getVariableValues (
575
570
schema ,
576
571
variableDefinitions ,
577
572
rawVariableValues ?? { } ,
578
573
{
579
574
maxErrors : 50 ,
580
- shouldProvideSuggestions : shouldProvideSuggestions ?? true ,
575
+ maskSuggestions ,
581
576
} ,
582
577
) ;
583
578
@@ -598,7 +593,7 @@ export function validateExecutionArgs(
598
593
subscribeFieldResolver : subscribeFieldResolver ?? defaultFieldResolver ,
599
594
perEventExecutor : perEventExecutor ?? executeSubscriptionEvent ,
600
595
enableEarlyExecution : enableEarlyExecution === true ,
601
- shouldProvideSuggestions : shouldProvideSuggestions ?? true ,
596
+ maskSuggestions ,
602
597
} ;
603
598
}
604
599
@@ -782,7 +777,8 @@ function executeField(
782
777
deferMap : ReadonlyMap < DeferUsage , DeferredFragmentRecord > | undefined ,
783
778
) : PromiseOrValue < GraphQLWrappedResult < unknown > > | undefined {
784
779
const validatedExecutionArgs = exeContext . validatedExecutionArgs ;
785
- const { schema, contextValue, variableValues, shouldProvideSuggestions } = validatedExecutionArgs ;
780
+ const { schema, contextValue, variableValues, maskSuggestions } =
781
+ validatedExecutionArgs ;
786
782
const fieldName = fieldDetailsList [ 0 ] . node . name . value ;
787
783
const fieldDef = schema . getField ( parentType , fieldName ) ;
788
784
if ( ! fieldDef ) {
@@ -809,8 +805,8 @@ function executeField(
809
805
fieldDetailsList [ 0 ] . node ,
810
806
fieldDef . args ,
811
807
variableValues ,
812
- shouldProvideSuggestions ,
813
808
fieldDetailsList [ 0 ] . fragmentVariableValues ,
809
+ maskSuggestions ,
814
810
) ;
815
811
816
812
// The resolve function's optional third argument is a context value that
@@ -1114,14 +1110,12 @@ function getStreamUsage(
1114
1110
. _streamUsage ;
1115
1111
}
1116
1112
1117
- const { operation, variableValues, shouldProvideSuggestions } =
1118
- validatedExecutionArgs ;
1113
+ const { operation, variableValues } = validatedExecutionArgs ;
1119
1114
// validation only allows equivalent streams on multiple fields, so it is
1120
1115
// safe to only check the first fieldNode for the stream directive
1121
1116
const stream = getDirectiveValues (
1122
1117
GraphQLStreamDirective ,
1123
1118
fieldDetailsList [ 0 ] . node ,
1124
- shouldProvideSuggestions ,
1125
1119
variableValues ,
1126
1120
fieldDetailsList [ 0 ] . fragmentVariableValues ,
1127
1121
) ;
@@ -2088,7 +2082,7 @@ function executeSubscription(
2088
2082
contextValue,
2089
2083
operation,
2090
2084
variableValues,
2091
- shouldProvideSuggestions ,
2085
+ maskSuggestions ,
2092
2086
} = validatedExecutionArgs ;
2093
2087
2094
2088
const rootType = schema . getSubscriptionType ( ) ;
@@ -2105,7 +2099,7 @@ function executeSubscription(
2105
2099
variableValues ,
2106
2100
rootType ,
2107
2101
operation ,
2108
- shouldProvideSuggestions ,
2102
+ maskSuggestions ,
2109
2103
) ;
2110
2104
2111
2105
const firstRootField = groupedFieldSet . entries ( ) . next ( ) . value as [
@@ -2142,8 +2136,8 @@ function executeSubscription(
2142
2136
const args = getArgumentValues (
2143
2137
fieldDef ,
2144
2138
fieldNodes [ 0 ] ,
2145
- validatedExecutionArgs . shouldProvideSuggestions ,
2146
2139
variableValues ,
2140
+ maskSuggestions ,
2147
2141
) ;
2148
2142
2149
2143
// Call the `subscribe()` resolver or the default resolver to produce an
0 commit comments