relay-runtime 0.0.0-main-e8bf0b68 → 0.0.0-main-77073a22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,6 +18,7 @@ import type {
18
18
  NormalizationOperation,
19
19
  } from '../util/NormalizationNode';
20
20
  import type {ReaderFragment} from '../util/ReaderNode';
21
+ import type {RequestParameters} from '../util/RelayConcreteNode';
21
22
  import type {Variables} from '../util/RelayRuntimeTypes';
22
23
 
23
24
  const {getArgumentValues} = require('./RelayStoreUtils');
@@ -82,6 +83,7 @@ function getFragmentVariables(
82
83
  */
83
84
  function getOperationVariables(
84
85
  operation: NormalizationOperation,
86
+ parameters: RequestParameters,
85
87
  variables: Variables,
86
88
  ): Variables {
87
89
  const operationVariables = {};
@@ -92,6 +94,13 @@ function getOperationVariables(
92
94
  }
93
95
  operationVariables[def.name] = value;
94
96
  });
97
+
98
+ const providedVariables = parameters.providedVariables;
99
+ if (providedVariables != null) {
100
+ Object.keys(providedVariables).forEach((varName: string) => {
101
+ operationVariables[varName] = providedVariables[varName].get();
102
+ });
103
+ }
95
104
  return operationVariables;
96
105
  }
97
106
 
@@ -44,7 +44,11 @@ function createOperationDescriptor<TQuery: OperationType>(
44
44
  dataID?: DataID = ROOT_ID,
45
45
  ): OperationDescriptor {
46
46
  const operation = request.operation;
47
- const operationVariables = getOperationVariables(operation, variables);
47
+ const operationVariables = getOperationVariables(
48
+ operation,
49
+ request.params,
50
+ variables,
51
+ );
48
52
  const requestDescriptor = createRequestDescriptor(
49
53
  request,
50
54
  operationVariables,