relay-runtime 0.0.0-main-c594f26e → 0.0.0-main-3328e8dd
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.
- package/index.js +1 -1
- package/lib/network/RelayNetwork.js +1 -1
- package/lib/store/RelayConcreteVariables.js +1 -2
- package/lib/store/RelayModernOperationDescriptor.js +1 -1
- package/lib/store/RelayPublishQueue.js +4 -2
- package/lib/util/withProvidedVariables.js +1 -3
- package/network/RelayNetwork.js.flow +4 -1
- package/package.json +1 -1
- package/relay-runtime.js +2 -2
- package/relay-runtime.min.js +2 -2
- package/store/RelayConcreteVariables.js.flow +2 -3
- package/store/RelayModernOperationDescriptor.js.flow +1 -1
- package/store/RelayPublishQueue.js.flow +8 -1
- package/util/RelayConcreteNode.js.flow +4 -2
- package/util/withProvidedVariables.js.flow +2 -3
package/index.js
CHANGED
|
@@ -27,7 +27,7 @@ function create(fetchFn, subscribe) {
|
|
|
27
27
|
var observeFetch = convertFetch(fetchFn);
|
|
28
28
|
|
|
29
29
|
function execute(request, variables, cacheConfig, uploadables, logRequestInfo) {
|
|
30
|
-
var operationVariables = withProvidedVariables(variables, request);
|
|
30
|
+
var operationVariables = withProvidedVariables(variables, request.providedVariables);
|
|
31
31
|
|
|
32
32
|
if (request.operationKind === 'subscription') {
|
|
33
33
|
!subscribe ? process.env.NODE_ENV !== "production" ? invariant(false, 'RelayNetwork: This network layer does not support Subscriptions. ' + 'To use Subscriptions, provide a custom network layer.') : invariant(false) : void 0;
|
|
@@ -76,7 +76,7 @@ function getFragmentVariables(fragment, rootVariables, argumentVariables) {
|
|
|
76
76
|
*/
|
|
77
77
|
|
|
78
78
|
|
|
79
|
-
function getOperationVariables(operation,
|
|
79
|
+
function getOperationVariables(operation, providedVariables, variables) {
|
|
80
80
|
var operationVariables = {};
|
|
81
81
|
operation.argumentDefinitions.forEach(function (def) {
|
|
82
82
|
var value = def.defaultValue;
|
|
@@ -87,7 +87,6 @@ function getOperationVariables(operation, parameters, variables) {
|
|
|
87
87
|
|
|
88
88
|
operationVariables[def.name] = value;
|
|
89
89
|
});
|
|
90
|
-
var providedVariables = parameters.providedVariables;
|
|
91
90
|
|
|
92
91
|
if (providedVariables != null) {
|
|
93
92
|
Object.keys(providedVariables).forEach(function (varName) {
|
|
@@ -34,7 +34,7 @@ var _require3 = require('./RelayStoreUtils'),
|
|
|
34
34
|
function createOperationDescriptor(request, variables, cacheConfig) {
|
|
35
35
|
var dataID = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ROOT_ID;
|
|
36
36
|
var operation = request.operation;
|
|
37
|
-
var operationVariables = getOperationVariables(operation, request.params, variables);
|
|
37
|
+
var operationVariables = getOperationVariables(operation, request.params.providedVariables, variables);
|
|
38
38
|
var requestDescriptor = createRequestDescriptor(request, operationVariables, cacheConfig);
|
|
39
39
|
var operationDescriptor = {
|
|
40
40
|
fragment: createReaderSelector(request.fragment, dataID, operationVariables, requestDescriptor),
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// flowlint ambiguous-object-type:error
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
var _global$ErrorUtils$ap, _global
|
|
13
|
+
var _global$ErrorUtils$ap, _global$ErrorUtils;
|
|
14
14
|
|
|
15
15
|
var RelayRecordSourceMutator = require('../mutations/RelayRecordSourceMutator');
|
|
16
16
|
|
|
@@ -26,7 +26,9 @@ var invariant = require('invariant');
|
|
|
26
26
|
|
|
27
27
|
var warning = require("fbjs/lib/warning");
|
|
28
28
|
|
|
29
|
-
var
|
|
29
|
+
var _global = typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : undefined;
|
|
30
|
+
|
|
31
|
+
var applyWithGuard = (_global$ErrorUtils$ap = _global === null || _global === void 0 ? void 0 : (_global$ErrorUtils = _global.ErrorUtils) === null || _global$ErrorUtils === void 0 ? void 0 : _global$ErrorUtils.applyWithGuard) !== null && _global$ErrorUtils$ap !== void 0 ? _global$ErrorUtils$ap : function (callback, context, args, onError, name) {
|
|
30
32
|
return callback.apply(context, args);
|
|
31
33
|
};
|
|
32
34
|
/**
|
|
@@ -18,9 +18,7 @@ var warning = require("fbjs/lib/warning");
|
|
|
18
18
|
var WEAKMAP_SUPPORTED = typeof WeakMap === 'function';
|
|
19
19
|
var debugCache = WEAKMAP_SUPPORTED ? new WeakMap() : new Map();
|
|
20
20
|
|
|
21
|
-
function withProvidedVariables(userSuppliedVariables,
|
|
22
|
-
var providedVariables = parameters.providedVariables;
|
|
23
|
-
|
|
21
|
+
function withProvidedVariables(userSuppliedVariables, providedVariables) {
|
|
24
22
|
if (providedVariables != null) {
|
|
25
23
|
var operationVariables = {};
|
|
26
24
|
Object.assign(operationVariables, userSuppliedVariables);
|
|
@@ -46,7 +46,10 @@ function create(
|
|
|
46
46
|
uploadables?: ?UploadableMap,
|
|
47
47
|
logRequestInfo: ?LogRequestInfoFunction,
|
|
48
48
|
): RelayObservable<GraphQLResponse> {
|
|
49
|
-
const operationVariables = withProvidedVariables(
|
|
49
|
+
const operationVariables = withProvidedVariables(
|
|
50
|
+
variables,
|
|
51
|
+
request.providedVariables,
|
|
52
|
+
);
|
|
50
53
|
if (request.operationKind === 'subscription') {
|
|
51
54
|
invariant(
|
|
52
55
|
subscribe,
|