From edef218ee6eede109f0c316309d5e0075aa61803 Mon Sep 17 00:00:00 2001 From: Jan Kassens Date: Mon, 5 Apr 2021 12:39:22 -0700 Subject: [PATCH] Drop RelayModern prefix from QueryExecutor Reviewed By: josephsavona Differential Revision: D27566611 fbshipit-source-id: a3074f8b989388b97a41223c9772c7b3e94239cd --- packages/relay-runtime/index.js | 2 +- ...layModernQueryExecutor.js => QueryExecutor.js} | 10 +++++----- .../relay-runtime/store/RelayModernEnvironment.js | 15 +++++++-------- 3 files changed, 13 insertions(+), 14 deletions(-) rename packages/relay-runtime/store/{RelayModernQueryExecutor.js => QueryExecutor.js} (99%) diff --git a/packages/relay-runtime/index.js b/packages/relay-runtime/index.js index 3561d403a2fbd..fbce3900889b9 100644 --- a/packages/relay-runtime/index.js +++ b/packages/relay-runtime/index.js @@ -110,8 +110,8 @@ export type { Subscription, } from './network/RelayObservable'; export type {GraphQLTaggedNode} from './query/GraphQLTag'; +export type {TaskScheduler} from './store/QueryExecutor'; export type {EnvironmentConfig} from './store/RelayModernEnvironment'; -export type {TaskScheduler} from './store/RelayModernQueryExecutor'; export type {RecordState} from './store/RelayRecordState'; export type { FragmentMap, diff --git a/packages/relay-runtime/store/RelayModernQueryExecutor.js b/packages/relay-runtime/store/QueryExecutor.js similarity index 99% rename from packages/relay-runtime/store/RelayModernQueryExecutor.js rename to packages/relay-runtime/store/QueryExecutor.js index c07a911596555..2f797cb219979 100644 --- a/packages/relay-runtime/store/RelayModernQueryExecutor.js +++ b/packages/relay-runtime/store/QueryExecutor.js @@ -276,7 +276,7 @@ class Executor { } default: (this._state: empty); - invariant(false, 'RelayModernQueryExecutor: invalid executor state.'); + invariant(false, 'QueryExecutor: invalid executor state.'); } this._operationExecutions.set( this._operation.request.identifier, @@ -403,7 +403,7 @@ class Executor { if (isOptimistic && this._state !== 'started') { invariant( false, - 'RelayModernQueryExecutor: optimistic payload received after server payload.', + 'QueryExecutor: optimistic payload received after server payload.', ); } if (isOptimistic) { @@ -649,7 +649,7 @@ class Executor { if (this._optimisticUpdates == null) { warning( false, - 'RelayModernQueryExecutor: Unexpected ModuleImport optimistic ' + + 'QueryExecutor: Unexpected ModuleImport optimistic ' + 'update in operation %s.' + this._operation.request.node.params.name, ); @@ -1339,7 +1339,7 @@ function partitionGraphQLResponses( if (label == null || path == null) { invariant( false, - 'RelayModernQueryExecutor: invalid incremental payload, expected ' + + 'QueryExecutor: invalid incremental payload, expected ' + '`path` and `label` to either both be null/undefined, or ' + '`path` to be an `Array` and `label` to be a ' + '`string`.', @@ -1391,7 +1391,7 @@ function validateOptimisticResponsePayload( if (incrementalPlaceholders != null && incrementalPlaceholders.length !== 0) { invariant( false, - 'RelayModernQueryExecutor: optimistic responses cannot be returned ' + + 'QueryExecutor: optimistic responses cannot be returned ' + 'for operations that use incremental data delivery (@defer, ' + '@stream, and @stream_connection).', ); diff --git a/packages/relay-runtime/store/RelayModernEnvironment.js b/packages/relay-runtime/store/RelayModernEnvironment.js index ed5fa8e947744..ab9b9c4cffbe5 100644 --- a/packages/relay-runtime/store/RelayModernEnvironment.js +++ b/packages/relay-runtime/store/RelayModernEnvironment.js @@ -13,9 +13,9 @@ 'use strict'; +const QueryExecutor = require('./QueryExecutor'); const RelayDefaultHandlerProvider = require('../handlers/RelayDefaultHandlerProvider'); const RelayFeatureFlags = require('../util/RelayFeatureFlags'); -const RelayModernQueryExecutor = require('./RelayModernQueryExecutor'); const RelayObservable = require('../network/RelayObservable'); const RelayOperationTracker = require('../store/RelayOperationTracker'); const RelayPublishQueue = require('./RelayPublishQueue'); @@ -40,8 +40,7 @@ import type { RenderPolicy, Variables, } from '../util/RelayRuntimeTypes'; -import type {ActiveState} from './RelayModernQueryExecutor'; -import type {TaskScheduler} from './RelayModernQueryExecutor'; +import type {ActiveState, TaskScheduler} from './QueryExecutor'; import type {GetDataID} from './RelayResponseNormalizer'; import type { IEnvironment, @@ -242,7 +241,7 @@ class RelayModernEnvironment implements IEnvironment { applyMutation(optimisticConfig: OptimisticResponseConfig): Disposable { const subscription = RelayObservable.create(sink => { const source = RelayObservable.create(_sink => {}); - const executor = RelayModernQueryExecutor.execute({ + const executor = QueryExecutor.execute({ operation: optimisticConfig.operation, operationExecutions: this._operationExecutions, operationLoader: this._operationLoader, @@ -282,7 +281,7 @@ class RelayModernEnvironment implements IEnvironment { commitPayload(operation: OperationDescriptor, payload: PayloadData): void { RelayObservable.create(sink => { - const executor = RelayModernQueryExecutor.execute({ + const executor = QueryExecutor.execute({ operation: operation, operationExecutions: this._operationExecutions, operationLoader: this._operationLoader, @@ -379,7 +378,7 @@ class RelayModernEnvironment implements IEnvironment { operation.request.cacheConfig || {}, null, ); - const executor = RelayModernQueryExecutor.execute({ + const executor = QueryExecutor.execute({ operation, operationExecutions: this._operationExecutions, operationLoader: this._operationLoader, @@ -442,7 +441,7 @@ class RelayModernEnvironment implements IEnvironment { }, uploadables, ); - const executor = RelayModernQueryExecutor.execute({ + const executor = QueryExecutor.execute({ operation, operationExecutions: this._operationExecutions, operationLoader: this._operationLoader, @@ -481,7 +480,7 @@ class RelayModernEnvironment implements IEnvironment { source: RelayObservable, |}): RelayObservable { return RelayObservable.create(sink => { - const executor = RelayModernQueryExecutor.execute({ + const executor = QueryExecutor.execute({ operation, operationExecutions: this._operationExecutions, operationLoader: this._operationLoader,