diff --git a/.changeset/cool-ads-sin.md b/.changeset/cool-ads-sin.md new file mode 100644 index 00000000000..77bd48c0559 --- /dev/null +++ b/.changeset/cool-ads-sin.md @@ -0,0 +1,5 @@ +--- +'@graphql-tools/delegate': patch +--- + +fix(delegate): Fix type error with `arguments` being undefined diff --git a/.changeset/itchy-pillows-trade.md b/.changeset/itchy-pillows-trade.md new file mode 100644 index 00000000000..256cd928fb5 --- /dev/null +++ b/.changeset/itchy-pillows-trade.md @@ -0,0 +1,5 @@ +--- +'@graphql-tools/url-loader': patch +--- + +fix(url-loader): fix typing mismatch diff --git a/packages/delegate/src/transforms/AddArgumentsAsVariables.ts b/packages/delegate/src/transforms/AddArgumentsAsVariables.ts index d70904f443d..53a576a42a8 100644 --- a/packages/delegate/src/transforms/AddArgumentsAsVariables.ts +++ b/packages/delegate/src/transforms/AddArgumentsAsVariables.ts @@ -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 = argumentNodes.reduce( (prev, argument) => ({ ...prev,