diff --git a/packages/relay-runtime/store/RelayReader.js b/packages/relay-runtime/store/RelayReader.js index 1db296e5dac6f..be3b4e1217093 100644 --- a/packages/relay-runtime/store/RelayReader.js +++ b/packages/relay-runtime/store/RelayReader.js @@ -1116,22 +1116,18 @@ class RelayReader { const parentVariables = this._variables; - // We only want to update `this._variables` if we have compiler artifacts that support it. - // Until we've rolled out the compiler portion of this change, we need to check at runtime. - if (fragmentSpreadOrFragment.argumentDefinitions != null) { - // If the inline fragment spread has arguments, we need to temporarily - // switch this._variables to include the fragment spread's arguments - // for the duration of its traversal. - const argumentVariables = fragmentSpreadOrFragment.args - ? getArgumentValues(fragmentSpreadOrFragment.args, this._variables) - : {}; - - this._variables = RelayConcreteVariables.getFragmentVariables( - fragmentSpreadOrFragment, - this._owner.variables, - argumentVariables, - ); - } + // If the inline fragment spread has arguments, we need to temporarily + // switch this._variables to include the fragment spread's arguments + // for the duration of its traversal. + const argumentVariables = fragmentSpreadOrFragment.args + ? getArgumentValues(fragmentSpreadOrFragment.args, this._variables) + : {}; + + this._variables = RelayConcreteVariables.getFragmentVariables( + fragmentSpreadOrFragment, + this._owner.variables, + argumentVariables, + ); this._traverseSelections( fragmentSpreadOrFragment.selections, diff --git a/packages/relay-runtime/util/ReaderNode.js b/packages/relay-runtime/util/ReaderNode.js index 046054e2e3e23..2ab7392e370ec 100644 --- a/packages/relay-runtime/util/ReaderNode.js +++ b/packages/relay-runtime/util/ReaderNode.js @@ -31,10 +31,8 @@ export type ReaderInlineDataFragmentSpread = { +kind: 'InlineDataFragmentSpread', +name: string, +selections: $ReadOnlyArray, - // TODO: T123948544 Mark both of these as non-optional once the compiler - // changes have rolled out. - +args?: ?$ReadOnlyArray, - +argumentDefinitions?: $ReadOnlyArray, + +args: ?$ReadOnlyArray, + +argumentDefinitions: $ReadOnlyArray, }; export type ReaderFragment = {