Skip to content

Commit 58eaf9d

Browse files
committed
rename fieldPath to itemPath
1 parent fda7744 commit 58eaf9d

File tree

1 file changed

+14
-18
lines changed

1 file changed

+14
-18
lines changed

src/execution/execute.ts

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ async function completeAsyncIteratorValue(
996996
break;
997997
}
998998

999-
const fieldPath = addPath(path, index, undefined);
999+
const itemPath = addPath(path, index, undefined);
10001000
let iteration;
10011001
try {
10021002
// eslint-disable-next-line no-await-in-loop
@@ -1005,7 +1005,7 @@ async function completeAsyncIteratorValue(
10051005
break;
10061006
}
10071007
} catch (rawError) {
1008-
const error = locatedError(rawError, fieldNodes, pathToArray(fieldPath));
1008+
const error = locatedError(rawError, fieldNodes, pathToArray(itemPath));
10091009
completedResults.push(handleFieldError(error, itemType, errors));
10101010
break;
10111011
}
@@ -1019,7 +1019,7 @@ async function completeAsyncIteratorValue(
10191019
itemType,
10201020
fieldNodes,
10211021
info,
1022-
fieldPath,
1022+
itemPath,
10231023
asyncPayloadRecord,
10241024
)
10251025
) {
@@ -1952,7 +1952,7 @@ async function executeStreamIteratorItem(
19521952
info: GraphQLResolveInfo,
19531953
itemType: GraphQLOutputType,
19541954
asyncPayloadRecord: StreamRecord,
1955-
fieldPath: Path,
1955+
itemPath: Path,
19561956
): Promise<IteratorResult<unknown>> {
19571957
let item;
19581958
try {
@@ -1963,9 +1963,9 @@ async function executeStreamIteratorItem(
19631963
}
19641964
item = value;
19651965
} catch (rawError) {
1966-
const error = locatedError(rawError, fieldNodes, pathToArray(fieldPath));
1966+
const error = locatedError(rawError, fieldNodes, pathToArray(itemPath));
19671967
const value = handleFieldError(error, itemType, asyncPayloadRecord.errors);
1968-
filterSubsequentPayloads(exeContext, fieldPath, asyncPayloadRecord);
1968+
filterSubsequentPayloads(exeContext, itemPath, asyncPayloadRecord);
19691969
// don't continue if iterator throws
19701970
return { done: true, value };
19711971
}
@@ -1976,32 +1976,28 @@ async function executeStreamIteratorItem(
19761976
itemType,
19771977
fieldNodes,
19781978
info,
1979-
fieldPath,
1979+
itemPath,
19801980
item,
19811981
asyncPayloadRecord,
19821982
);
19831983

19841984
if (isPromise(completedItem)) {
19851985
completedItem = completedItem.then(undefined, (rawError) => {
1986-
const error = locatedError(
1987-
rawError,
1988-
fieldNodes,
1989-
pathToArray(fieldPath),
1990-
);
1986+
const error = locatedError(rawError, fieldNodes, pathToArray(itemPath));
19911987
const handledError = handleFieldError(
19921988
error,
19931989
itemType,
19941990
asyncPayloadRecord.errors,
19951991
);
1996-
filterSubsequentPayloads(exeContext, fieldPath, asyncPayloadRecord);
1992+
filterSubsequentPayloads(exeContext, itemPath, asyncPayloadRecord);
19971993
return handledError;
19981994
});
19991995
}
20001996
return { done: false, value: completedItem };
20011997
} catch (rawError) {
2002-
const error = locatedError(rawError, fieldNodes, pathToArray(fieldPath));
1998+
const error = locatedError(rawError, fieldNodes, pathToArray(itemPath));
20031999
const value = handleFieldError(error, itemType, asyncPayloadRecord.errors);
2004-
filterSubsequentPayloads(exeContext, fieldPath, asyncPayloadRecord);
2000+
filterSubsequentPayloads(exeContext, itemPath, asyncPayloadRecord);
20052001
return { done: false, value };
20062002
}
20072003
}
@@ -2021,10 +2017,10 @@ async function executeStreamIterator(
20212017
let previousAsyncPayloadRecord = parentContext ?? undefined;
20222018
// eslint-disable-next-line no-constant-condition
20232019
while (true) {
2024-
const fieldPath = addPath(path, index, undefined);
2020+
const itemPath = addPath(path, index, undefined);
20252021
const asyncPayloadRecord = new StreamRecord({
20262022
label,
2027-
path: fieldPath,
2023+
path: itemPath,
20282024
parentContext: previousAsyncPayloadRecord,
20292025
iterator,
20302026
exeContext,
@@ -2037,7 +2033,7 @@ async function executeStreamIterator(
20372033
info,
20382034
itemType,
20392035
asyncPayloadRecord,
2040-
fieldPath,
2036+
itemPath,
20412037
);
20422038

20432039
asyncPayloadRecord.addItems(

0 commit comments

Comments
 (0)