Skip to content

Commit 294dedd

Browse files
peter-formlogicardatan
andauthoredOct 27, 2020
Fix type error with arguments being undefined (#2078)
* Fix type error with `arguments` being undefined * Use the Coalesce Nullish operator * add changeset Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com>
1 parent 895e2e7 commit 294dedd

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed
 

Diff for: ‎.changeset/cool-ads-sin.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@graphql-tools/delegate': patch
3+
---
4+
5+
fix(delegate): Fix type error with `arguments` being undefined

Diff for: ‎.changeset/itchy-pillows-trade.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@graphql-tools/url-loader': patch
3+
---
4+
5+
fix(url-loader): fix typing mismatch

Diff for: ‎packages/delegate/src/transforms/AddArgumentsAsVariables.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function addVariablesToRootField(
8383

8484
operation.selectionSet.selections.forEach((selection: SelectionNode) => {
8585
if (selection.kind === Kind.FIELD) {
86-
const argumentNodes = selection.arguments;
86+
const argumentNodes = selection.arguments ?? [];
8787
const argumentNodeMap: Record<string, ArgumentNode> = argumentNodes.reduce(
8888
(prev, argument) => ({
8989
...prev,

0 commit comments

Comments
 (0)
Please sign in to comment.