@@ -103,7 +103,7 @@ const collectSubfields = memoize3(
103
103
fragments,
104
104
operation,
105
105
variableValues,
106
- shouldProvideSuggestions ,
106
+ maskSuggestions ,
107
107
} = validatedExecutionArgs ;
108
108
return _collectSubfields (
109
109
schema ,
@@ -112,7 +112,7 @@ const collectSubfields = memoize3(
112
112
operation ,
113
113
returnType ,
114
114
fieldDetailsList ,
115
- shouldProvideSuggestions ,
115
+ maskSuggestions ,
116
116
) ;
117
117
} ,
118
118
) ;
@@ -161,7 +161,7 @@ export interface ValidatedExecutionArgs {
161
161
validatedExecutionArgs : ValidatedExecutionArgs ,
162
162
) => PromiseOrValue < ExecutionResult > ;
163
163
enableEarlyExecution : boolean ;
164
- shouldProvideSuggestions : boolean ;
164
+ maskSuggestions : boolean ;
165
165
}
166
166
167
167
export interface ExecutionContext {
@@ -191,7 +191,7 @@ export interface ExecutionArgs {
191
191
) => PromiseOrValue < ExecutionResult >
192
192
> ;
193
193
enableEarlyExecution ?: Maybe < boolean > ;
194
- shouldProvideSuggestions ?: Maybe < boolean > ;
194
+ maskSuggestions ?: Maybe < boolean > ;
195
195
}
196
196
197
197
export interface StreamUsage {
@@ -322,7 +322,7 @@ export function experimentalExecuteQueryOrMutationOrSubscriptionEvent(
322
322
rootValue,
323
323
operation,
324
324
variableValues,
325
- shouldProvideSuggestions ,
325
+ maskSuggestions ,
326
326
} = validatedExecutionArgs ;
327
327
const rootType = schema . getRootType ( operation . operation ) ;
328
328
if ( rootType == null ) {
@@ -338,7 +338,7 @@ export function experimentalExecuteQueryOrMutationOrSubscriptionEvent(
338
338
variableValues ,
339
339
rootType ,
340
340
operation ,
341
- shouldProvideSuggestions ,
341
+ maskSuggestions ,
342
342
) ;
343
343
344
344
const { groupedFieldSet, newDeferUsages } = collectedFields ;
@@ -516,7 +516,6 @@ export function validateExecutionArgs(
516
516
subscribeFieldResolver,
517
517
perEventExecutor,
518
518
enableEarlyExecution,
519
- shouldProvideSuggestions,
520
519
} = args ;
521
520
522
521
// If the schema used for execution is invalid, throw an error.
@@ -570,14 +569,15 @@ export function validateExecutionArgs(
570
569
// FIXME: https://github.com/graphql/graphql-js/issues/2203
571
570
/* c8 ignore next */
572
571
const variableDefinitions = operation . variableDefinitions ?? [ ] ;
572
+ const maskSuggestions = args . maskSuggestions ?? false ;
573
573
574
574
const variableValuesOrErrors = getVariableValues (
575
575
schema ,
576
576
variableDefinitions ,
577
577
rawVariableValues ?? { } ,
578
578
{
579
579
maxErrors : 50 ,
580
- shouldProvideSuggestions : shouldProvideSuggestions ?? true ,
580
+ maskSuggestions
581
581
} ,
582
582
) ;
583
583
@@ -598,7 +598,7 @@ export function validateExecutionArgs(
598
598
subscribeFieldResolver : subscribeFieldResolver ?? defaultFieldResolver ,
599
599
perEventExecutor : perEventExecutor ?? executeSubscriptionEvent ,
600
600
enableEarlyExecution : enableEarlyExecution === true ,
601
- shouldProvideSuggestions : shouldProvideSuggestions ?? true ,
601
+ maskSuggestions ,
602
602
} ;
603
603
}
604
604
@@ -782,7 +782,7 @@ function executeField(
782
782
deferMap : ReadonlyMap < DeferUsage , DeferredFragmentRecord > | undefined ,
783
783
) : PromiseOrValue < GraphQLWrappedResult < unknown > > | undefined {
784
784
const validatedExecutionArgs = exeContext . validatedExecutionArgs ;
785
- const { schema, contextValue, variableValues, shouldProvideSuggestions } = validatedExecutionArgs ;
785
+ const { schema, contextValue, variableValues, maskSuggestions } = validatedExecutionArgs ;
786
786
const fieldName = fieldDetailsList [ 0 ] . node . name . value ;
787
787
const fieldDef = schema . getField ( parentType , fieldName ) ;
788
788
if ( ! fieldDef ) {
@@ -809,8 +809,8 @@ function executeField(
809
809
fieldDetailsList [ 0 ] . node ,
810
810
fieldDef . args ,
811
811
variableValues ,
812
- shouldProvideSuggestions ,
813
812
fieldDetailsList [ 0 ] . fragmentVariableValues ,
813
+ maskSuggestions ,
814
814
) ;
815
815
816
816
// The resolve function's optional third argument is a context value that
@@ -1114,16 +1114,16 @@ function getStreamUsage(
1114
1114
. _streamUsage ;
1115
1115
}
1116
1116
1117
- const { operation, variableValues, shouldProvideSuggestions } =
1117
+ const { operation, variableValues, maskSuggestions } =
1118
1118
validatedExecutionArgs ;
1119
1119
// validation only allows equivalent streams on multiple fields, so it is
1120
1120
// safe to only check the first fieldNode for the stream directive
1121
1121
const stream = getDirectiveValues (
1122
1122
GraphQLStreamDirective ,
1123
1123
fieldDetailsList [ 0 ] . node ,
1124
- shouldProvideSuggestions ,
1125
1124
variableValues ,
1126
1125
fieldDetailsList [ 0 ] . fragmentVariableValues ,
1126
+ maskSuggestions ,
1127
1127
) ;
1128
1128
1129
1129
if ( ! stream ) {
@@ -2088,7 +2088,7 @@ function executeSubscription(
2088
2088
contextValue,
2089
2089
operation,
2090
2090
variableValues,
2091
- shouldProvideSuggestions ,
2091
+ maskSuggestions ,
2092
2092
} = validatedExecutionArgs ;
2093
2093
2094
2094
const rootType = schema . getSubscriptionType ( ) ;
@@ -2105,7 +2105,7 @@ function executeSubscription(
2105
2105
variableValues ,
2106
2106
rootType ,
2107
2107
operation ,
2108
- shouldProvideSuggestions ,
2108
+ maskSuggestions ,
2109
2109
) ;
2110
2110
2111
2111
const firstRootField = groupedFieldSet . entries ( ) . next ( ) . value as [
@@ -2142,8 +2142,8 @@ function executeSubscription(
2142
2142
const args = getArgumentValues (
2143
2143
fieldDef ,
2144
2144
fieldNodes [ 0 ] ,
2145
- validatedExecutionArgs . shouldProvideSuggestions ,
2146
2145
variableValues ,
2146
+ validatedExecutionArgs . maskSuggestions ,
2147
2147
) ;
2148
2148
2149
2149
// Call the `subscribe()` resolver or the default resolver to produce an
0 commit comments