Skip to content

Commit

Permalink
Fix type error with arguments being undefined (#2078)
Browse files Browse the repository at this point in the history
* Fix type error with `arguments` being undefined

* Use the Coalesce Nullish operator

* add changeset

Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com>
  • Loading branch information
peter-formlogic and ardatan committed Oct 27, 2020
1 parent 895e2e7 commit 294dedd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/cool-ads-sin.md
@@ -0,0 +1,5 @@
---
'@graphql-tools/delegate': patch
---

fix(delegate): Fix type error with `arguments` being undefined
5 changes: 5 additions & 0 deletions .changeset/itchy-pillows-trade.md
@@ -0,0 +1,5 @@
---
'@graphql-tools/url-loader': patch
---

fix(url-loader): fix typing mismatch
Expand Up @@ -83,7 +83,7 @@ function addVariablesToRootField(

operation.selectionSet.selections.forEach((selection: SelectionNode) => {
if (selection.kind === Kind.FIELD) {
const argumentNodes = selection.arguments;
const argumentNodes = selection.arguments ?? [];
const argumentNodeMap: Record<string, ArgumentNode> = argumentNodes.reduce(
(prev, argument) => ({
...prev,
Expand Down

0 comments on commit 294dedd

Please sign in to comment.