Skip to content

Commit 88fa83c

Browse files
yaacovCRIvanGoncharov
authored andcommitted
remove some optionality to parameters
1 parent c994728 commit 88fa83c

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/execution/execute.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ function executeFields(
640640
sourceValue: unknown,
641641
path: Path | undefined,
642642
fields: GroupedFieldSet,
643-
asyncPayloadRecord?: AsyncPayloadRecord,
643+
asyncPayloadRecord?: AsyncPayloadRecord | undefined,
644644
): PromiseOrValue<ObjMap<unknown>> {
645645
const results = Object.create(null);
646646
let containsPromise = false;
@@ -697,7 +697,7 @@ function executeField(
697697
source: unknown,
698698
fieldGroup: FieldGroup,
699699
path: Path,
700-
asyncPayloadRecord?: AsyncPayloadRecord,
700+
asyncPayloadRecord?: AsyncPayloadRecord | undefined,
701701
): PromiseOrValue<unknown> {
702702
const fieldName = fieldGroup[0].name.value;
703703
const fieldDef = exeContext.schema.getField(parentType, fieldName);
@@ -820,7 +820,7 @@ function handleFieldError(
820820
returnType: GraphQLOutputType,
821821
fieldGroup: FieldGroup,
822822
path: Path,
823-
asyncPayloadRecord?: AsyncPayloadRecord | undefined,
823+
asyncPayloadRecord: AsyncPayloadRecord | undefined,
824824
): void {
825825
const error = locatedError(rawError, fieldGroup, pathToArray(path));
826826

@@ -865,7 +865,7 @@ function completeValue(
865865
info: GraphQLResolveInfo,
866866
path: Path,
867867
result: unknown,
868-
asyncPayloadRecord?: AsyncPayloadRecord,
868+
asyncPayloadRecord: AsyncPayloadRecord | undefined,
869869
): PromiseOrValue<unknown> {
870870
// If result is an Error, throw a located error.
871871
if (result instanceof Error) {
@@ -957,7 +957,7 @@ async function completePromisedValue(
957957
info: GraphQLResolveInfo,
958958
path: Path,
959959
result: Promise<unknown>,
960-
asyncPayloadRecord?: AsyncPayloadRecord,
960+
asyncPayloadRecord: AsyncPayloadRecord | undefined,
961961
): Promise<unknown> {
962962
try {
963963
const resolved = await result;
@@ -1056,7 +1056,7 @@ async function completeAsyncIteratorValue(
10561056
info: GraphQLResolveInfo,
10571057
path: Path,
10581058
iterator: AsyncIterator<unknown>,
1059-
asyncPayloadRecord?: AsyncPayloadRecord,
1059+
asyncPayloadRecord: AsyncPayloadRecord | undefined,
10601060
): Promise<ReadonlyArray<unknown>> {
10611061
const stream = getStreamValues(exeContext, fieldGroup, path);
10621062
let containsPromise = false;
@@ -1135,7 +1135,7 @@ function completeListValue(
11351135
info: GraphQLResolveInfo,
11361136
path: Path,
11371137
result: unknown,
1138-
asyncPayloadRecord?: AsyncPayloadRecord,
1138+
asyncPayloadRecord: AsyncPayloadRecord | undefined,
11391139
): PromiseOrValue<ReadonlyArray<unknown>> {
11401140
const itemType = returnType.ofType;
11411141

@@ -1226,7 +1226,7 @@ function completeListItemValue(
12261226
fieldGroup: FieldGroup,
12271227
info: GraphQLResolveInfo,
12281228
itemPath: Path,
1229-
asyncPayloadRecord?: AsyncPayloadRecord,
1229+
asyncPayloadRecord: AsyncPayloadRecord | undefined,
12301230
): boolean {
12311231
if (isPromise(item)) {
12321232
completedResults.push(
@@ -1322,7 +1322,7 @@ function completeAbstractValue(
13221322
info: GraphQLResolveInfo,
13231323
path: Path,
13241324
result: unknown,
1325-
asyncPayloadRecord?: AsyncPayloadRecord,
1325+
asyncPayloadRecord: AsyncPayloadRecord | undefined,
13261326
): PromiseOrValue<ObjMap<unknown>> {
13271327
const resolveTypeFn = returnType.resolveType ?? exeContext.typeResolver;
13281328
const contextValue = exeContext.contextValue;
@@ -1432,7 +1432,7 @@ function completeObjectValue(
14321432
info: GraphQLResolveInfo,
14331433
path: Path,
14341434
result: unknown,
1435-
asyncPayloadRecord?: AsyncPayloadRecord,
1435+
asyncPayloadRecord: AsyncPayloadRecord | undefined,
14361436
): PromiseOrValue<ObjMap<unknown>> {
14371437
// If there is an isTypeOf predicate function, call it with the
14381438
// current result. If isTypeOf returns false, then raise an error rather
@@ -1488,7 +1488,7 @@ function collectAndExecuteSubfields(
14881488
fieldGroup: FieldGroup,
14891489
path: Path,
14901490
result: unknown,
1491-
asyncPayloadRecord?: AsyncPayloadRecord,
1491+
asyncPayloadRecord: AsyncPayloadRecord | undefined,
14921492
): PromiseOrValue<ObjMap<unknown>> {
14931493
// Collect sub-fields to execute to complete this value.
14941494
const { groupedFieldSet: subGroupedFieldSet, patches: subPatches } =

0 commit comments

Comments
 (0)