Skip to content
Permalink
Browse files

Add exports to relay-runtime to make available in relay-experimental

Summary:
relay-experimental modules had to import modules directly from the internals of relay-runtime since they weren't exported through the main index.js file.

This broke the react-relay@experimental package. To fix this, this commit exports the required files from relay-runtime

Reviewed By: yuzhi

Differential Revision: D18080925

fbshipit-source-id: 4a09aa0ccd64a7b4bef00d96655369a15fec2e73
  • Loading branch information
jstejada authored and facebook-github-bot committed Oct 23, 2019
1 parent d764ff3 commit a0fc1019f07bec45e0a0d887963961a08f24adaf
Showing with 8 additions and 4 deletions.
  1. +4 −4 packages/relay-experimental/preloadQuery.js
  2. +4 −0 packages/relay-runtime/index.js
@@ -12,15 +12,15 @@
'use strict';

const ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
const RelayReplaySubject = require('relay-runtime/util/RelayReplaySubject');

const getRequestIdentifier = require('relay-runtime/util/getRequestIdentifier');
const invariant = require('invariant');

const {
Environment,
Observable,
ReplaySubject,
createOperationDescriptor,
getRequestIdentifier,
} = require('relay-runtime');

import type {
@@ -52,7 +52,7 @@ type PendingQueryEntry =
fetchKey: ?string | ?number,
fetchPolicy: PreloadFetchPolicy,
kind: 'network',
subject: RelayReplaySubject<GraphQLResponse>,
subject: ReplaySubject<GraphQLResponse>,
subscription: Subscription,
|}>
| $ReadOnly<{|
@@ -157,7 +157,7 @@ function preloadQueryDeduped<TQuery: OperationType>(
variables,
);
const source = network.execute(params, variables, {}, null, logRequestInfo);
const subject = new RelayReplaySubject();
const subject = new ReplaySubject();
nextQueryEntry = {
cacheKey,
fetchKey,
@@ -33,6 +33,7 @@ const RelayOperationTracker = require('./store/RelayOperationTracker');
const RelayProfiler = require('./util/RelayProfiler');
const RelayQueryResponseCache = require('./network/RelayQueryResponseCache');
const RelayRecordSource = require('./store/RelayRecordSource');
const RelayReplaySubject = require('./util/RelayReplaySubject');
const RelayStoreUtils = require('./store/RelayStoreUtils');
const ViewerPattern = require('./store/ViewerPattern');

@@ -47,6 +48,7 @@ const fetchQueryInternal = require('./query/fetchQueryInternal');
const getFragmentIdentifier = require('./util/getFragmentIdentifier');
const getFragmentSpecIdentifier = require('./util/getFragmentSpecIdentifier');
const getRelayHandleKey = require('./util/getRelayHandleKey');
const getRequestIdentifier = require('./util/getRequestIdentifier');
const isPromise = require('./util/isPromise');
const isRelayModernEnvironment = require('./store/isRelayModernEnvironment');
const isScalarAndEqual = require('./util/isScalarAndEqual');
@@ -218,6 +220,7 @@ module.exports = {
QueryResponseCache: RelayQueryResponseCache,
RecordSource: RelayRecordSource,
Record: RelayModernRecord,
ReplaySubject: RelayReplaySubject,
Store: RelayModernStore,

areEqualSelectors: RelayModernSelector.areEqualSelectors,
@@ -238,6 +241,7 @@ module.exports = {
getPluralSelector: RelayModernSelector.getPluralSelector,
getRefetchableFragment: RelayModernGraphQLTag.getRefetchableFragment,
getRequest: RelayModernGraphQLTag.getRequest,
getRequestIdentifier: getRequestIdentifier,
getSelector: RelayModernSelector.getSelector,
getSelectorsFromObject: RelayModernSelector.getSelectorsFromObject,
getSingularSelector: RelayModernSelector.getSingularSelector,

0 comments on commit a0fc101

Please sign in to comment.
You can’t perform that action at this time.