react-relay 14.0.0 → 15.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/ReactRelayContainerUtils.js.flow +1 -2
- package/ReactRelayContext.js +1 -1
- package/ReactRelayContext.js.flow +1 -2
- package/ReactRelayFragmentContainer.js.flow +6 -4
- package/ReactRelayFragmentMockRenderer.js.flow +1 -2
- package/ReactRelayLocalQueryRenderer.js.flow +5 -5
- package/ReactRelayPaginationContainer.js.flow +21 -14
- package/ReactRelayQueryFetcher.js.flow +28 -16
- package/ReactRelayQueryRenderer.js.flow +42 -13
- package/ReactRelayQueryRendererContext.js.flow +2 -3
- package/ReactRelayRefetchContainer.js.flow +9 -9
- package/ReactRelayTestMocker.js.flow +3 -3
- package/ReactRelayTypes.js.flow +7 -8
- package/RelayContext.js.flow +1 -2
- package/__flowtests__/ReactRelayFragmentContainer-flowtest.js.flow +4 -5
- package/__flowtests__/ReactRelayPaginationContainer-flowtest.js.flow +4 -5
- package/__flowtests__/ReactRelayRefetchContainer-flowtest.js.flow +4 -5
- package/__flowtests__/RelayModern-flowtest.js.flow +3 -4
- package/__flowtests__/RelayModernFlowtest_badref.graphql.js.flow +3 -4
- package/__flowtests__/RelayModernFlowtest_notref.graphql.js.flow +3 -4
- package/__flowtests__/RelayModernFlowtest_user.graphql.js.flow +3 -4
- package/__flowtests__/RelayModernFlowtest_users.graphql.js.flow +3 -4
- package/__flowtests__/__generated__/ReactRelayFragmentContainerFlowtest_viewer.graphql.js.flow +3 -1
- package/__flowtests__/__generated__/ReactRelayFragmentContainerFlowtest_viewer2.graphql.js.flow +3 -1
- package/__flowtests__/__generated__/ReactRelayPaginationContainerFlowtestQuery.graphql.js.flow +4 -2
- package/__flowtests__/__generated__/ReactRelayPaginationContainerFlowtest_viewer.graphql.js.flow +3 -1
- package/__flowtests__/__generated__/ReactRelayRefetchContainerFlowtestQuery.graphql.js.flow +4 -2
- package/__flowtests__/__generated__/ReactRelayRefetchContainerFlowtest_viewer.graphql.js.flow +3 -1
- package/__flowtests__/__generated__/RelayModernFlowtest_badref.graphql.js.flow +4 -2
- package/__flowtests__/__generated__/RelayModernFlowtest_notref.graphql.js.flow +4 -2
- package/__flowtests__/__generated__/RelayModernFlowtest_user.graphql.js.flow +3 -1
- package/__flowtests__/__generated__/RelayModernFlowtest_users.graphql.js.flow +3 -1
- package/assertFragmentMap.js.flow +1 -2
- package/buildReactRelayContainer.js.flow +7 -7
- package/getRootVariablesForFragments.js.flow +1 -3
- package/hooks.js +1 -1
- package/hooks.js.flow +4 -2
- package/index.js +1 -1
- package/index.js.flow +6 -2
- package/isRelayEnvironment.js.flow +1 -2
- package/jest-react/enqueueTask.js.flow +1 -1
- package/jest-react/index.js.flow +1 -1
- package/jest-react/internalAct.js.flow +1 -1
- package/legacy.js +1 -1
- package/legacy.js.flow +1 -2
- package/lib/ReactRelayContainerUtils.js +2 -3
- package/lib/ReactRelayContext.js +3 -4
- package/lib/ReactRelayFragmentContainer.js +47 -73
- package/lib/ReactRelayFragmentMockRenderer.js +2 -4
- package/lib/ReactRelayLocalQueryRenderer.js +18 -31
- package/lib/ReactRelayPaginationContainer.js +74 -164
- package/lib/ReactRelayQueryFetcher.js +49 -76
- package/lib/ReactRelayQueryRenderer.js +63 -84
- package/lib/ReactRelayQueryRendererContext.js +2 -2
- package/lib/ReactRelayRefetchContainer.js +58 -108
- package/lib/ReactRelayTestMocker.js +33 -68
- package/lib/ReactRelayTypes.js +2 -1
- package/lib/RelayContext.js +4 -7
- package/lib/assertFragmentMap.js +3 -5
- package/lib/buildReactRelayContainer.js +11 -27
- package/lib/getRootVariablesForFragments.js +6 -10
- package/lib/hooks.js +5 -18
- package/lib/index.js +7 -24
- package/lib/isRelayEnvironment.js +5 -4
- package/lib/jest-react/enqueueTask.js +5 -9
- package/lib/jest-react/index.js +0 -1
- package/lib/jest-react/internalAct.js +9 -20
- package/lib/legacy.js +2 -8
- package/lib/multi-actor/ActorChange.js +2 -5
- package/lib/multi-actor/index.js +2 -1
- package/lib/multi-actor/useRelayActorEnvironment.js +4 -8
- package/lib/relay-hooks/EntryPointContainer.react.js +9 -15
- package/lib/relay-hooks/EntryPointTypes.flow.js +5 -3
- package/lib/relay-hooks/FragmentResource.js +109 -203
- package/lib/relay-hooks/HooksImplementation.js +3 -6
- package/lib/relay-hooks/InternalLogger.js +2 -3
- package/lib/relay-hooks/LRUCache.js +2 -20
- package/lib/relay-hooks/LazyLoadEntryPointContainer_DEPRECATED.react.js +33 -54
- package/lib/relay-hooks/MatchContainer.js +15 -24
- package/lib/relay-hooks/ProfilerContext.js +3 -3
- package/lib/relay-hooks/QueryResource.js +31 -101
- package/lib/relay-hooks/RelayEnvironmentProvider.js +5 -9
- package/lib/relay-hooks/SuspenseResource.js +9 -33
- package/lib/relay-hooks/loadEntryPoint.js +19 -31
- package/lib/relay-hooks/loadQuery.js +42 -78
- package/lib/relay-hooks/preloadQuery_DEPRECATED.js +11 -37
- package/lib/relay-hooks/prepareEntryPoint_DEPRECATED.js +9 -15
- package/lib/relay-hooks/react-cache/RelayReactCache.js +7 -12
- package/lib/relay-hooks/react-cache/getQueryResultOrFetchQuery_REACT_CACHE.js +27 -81
- package/lib/relay-hooks/react-cache/readFragmentInternal_REACT_CACHE.js +206 -0
- package/lib/relay-hooks/react-cache/useFragmentInternal_REACT_CACHE.js +195 -215
- package/lib/relay-hooks/react-cache/useFragment_REACT_CACHE.js +5 -15
- package/lib/relay-hooks/react-cache/useLazyLoadQuery_REACT_CACHE.js +17 -24
- package/lib/relay-hooks/react-cache/usePaginationFragment_REACT_CACHE.js +149 -0
- package/lib/relay-hooks/react-cache/usePreloadedQuery_REACT_CACHE.js +24 -39
- package/lib/relay-hooks/react-cache/useRefetchableFragmentInternal_REACT_CACHE.js +325 -0
- package/lib/relay-hooks/react-cache/useRefetchableFragment_REACT_CACHE.js +37 -0
- package/lib/relay-hooks/useBlockingPaginationFragment.js +73 -93
- package/lib/relay-hooks/useClientQuery.js +30 -0
- package/lib/relay-hooks/useEntryPointLoader.js +18 -38
- package/lib/relay-hooks/useFetchTrackingRef.js +10 -12
- package/lib/relay-hooks/useFragment.js +8 -19
- package/lib/relay-hooks/useFragmentNode.js +20 -32
- package/lib/relay-hooks/useIsMountedRef.js +4 -6
- package/lib/relay-hooks/useIsOperationNodeActive.js +8 -20
- package/lib/relay-hooks/useIsParentQueryActive.js +3 -6
- package/lib/relay-hooks/useLazyLoadQuery.js +7 -24
- package/lib/relay-hooks/useLazyLoadQueryNode.js +23 -34
- package/lib/relay-hooks/useLoadMoreFunction.js +46 -78
- package/lib/relay-hooks/useMemoOperationDescriptor.js +6 -15
- package/lib/relay-hooks/useMemoVariables.js +15 -34
- package/lib/relay-hooks/useMutation.js +9 -27
- package/lib/relay-hooks/usePaginationFragment.js +73 -76
- package/lib/relay-hooks/usePreloadedQuery.js +13 -44
- package/lib/relay-hooks/useQueryLoader.js +24 -49
- package/lib/relay-hooks/useRefetchableFragment.js +19 -17
- package/lib/relay-hooks/useRefetchableFragmentNode.js +65 -109
- package/lib/relay-hooks/useRelayEnvironment.js +4 -8
- package/lib/relay-hooks/useStaticFragmentNodeWarning.js +4 -8
- package/lib/relay-hooks/useSubscribeToInvalidationState.js +8 -9
- package/lib/relay-hooks/useSubscription.js +5 -10
- package/lib/relay-hooks/useUnsafeRef_DEPRECATED.js +29 -0
- package/multi-actor/ActorChange.js.flow +1 -1
- package/multi-actor/index.js.flow +1 -1
- package/multi-actor/useRelayActorEnvironment.js.flow +2 -4
- package/package.json +2 -2
- package/react-relay-hooks.js +2 -2
- package/react-relay-hooks.min.js +2 -2
- package/react-relay-legacy.js +2 -2
- package/react-relay-legacy.min.js +2 -2
- package/react-relay.js +2 -2
- package/react-relay.min.js +2 -2
- package/relay-hooks/EntryPointContainer.react.js.flow +3 -5
- package/relay-hooks/EntryPointTypes.flow.js.flow +37 -37
- package/relay-hooks/FragmentResource.js.flow +43 -19
- package/relay-hooks/HooksImplementation.js.flow +7 -9
- package/relay-hooks/InternalLogger.js.flow +1 -3
- package/relay-hooks/LRUCache.js.flow +1 -3
- package/relay-hooks/LazyLoadEntryPointContainer_DEPRECATED.react.js.flow +19 -14
- package/relay-hooks/MatchContainer.js.flow +6 -8
- package/relay-hooks/ProfilerContext.js.flow +1 -3
- package/relay-hooks/QueryResource.js.flow +29 -11
- package/relay-hooks/RelayEnvironmentProvider.js.flow +4 -6
- package/relay-hooks/SuspenseResource.js.flow +1 -3
- package/relay-hooks/__flowtests__/EntryPointTypes/EntryPointElementConfig-flowtest.js.flow +6 -4
- package/relay-hooks/__flowtests__/EntryPointTypes/NestedEntrypoints-flowtest.js.flow +4 -4
- package/relay-hooks/__flowtests__/__generated__/useFragmentFlowtest_user.graphql.js.flow +3 -1
- package/relay-hooks/__flowtests__/__generated__/useFragmentFlowtest_users.graphql.js.flow +3 -1
- package/relay-hooks/__flowtests__/useBlockingPaginationFragment-flowtest.js.flow +39 -39
- package/relay-hooks/__flowtests__/useFragment-flowtest.js.flow +1 -3
- package/relay-hooks/__flowtests__/usePaginationFragment-flowtest.js.flow +37 -38
- package/relay-hooks/__flowtests__/useRefetchableFragment-flowtest.js.flow +18 -20
- package/relay-hooks/__flowtests__/utils.js.flow +21 -12
- package/relay-hooks/loadEntryPoint.js.flow +11 -6
- package/relay-hooks/loadQuery.js.flow +11 -7
- package/relay-hooks/preloadQuery_DEPRECATED.js.flow +9 -12
- package/relay-hooks/prepareEntryPoint_DEPRECATED.js.flow +13 -10
- package/relay-hooks/react-cache/RelayReactCache.js.flow +1 -3
- package/relay-hooks/react-cache/getQueryResultOrFetchQuery_REACT_CACHE.js.flow +26 -20
- package/relay-hooks/react-cache/readFragmentInternal_REACT_CACHE.js.flow +297 -0
- package/relay-hooks/react-cache/useFragmentInternal_REACT_CACHE.js.flow +136 -96
- package/relay-hooks/react-cache/useFragment_REACT_CACHE.js.flow +1 -3
- package/relay-hooks/react-cache/useLazyLoadQuery_REACT_CACHE.js.flow +3 -5
- package/relay-hooks/react-cache/usePaginationFragment_REACT_CACHE.js.flow +190 -0
- package/relay-hooks/react-cache/usePreloadedQuery_REACT_CACHE.js.flow +3 -6
- package/relay-hooks/react-cache/useRefetchableFragmentInternal_REACT_CACHE.js.flow +601 -0
- package/relay-hooks/react-cache/useRefetchableFragment_REACT_CACHE.js.flow +65 -0
- package/relay-hooks/useBlockingPaginationFragment.js.flow +86 -59
- package/relay-hooks/useClientQuery.js.flow +39 -0
- package/relay-hooks/useEntryPointLoader.js.flow +16 -14
- package/relay-hooks/useFetchTrackingRef.js.flow +7 -8
- package/relay-hooks/useFragment.js.flow +2 -4
- package/relay-hooks/useFragmentNode.js.flow +7 -8
- package/relay-hooks/useIsMountedRef.js.flow +2 -4
- package/relay-hooks/useIsOperationNodeActive.js.flow +1 -1
- package/relay-hooks/useIsParentQueryActive.js.flow +1 -1
- package/relay-hooks/useLazyLoadQuery.js.flow +9 -32
- package/relay-hooks/useLazyLoadQueryNode.js.flow +4 -6
- package/relay-hooks/useLoadMoreFunction.js.flow +20 -17
- package/relay-hooks/useMemoOperationDescriptor.js.flow +3 -5
- package/relay-hooks/useMemoVariables.js.flow +13 -31
- package/relay-hooks/useMutation.js.flow +6 -8
- package/relay-hooks/usePaginationFragment.js.flow +75 -43
- package/relay-hooks/usePreloadedQuery.js.flow +49 -43
- package/relay-hooks/useQueryLoader.js.flow +89 -28
- package/relay-hooks/useRefetchableFragment.js.flow +83 -23
- package/relay-hooks/useRefetchableFragmentNode.js.flow +26 -22
- package/relay-hooks/useRelayEnvironment.js.flow +2 -4
- package/relay-hooks/useStaticFragmentNodeWarning.js.flow +3 -5
- package/relay-hooks/useSubscribeToInvalidationState.js.flow +2 -4
- package/relay-hooks/useSubscription.js.flow +1 -3
- package/relay-hooks/useUnsafeRef_DEPRECATED.js.flow +25 -0
- package/lib/readContext.js +0 -28
- package/readContext.js.flow +0 -31
@@ -6,37 +6,36 @@
|
|
6
6
|
*
|
7
7
|
*
|
8
8
|
* @format
|
9
|
-
* @
|
9
|
+
* @oncall relay
|
10
10
|
*/
|
11
|
+
|
11
12
|
'use strict';
|
12
13
|
|
13
14
|
var _require = require('./loadQuery'),
|
14
|
-
|
15
|
-
|
15
|
+
loadQuery = _require.loadQuery;
|
16
16
|
function loadEntryPoint(environmentProvider, entryPoint, entryPointParams) {
|
17
17
|
// Start loading the code for the entrypoint
|
18
18
|
var loadingPromise = null;
|
19
|
-
|
20
19
|
if (entryPoint.root.getModuleIfRequired() == null) {
|
21
20
|
loadingPromise = entryPoint.root.load();
|
22
21
|
}
|
23
|
-
|
24
22
|
var preloadProps = entryPoint.getPreloadProps(entryPointParams);
|
25
23
|
var queries = preloadProps.queries,
|
26
|
-
|
27
|
-
|
24
|
+
entryPoints = preloadProps.entryPoints,
|
25
|
+
extraProps = preloadProps.extraProps;
|
28
26
|
var preloadedQueries = {};
|
29
27
|
var preloadedEntryPoints = {};
|
30
|
-
|
31
28
|
if (queries != null) {
|
32
29
|
var queriesPropNames = Object.keys(queries);
|
33
30
|
queriesPropNames.forEach(function (queryPropName) {
|
34
31
|
var _queries$queryPropNam = queries[queryPropName],
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
32
|
+
environmentProviderOptions = _queries$queryPropNam.environmentProviderOptions,
|
33
|
+
options = _queries$queryPropNam.options,
|
34
|
+
parameters = _queries$queryPropNam.parameters,
|
35
|
+
variables = _queries$queryPropNam.variables;
|
39
36
|
var environment = environmentProvider.getEnvironment(environmentProviderOptions);
|
37
|
+
|
38
|
+
// $FlowFixMe[underconstrained-implicit-instantiation]
|
40
39
|
preloadedQueries[queryPropName] = loadQuery(environment, parameters, variables, {
|
41
40
|
fetchPolicy: options === null || options === void 0 ? void 0 : options.fetchPolicy,
|
42
41
|
networkCacheConfig: options === null || options === void 0 ? void 0 : options.networkCacheConfig,
|
@@ -44,75 +43,64 @@ function loadEntryPoint(environmentProvider, entryPoint, entryPointParams) {
|
|
44
43
|
}, environmentProviderOptions);
|
45
44
|
});
|
46
45
|
}
|
47
|
-
|
48
46
|
if (entryPoints != null) {
|
49
47
|
var entryPointPropNames = Object.keys(entryPoints);
|
50
48
|
entryPointPropNames.forEach(function (entryPointPropName) {
|
51
49
|
var entryPointDescription = entryPoints[entryPointPropName];
|
52
|
-
|
53
50
|
if (entryPointDescription == null) {
|
54
51
|
return;
|
55
52
|
}
|
56
|
-
|
57
53
|
var nestedEntryPoint = entryPointDescription.entryPoint,
|
58
|
-
|
54
|
+
nestedParams = entryPointDescription.entryPointParams;
|
59
55
|
preloadedEntryPoints[entryPointPropName] = loadEntryPoint(environmentProvider, nestedEntryPoint, nestedParams);
|
60
56
|
});
|
61
57
|
}
|
62
|
-
|
63
58
|
var isDisposed = false;
|
64
59
|
return {
|
65
60
|
dispose: function dispose() {
|
66
61
|
if (isDisposed) {
|
67
62
|
return;
|
68
63
|
}
|
69
|
-
|
70
64
|
if (preloadedQueries != null) {
|
71
65
|
Object.values(preloadedQueries).forEach(function (_ref) {
|
72
66
|
var innerDispose = _ref.dispose;
|
73
67
|
innerDispose();
|
74
68
|
});
|
75
69
|
}
|
76
|
-
|
77
70
|
if (preloadedEntryPoints != null) {
|
78
71
|
Object.values(preloadedEntryPoints).forEach(function (_ref2) {
|
79
72
|
var innerDispose = _ref2.dispose;
|
80
73
|
innerDispose();
|
81
74
|
});
|
82
75
|
}
|
83
|
-
|
84
76
|
isDisposed = true;
|
85
77
|
},
|
86
78
|
entryPoints: preloadedEntryPoints,
|
87
79
|
extraProps: extraProps !== null && extraProps !== void 0 ? extraProps : null,
|
88
80
|
getComponent: function getComponent() {
|
89
81
|
var componentModule = entryPoint.root.getModuleIfRequired();
|
90
|
-
|
91
82
|
if (componentModule == null) {
|
92
83
|
var _loadingPromise;
|
93
|
-
|
94
84
|
loadingPromise = (_loadingPromise = loadingPromise) !== null && _loadingPromise !== void 0 ? _loadingPromise : entryPoint.root.load();
|
95
85
|
throw loadingPromise;
|
96
|
-
}
|
86
|
+
}
|
87
|
+
|
88
|
+
// On certain platforms, getting an es6 module with a default export from a JSResource will return an object like
|
97
89
|
// {default: module}, so let's assume that if the "component" has a static property named "default"
|
98
90
|
// that it's actually an es6 module wrapper, so unwrap it. This won't work for React classes with a static property named "default", but
|
99
91
|
// that's probably a worthwhile trade-off.
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
92
|
+
var component =
|
93
|
+
// $FlowIgnore[prop-missing]
|
94
|
+
componentModule["default"] != null ? componentModule["default"] : componentModule;
|
95
|
+
// $FlowFixMe[incompatible-cast] - trust me Flow, its entryPoint component
|
105
96
|
return component;
|
106
97
|
},
|
107
|
-
|
108
98
|
// $FlowFixMe[unsafe-getters-setters] - this has no side effects
|
109
99
|
get isDisposed() {
|
110
100
|
return isDisposed;
|
111
101
|
},
|
112
|
-
|
113
102
|
queries: preloadedQueries,
|
114
103
|
rootModuleID: entryPoint.root.getModuleId()
|
115
104
|
};
|
116
105
|
}
|
117
|
-
|
118
106
|
module.exports = loadEntryPoint;
|
@@ -6,51 +6,44 @@
|
|
6
6
|
*
|
7
7
|
*
|
8
8
|
* @format
|
9
|
-
* @
|
9
|
+
* @oncall relay
|
10
10
|
*/
|
11
|
-
'use strict';
|
12
11
|
|
13
|
-
|
12
|
+
'use strict';
|
14
13
|
|
14
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
15
15
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
16
|
-
|
17
16
|
var invariant = require('invariant');
|
18
|
-
|
19
17
|
var React = require('react');
|
20
|
-
|
21
18
|
var _require = require('relay-runtime'),
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
19
|
+
fetchQueryDeduped = _require.__internal.fetchQueryDeduped,
|
20
|
+
Observable = _require.Observable,
|
21
|
+
PreloadableQueryRegistry = _require.PreloadableQueryRegistry,
|
22
|
+
RelayFeatureFlags = _require.RelayFeatureFlags,
|
23
|
+
ReplaySubject = _require.ReplaySubject,
|
24
|
+
createOperationDescriptor = _require.createOperationDescriptor,
|
25
|
+
getRequest = _require.getRequest,
|
26
|
+
getRequestIdentifier = _require.getRequestIdentifier;
|
31
27
|
var warning = require("fbjs/lib/warning");
|
32
|
-
|
33
28
|
var RenderDispatcher = null;
|
34
29
|
var fetchKey = 100001;
|
35
|
-
|
36
30
|
function useTrackLoadQueryInRender() {
|
37
31
|
if (RenderDispatcher === null) {
|
38
32
|
var _React$__SECRET_INTER, _React$__SECRET_INTER2;
|
39
|
-
|
40
33
|
// Flow does not know of React internals (rightly so), but we need to
|
41
34
|
// ensure here that this function isn't called inside render.
|
42
35
|
RenderDispatcher = // $FlowFixMe[prop-missing]
|
43
36
|
(_React$__SECRET_INTER = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || _React$__SECRET_INTER === void 0 ? void 0 : (_React$__SECRET_INTER2 = _React$__SECRET_INTER.ReactCurrentDispatcher) === null || _React$__SECRET_INTER2 === void 0 ? void 0 : _React$__SECRET_INTER2.current;
|
44
37
|
}
|
45
38
|
}
|
46
|
-
|
47
39
|
function loadQuery(environment, preloadableRequest, variables, options, environmentProviderOptions) {
|
48
40
|
var _React$__SECRET_INTER3, _React$__SECRET_INTER4, _options$__nameForWar, _options$fetchPolicy;
|
49
|
-
|
50
41
|
// This code ensures that we don't call loadQuery during render.
|
51
42
|
var CurrentDispatcher = // $FlowFixMe[prop-missing]
|
52
43
|
(_React$__SECRET_INTER3 = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || _React$__SECRET_INTER3 === void 0 ? void 0 : (_React$__SECRET_INTER4 = _React$__SECRET_INTER3.ReactCurrentDispatcher) === null || _React$__SECRET_INTER4 === void 0 ? void 0 : _React$__SECRET_INTER4.current;
|
53
|
-
process.env.NODE_ENV !== "production" ? warning(RenderDispatcher == null || CurrentDispatcher !== RenderDispatcher, 'Relay: `%s` should not be called inside a React render function.', (_options$__nameForWar = options === null || options === void 0 ? void 0 : options.__nameForWarning) !== null && _options$__nameForWar !== void 0 ? _options$__nameForWar : 'loadQuery') : void 0;
|
44
|
+
process.env.NODE_ENV !== "production" ? warning(RenderDispatcher == null || CurrentDispatcher !== RenderDispatcher, 'Relay: `%s` should not be called inside a React render function.', (_options$__nameForWar = options === null || options === void 0 ? void 0 : options.__nameForWarning) !== null && _options$__nameForWar !== void 0 ? _options$__nameForWar : 'loadQuery') : void 0;
|
45
|
+
|
46
|
+
// Every time you call loadQuery, we will generate a new fetchKey.
|
54
47
|
// This will ensure that every query reference that is created and
|
55
48
|
// passed to usePreloadedQuery is independently evaluated,
|
56
49
|
// even if they are for the same query/variables.
|
@@ -59,25 +52,26 @@ function loadQuery(environment, preloadableRequest, variables, options, environm
|
|
59
52
|
// cache in usePreloadedQuery reuse the cached result instead of
|
60
53
|
// re-evaluating the new query ref and triggering a refetch if
|
61
54
|
// necessary.
|
62
|
-
|
63
55
|
fetchKey++;
|
64
56
|
var fetchPolicy = (_options$fetchPolicy = options === null || options === void 0 ? void 0 : options.fetchPolicy) !== null && _options$fetchPolicy !== void 0 ? _options$fetchPolicy : 'store-or-network';
|
65
57
|
var networkCacheConfig = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, options === null || options === void 0 ? void 0 : options.networkCacheConfig), {}, {
|
66
58
|
force: true
|
67
|
-
});
|
59
|
+
});
|
60
|
+
|
61
|
+
// executeWithNetworkSource will retain and execute an operation
|
68
62
|
// against the Relay store, given an Observable that would provide
|
69
63
|
// the network events for the operation.
|
70
|
-
|
71
64
|
var retainReference;
|
72
65
|
var didExecuteNetworkSource = false;
|
73
|
-
|
74
66
|
var executeWithNetworkSource = function executeWithNetworkSource(operation, networkObservable) {
|
75
67
|
didExecuteNetworkSource = true;
|
76
68
|
return environment.executeWithSource({
|
77
69
|
operation: operation,
|
78
70
|
source: networkObservable
|
79
71
|
});
|
80
|
-
};
|
72
|
+
};
|
73
|
+
|
74
|
+
// N.B. For loadQuery, we unconventionally want to return an Observable
|
81
75
|
// that isn't lazily executed, meaning that we don't want to wait
|
82
76
|
// until the returned Observable is subscribed to to actually start
|
83
77
|
// fetching and executing an operation; i.e. we want to execute the
|
@@ -86,20 +80,17 @@ function loadQuery(environment, preloadableRequest, variables, options, environm
|
|
86
80
|
// allows us to capture the events that occur during the eager execution
|
87
81
|
// of the operation, and then replay them to the Observable we
|
88
82
|
// ultimately return.
|
89
|
-
|
90
|
-
|
91
83
|
var executionSubject = new ReplaySubject();
|
92
84
|
var returnedObservable = Observable.create(function (sink) {
|
93
85
|
return executionSubject.subscribe(sink);
|
94
86
|
});
|
95
87
|
var unsubscribeFromNetworkRequest;
|
96
|
-
var networkError = null;
|
88
|
+
var networkError = null;
|
89
|
+
// makeNetworkRequest will immediately start a raw network request if
|
97
90
|
// one isn't already in flight and return an Observable that when
|
98
91
|
// subscribed to will replay the network events that have occured so far,
|
99
92
|
// as well as subsequent events.
|
100
|
-
|
101
93
|
var didMakeNetworkRequest = false;
|
102
|
-
|
103
94
|
var makeNetworkRequest = function makeNetworkRequest(params) {
|
104
95
|
// N.B. this function is called synchronously or not at all
|
105
96
|
// didMakeNetworkRequest is safe to rely on in the returned value
|
@@ -110,7 +101,6 @@ function loadQuery(environment, preloadableRequest, variables, options, environm
|
|
110
101
|
didMakeNetworkRequest = true;
|
111
102
|
var observable;
|
112
103
|
var subject = new ReplaySubject();
|
113
|
-
|
114
104
|
if (RelayFeatureFlags.ENABLE_LOAD_QUERY_REQUEST_DEDUPING === true) {
|
115
105
|
// Here, we are calling fetchQueryDeduped at the network layer level,
|
116
106
|
// which ensures that only a single network request is active for a given
|
@@ -136,21 +126,19 @@ function loadQuery(environment, preloadableRequest, variables, options, environm
|
|
136
126
|
var network = environment.getNetwork();
|
137
127
|
observable = network.execute(params, variables, networkCacheConfig);
|
138
128
|
}
|
139
|
-
|
140
129
|
var _observable$subscribe = observable.subscribe({
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
130
|
+
error: function error(err) {
|
131
|
+
networkError = err;
|
132
|
+
subject.error(err);
|
133
|
+
},
|
134
|
+
next: function next(data) {
|
135
|
+
subject.next(data);
|
136
|
+
},
|
137
|
+
complete: function complete() {
|
138
|
+
subject.complete();
|
139
|
+
}
|
140
|
+
}),
|
141
|
+
unsubscribe = _observable$subscribe.unsubscribe;
|
154
142
|
unsubscribeFromNetworkRequest = unsubscribe;
|
155
143
|
return Observable.create(function (sink) {
|
156
144
|
var subjectSubscription = subject.subscribe(sink);
|
@@ -160,9 +148,7 @@ function loadQuery(environment, preloadableRequest, variables, options, environm
|
|
160
148
|
};
|
161
149
|
});
|
162
150
|
};
|
163
|
-
|
164
151
|
var unsubscribeFromExecution;
|
165
|
-
|
166
152
|
var executeDeduped = function executeDeduped(operation, fetchFn) {
|
167
153
|
if (RelayFeatureFlags.ENABLE_LOAD_QUERY_REQUEST_DEDUPING === true) {
|
168
154
|
// N.B. at this point, if we're calling execute with a query ast (OperationDescriptor),
|
@@ -174,7 +160,9 @@ function loadQuery(environment, preloadableRequest, variables, options, environm
|
|
174
160
|
// so we set this to true before deduping, to guarantee that the `source`
|
175
161
|
// observable is returned.
|
176
162
|
didMakeNetworkRequest = true;
|
177
|
-
}
|
163
|
+
}
|
164
|
+
|
165
|
+
// Here, we are calling fetchQueryDeduped, which ensures that only
|
178
166
|
// a single operation is active for a given (environment, identifier) pair,
|
179
167
|
// and also tracks the active state of the operation, which is necessary
|
180
168
|
// for our Suspense infra to later be able to suspend (or not) on
|
@@ -188,8 +176,6 @@ function loadQuery(environment, preloadableRequest, variables, options, environm
|
|
188
176
|
// - If no duplicate active operation is found, it will call the fetchFn
|
189
177
|
// to execute the operation, and return an Observable that will provide
|
190
178
|
// the events for executing the operation.
|
191
|
-
|
192
|
-
|
193
179
|
var _fetchQueryDeduped$su = fetchQueryDeduped(environment, operation.request.identifier, fetchFn).subscribe({
|
194
180
|
error: function error(err) {
|
195
181
|
executionSubject.error(err);
|
@@ -201,23 +187,19 @@ function loadQuery(environment, preloadableRequest, variables, options, environm
|
|
201
187
|
executionSubject.complete();
|
202
188
|
}
|
203
189
|
});
|
204
|
-
|
205
190
|
unsubscribeFromExecution = _fetchQueryDeduped$su.unsubscribe;
|
206
191
|
};
|
207
|
-
|
208
192
|
var checkAvailabilityAndExecute = function checkAvailabilityAndExecute(concreteRequest) {
|
209
193
|
var operation = createOperationDescriptor(concreteRequest, variables, networkCacheConfig);
|
210
194
|
retainReference = environment.retain(operation);
|
211
|
-
|
212
195
|
if (fetchPolicy === 'store-only') {
|
213
196
|
return;
|
214
|
-
}
|
197
|
+
}
|
198
|
+
|
199
|
+
// N.B. If the fetch policy allows fulfillment from the store but the
|
215
200
|
// environment already has the data for that operation cached in the store,
|
216
201
|
// then we do nothing.
|
217
|
-
|
218
|
-
|
219
202
|
var shouldFetch = fetchPolicy !== 'store-or-network' || environment.check(operation).status !== 'available';
|
220
|
-
|
221
203
|
if (shouldFetch) {
|
222
204
|
executeDeduped(operation, function () {
|
223
205
|
// N.B. Since we have the operation synchronously available here,
|
@@ -228,20 +210,16 @@ function loadQuery(environment, preloadableRequest, variables, options, environm
|
|
228
210
|
});
|
229
211
|
}
|
230
212
|
};
|
231
|
-
|
232
213
|
var params;
|
233
214
|
var cancelOnLoadCallback;
|
234
215
|
var queryId;
|
235
|
-
|
236
216
|
if (preloadableRequest.kind === 'PreloadableConcreteRequest') {
|
237
217
|
var preloadableConcreteRequest = preloadableRequest;
|
238
218
|
params = preloadableConcreteRequest.params;
|
239
219
|
var _params = params;
|
240
220
|
queryId = _params.id;
|
241
221
|
!(queryId !== null) ? process.env.NODE_ENV !== "production" ? invariant(false, 'Relay: `loadQuery` requires that preloadable query `%s` has a persisted query id', params.name) : invariant(false) : void 0;
|
242
|
-
|
243
222
|
var _module = PreloadableQueryRegistry.get(queryId);
|
244
|
-
|
245
223
|
if (_module != null) {
|
246
224
|
checkAvailabilityAndExecute(_module);
|
247
225
|
} else {
|
@@ -252,20 +230,18 @@ function loadQuery(environment, preloadableRequest, variables, options, environm
|
|
252
230
|
// ast, and we know that if we don't have the query ast
|
253
231
|
// available, then this query could've never been written to the
|
254
232
|
// store in the first place, so it couldn't have been cached.
|
255
|
-
var networkObservable = fetchPolicy === 'store-only' ? null : makeNetworkRequest(params);
|
256
|
-
|
233
|
+
var networkObservable = fetchPolicy === 'store-only' ? null : makeNetworkRequest(params);
|
234
|
+
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
|
257
235
|
var _PreloadableQueryRegi = PreloadableQueryRegistry.onLoad(queryId, function (preloadedModule) {
|
258
236
|
cancelOnLoadCallback();
|
259
237
|
var operation = createOperationDescriptor(preloadedModule, variables, networkCacheConfig);
|
260
238
|
retainReference = environment.retain(operation);
|
261
|
-
|
262
239
|
if (networkObservable != null) {
|
263
240
|
executeDeduped(operation, function () {
|
264
241
|
return executeWithNetworkSource(operation, networkObservable);
|
265
242
|
});
|
266
243
|
}
|
267
244
|
});
|
268
|
-
|
269
245
|
cancelOnLoadCallback = _PreloadableQueryRegi.dispose;
|
270
246
|
}
|
271
247
|
} else {
|
@@ -275,35 +251,28 @@ function loadQuery(environment, preloadableRequest, variables, options, environm
|
|
275
251
|
queryId = params.cacheID != null ? params.cacheID : params.id;
|
276
252
|
checkAvailabilityAndExecute(request);
|
277
253
|
}
|
278
|
-
|
279
254
|
var isDisposed = false;
|
280
255
|
var isReleased = false;
|
281
256
|
var isNetworkRequestCancelled = false;
|
282
|
-
|
283
257
|
var releaseQuery = function releaseQuery() {
|
284
258
|
if (isReleased) {
|
285
259
|
return;
|
286
260
|
}
|
287
|
-
|
288
261
|
retainReference && retainReference.dispose();
|
289
262
|
isReleased = true;
|
290
263
|
};
|
291
|
-
|
292
264
|
var cancelNetworkRequest = function cancelNetworkRequest() {
|
293
265
|
if (isNetworkRequestCancelled) {
|
294
266
|
return;
|
295
267
|
}
|
296
|
-
|
297
268
|
if (didExecuteNetworkSource) {
|
298
269
|
unsubscribeFromExecution && unsubscribeFromExecution();
|
299
270
|
} else {
|
300
271
|
unsubscribeFromNetworkRequest && unsubscribeFromNetworkRequest();
|
301
272
|
}
|
302
|
-
|
303
273
|
cancelOnLoadCallback && cancelOnLoadCallback();
|
304
274
|
isNetworkRequestCancelled = true;
|
305
275
|
};
|
306
|
-
|
307
276
|
return {
|
308
277
|
kind: 'PreloadedQuery',
|
309
278
|
environment: environment,
|
@@ -312,7 +281,6 @@ function loadQuery(environment, preloadableRequest, variables, options, environm
|
|
312
281
|
if (isDisposed) {
|
313
282
|
return;
|
314
283
|
}
|
315
|
-
|
316
284
|
releaseQuery();
|
317
285
|
cancelNetworkRequest();
|
318
286
|
isDisposed = true;
|
@@ -321,17 +289,14 @@ function loadQuery(environment, preloadableRequest, variables, options, environm
|
|
321
289
|
cancelNetworkRequest: cancelNetworkRequest,
|
322
290
|
fetchKey: fetchKey,
|
323
291
|
id: queryId,
|
324
|
-
|
325
292
|
// $FlowFixMe[unsafe-getters-setters] - this has no side effects
|
326
293
|
get isDisposed() {
|
327
294
|
return isDisposed || isReleased;
|
328
295
|
},
|
329
|
-
|
330
296
|
// $FlowFixMe[unsafe-getters-setters] - this has no side effects
|
331
297
|
get networkError() {
|
332
298
|
return networkError;
|
333
299
|
},
|
334
|
-
|
335
300
|
name: params.name,
|
336
301
|
networkCacheConfig: networkCacheConfig,
|
337
302
|
fetchPolicy: fetchPolicy,
|
@@ -339,7 +304,6 @@ function loadQuery(environment, preloadableRequest, variables, options, environm
|
|
339
304
|
variables: variables
|
340
305
|
};
|
341
306
|
}
|
342
|
-
|
343
307
|
module.exports = {
|
344
308
|
loadQuery: loadQuery,
|
345
309
|
useTrackLoadQueryInRender: useTrackLoadQueryInRender
|
@@ -4,66 +4,53 @@
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*
|
7
|
-
* @emails oncall+relay
|
8
7
|
*
|
9
8
|
* @format
|
9
|
+
* @oncall relay
|
10
10
|
*/
|
11
|
-
// flowlint ambiguous-object-type:error
|
12
|
-
'use strict';
|
13
11
|
|
14
|
-
|
12
|
+
'use strict';
|
15
13
|
|
14
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
16
15
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
17
|
-
|
18
16
|
var _require = require('relay-runtime'),
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
17
|
+
Observable = _require.Observable,
|
18
|
+
PreloadableQueryRegistry = _require.PreloadableQueryRegistry,
|
19
|
+
ReplaySubject = _require.ReplaySubject,
|
20
|
+
createOperationDescriptor = _require.createOperationDescriptor,
|
21
|
+
getRequest = _require.getRequest,
|
22
|
+
getRequestIdentifier = _require.getRequestIdentifier;
|
23
|
+
|
24
|
+
// Expire results by this delay after they resolve.
|
28
25
|
var DEFAULT_PREFETCH_TIMEOUT = 30 * 1000; // 30 seconds
|
29
26
|
|
30
27
|
var WEAKMAP_SUPPORTED = typeof WeakMap === 'function';
|
31
28
|
var STORE_OR_NETWORK_DEFAULT = 'store-or-network';
|
32
29
|
var pendingQueriesByEnvironment = WEAKMAP_SUPPORTED ? new WeakMap() : new Map();
|
33
|
-
|
34
30
|
function preloadQuery(environment, preloadableRequest, variables, options, environmentProviderOptions) {
|
35
31
|
var _pendingQueries = pendingQueriesByEnvironment.get(environment);
|
36
|
-
|
37
32
|
if (_pendingQueries == null) {
|
38
33
|
_pendingQueries = new Map();
|
39
34
|
pendingQueriesByEnvironment.set(environment, _pendingQueries);
|
40
35
|
}
|
41
|
-
|
42
36
|
var pendingQueries = _pendingQueries; // store in a const for flow
|
43
|
-
|
44
37
|
var queryEntry = preloadQueryDeduped(environment, pendingQueries, preloadableRequest, variables, options);
|
45
38
|
var source = queryEntry.kind === 'network' ? Observable.create(function (sink) {
|
46
39
|
var subscription;
|
47
|
-
|
48
40
|
if (pendingQueries.get(queryEntry.cacheKey) == null) {
|
49
41
|
var newQueryEntry = preloadQueryDeduped(environment, pendingQueries, preloadableRequest, variables, options);
|
50
|
-
|
51
42
|
if (newQueryEntry.kind === 'network') {
|
52
43
|
subscription = newQueryEntry.subject.subscribe(sink);
|
53
44
|
}
|
54
45
|
} else {
|
55
46
|
subscription = queryEntry.subject.subscribe(sink);
|
56
47
|
}
|
57
|
-
|
58
48
|
return function () {
|
59
49
|
var _subscription;
|
60
|
-
|
61
50
|
(_subscription = subscription) === null || _subscription === void 0 ? void 0 : _subscription.unsubscribe();
|
62
|
-
|
63
51
|
if (environment.isServer()) {
|
64
52
|
return;
|
65
53
|
}
|
66
|
-
|
67
54
|
setTimeout(function () {
|
68
55
|
// Clear the cache entry after the default timeout
|
69
56
|
// null-check for Flow
|
@@ -87,13 +74,10 @@ function preloadQuery(environment, preloadableRequest, variables, options, envir
|
|
87
74
|
status: queryEntry.status
|
88
75
|
};
|
89
76
|
}
|
90
|
-
|
91
77
|
function preloadQueryDeduped(environment, pendingQueries, preloadableRequest, variables, options) {
|
92
78
|
var _options$fetchPolicy;
|
93
|
-
|
94
79
|
var params;
|
95
80
|
var query;
|
96
|
-
|
97
81
|
if (preloadableRequest.kind === 'PreloadableConcreteRequest') {
|
98
82
|
var preloadableConcreteRequest = preloadableRequest;
|
99
83
|
params = preloadableConcreteRequest.params;
|
@@ -102,7 +86,6 @@ function preloadQueryDeduped(environment, pendingQueries, preloadableRequest, va
|
|
102
86
|
query = getRequest(preloadableRequest);
|
103
87
|
params = query.params;
|
104
88
|
}
|
105
|
-
|
106
89
|
var network = environment.getNetwork();
|
107
90
|
var fetchPolicy = (_options$fetchPolicy = options === null || options === void 0 ? void 0 : options.fetchPolicy) !== null && _options$fetchPolicy !== void 0 ? _options$fetchPolicy : STORE_OR_NETWORK_DEFAULT;
|
108
91
|
var fetchKey = options === null || options === void 0 ? void 0 : options.fetchKey;
|
@@ -115,10 +98,8 @@ function preloadQueryDeduped(environment, pendingQueries, preloadableRequest, va
|
|
115
98
|
status: 'missing'
|
116
99
|
};
|
117
100
|
var nextQueryEntry;
|
118
|
-
|
119
101
|
if (availability.status === 'available' && query != null) {
|
120
102
|
var _availability$fetchTi;
|
121
|
-
|
122
103
|
nextQueryEntry = prevQueryEntry && prevQueryEntry.kind === 'cache' ? prevQueryEntry : {
|
123
104
|
cacheKey: cacheKey,
|
124
105
|
fetchKey: fetchKey,
|
@@ -132,7 +113,6 @@ function preloadQueryDeduped(environment, pendingQueries, preloadableRequest, va
|
|
132
113
|
fetchTime: (_availability$fetchTi = availability === null || availability === void 0 ? void 0 : availability.fetchTime) !== null && _availability$fetchTi !== void 0 ? _availability$fetchTi : null
|
133
114
|
}
|
134
115
|
};
|
135
|
-
|
136
116
|
if (!environment.isServer() && prevQueryEntry == null) {
|
137
117
|
setTimeout(function () {
|
138
118
|
// Clear the cache entry after the default timeout
|
@@ -163,7 +143,6 @@ function preloadQueryDeduped(environment, pendingQueries, preloadableRequest, va
|
|
163
143
|
if (environment.isServer()) {
|
164
144
|
return;
|
165
145
|
}
|
166
|
-
|
167
146
|
setTimeout(function () {
|
168
147
|
// Clear the cache entry after the default timeout
|
169
148
|
// null-check for Flow
|
@@ -186,25 +165,20 @@ function preloadQueryDeduped(environment, pendingQueries, preloadableRequest, va
|
|
186
165
|
} else {
|
187
166
|
nextQueryEntry = prevQueryEntry;
|
188
167
|
}
|
189
|
-
|
190
168
|
pendingQueries.set(cacheKey, nextQueryEntry);
|
191
169
|
return nextQueryEntry;
|
192
170
|
}
|
193
|
-
|
194
171
|
function cleanup(pendingQueries, entry) {
|
195
172
|
// Reload the entry by its cache key and only invalidate if its the identical
|
196
173
|
// entry instance. This ensures that if the same query/variables are fetched
|
197
174
|
// successively that a timeout/expiration from an earlier fetch doesn't clear
|
198
175
|
// a subsequent fetch.
|
199
176
|
var currentEntry = pendingQueries.get(entry.cacheKey);
|
200
|
-
|
201
177
|
if (currentEntry != null && currentEntry === entry) {
|
202
178
|
if (currentEntry.kind === 'network') {
|
203
179
|
currentEntry.subscription.unsubscribe();
|
204
180
|
}
|
205
|
-
|
206
181
|
pendingQueries["delete"](currentEntry.cacheKey);
|
207
182
|
}
|
208
183
|
}
|
209
|
-
|
210
184
|
module.exports = preloadQuery;
|
@@ -4,54 +4,48 @@
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*
|
7
|
-
* @emails oncall+relay
|
8
7
|
*
|
9
8
|
* @format
|
9
|
+
* @oncall relay
|
10
10
|
*/
|
11
|
-
|
11
|
+
|
12
12
|
'use strict';
|
13
13
|
|
14
14
|
var preloadQuery = require('./preloadQuery_DEPRECATED');
|
15
|
-
|
16
15
|
function prepareEntryPoint(environmentProvider, entryPoint, entryPointParams) {
|
17
16
|
// Start loading the code for the entrypoint
|
18
17
|
if (entryPoint.root.getModuleIfRequired() == null) {
|
18
|
+
// $FlowFixMe[unused-promise]
|
19
19
|
entryPoint.root.load();
|
20
20
|
}
|
21
|
-
|
22
21
|
var preloadProps = entryPoint.getPreloadProps(entryPointParams);
|
23
22
|
var queries = preloadProps.queries,
|
24
|
-
|
23
|
+
entryPoints = preloadProps.entryPoints;
|
25
24
|
var preloadedQueries = {};
|
26
25
|
var preloadedEntryPoints = {};
|
27
|
-
|
28
26
|
if (queries != null) {
|
29
27
|
var queriesPropNames = Object.keys(queries);
|
30
28
|
queriesPropNames.forEach(function (queryPropName) {
|
31
29
|
var _queries$queryPropNam = queries[queryPropName],
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
30
|
+
environmentProviderOptions = _queries$queryPropNam.environmentProviderOptions,
|
31
|
+
options = _queries$queryPropNam.options,
|
32
|
+
parameters = _queries$queryPropNam.parameters,
|
33
|
+
variables = _queries$queryPropNam.variables;
|
36
34
|
var environment = environmentProvider.getEnvironment(environmentProviderOptions);
|
37
35
|
preloadedQueries[queryPropName] = preloadQuery(environment, parameters, variables, options, environmentProviderOptions);
|
38
36
|
});
|
39
37
|
}
|
40
|
-
|
41
38
|
if (entryPoints != null) {
|
42
39
|
var entryPointPropNames = Object.keys(entryPoints);
|
43
40
|
entryPointPropNames.forEach(function (entryPointPropName) {
|
44
41
|
var entryPointDescription = entryPoints[entryPointPropName];
|
45
|
-
|
46
42
|
if (entryPointDescription == null) {
|
47
43
|
return;
|
48
44
|
}
|
49
|
-
|
50
45
|
var nestedEntryPoint = entryPointDescription.entryPoint,
|
51
|
-
|
46
|
+
nestedParams = entryPointDescription.entryPointParams;
|
52
47
|
preloadedEntryPoints[entryPointPropName] = prepareEntryPoint(environmentProvider, nestedEntryPoint, nestedParams);
|
53
48
|
});
|
54
49
|
}
|
55
50
|
}
|
56
|
-
|
57
51
|
module.exports = prepareEntryPoint;
|