relay-runtime 0.0.0-main-e1456f7f → 0.0.0-main-a29f5d33

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/experimental.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Relay v0.0.0-main-e1456f7f
2
+ * Relay v0.0.0-main-a29f5d33
3
3
  *
4
4
  * Copyright (c) Meta Platforms, Inc. and affiliates.
5
5
  *
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Relay v0.0.0-main-e1456f7f
2
+ * Relay v0.0.0-main-a29f5d33
3
3
  *
4
4
  * Copyright (c) Meta Platforms, Inc. and affiliates.
5
5
  *
@@ -84,6 +84,7 @@ var Executor = /*#__PURE__*/function () {
84
84
  this._seenActors = new Set();
85
85
  this._completeFns = [];
86
86
  this._normalizeResponse = normalizeResponse;
87
+ this._isClientQuery = this._operation.request.node.params.id == null && this._operation.request.node.params.text == null;
87
88
  var id = this._nextSubscriptionId++;
88
89
  if (RelayFeatureFlags.PROCESS_OPTIMISTIC_UPDATE_BEFORE_SUBSCRIPTION && optimisticConfig != null) {
89
90
  this._processOptimisticResponse(optimisticConfig.response != null ? {
@@ -375,6 +376,9 @@ var Executor = /*#__PURE__*/function () {
375
376
  _payloadFollowups.push(payload);
376
377
  this._execTimeResolverResponseComplete = isFinal;
377
378
  if (isFinal) {
379
+ if (this._isClientQuery) {
380
+ this._state = 'loading_final';
381
+ }
378
382
  this._updateActiveState();
379
383
  }
380
384
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "relay-runtime",
3
3
  "description": "A core runtime for building GraphQL-driven applications.",
4
- "version": "0.0.0-main-e1456f7f",
4
+ "version": "0.0.0-main-a29f5d33",
5
5
  "keywords": [
6
6
  "graphql",
7
7
  "relay"
@@ -160,6 +160,7 @@ class Executor<TMutation: MutationParameters> {
160
160
  +_seenActors: Set<ActorIdentifier>;
161
161
  _normalizeResponse: NormalizeResponseFunction;
162
162
  _execTimeResolverResponseComplete: boolean;
163
+ _isClientQuery: boolean;
163
164
 
164
165
  constructor({
165
166
  actorIdentifier,
@@ -218,6 +219,9 @@ class Executor<TMutation: MutationParameters> {
218
219
  this._seenActors = new Set();
219
220
  this._completeFns = [];
220
221
  this._normalizeResponse = normalizeResponse;
222
+ this._isClientQuery =
223
+ this._operation.request.node.params.id == null &&
224
+ this._operation.request.node.params.text == null;
221
225
 
222
226
  const id = this._nextSubscriptionId++;
223
227
 
@@ -590,6 +594,11 @@ class Executor<TMutation: MutationParameters> {
590
594
  if (isFinal) {
591
595
  // Need to update the active state to mark the query as inactive,
592
596
  // incase server payloads have completed
597
+ if (this._isClientQuery) {
598
+ // If it is a client query, there is no server response to set the
599
+ // final state, so we need to set it here
600
+ this._state = 'loading_final';
601
+ }
593
602
  this._updateActiveState();
594
603
  }
595
604
  }