relay-runtime 0.0.0-main-6e8b52f6 → 0.0.0-main-764af24d
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/index.js.flow +2 -0
- package/lib/mutations/readUpdatableQuery_EXPERIMENTAL.js +3 -4
- package/lib/query/GraphQLTag.js +13 -0
- package/lib/util/RelayConcreteNode.js +1 -0
- package/mutations/RelayRecordSourceProxy.js.flow +7 -3
- package/mutations/RelayRecordSourceSelectorProxy.js.flow +7 -3
- package/mutations/readUpdatableQuery_EXPERIMENTAL.js.flow +14 -12
- package/package.json +1 -1
- package/query/GraphQLTag.js.flow +38 -3
- package/relay-runtime.js +2 -2
- package/relay-runtime.min.js +2 -2
- package/store/RelayStoreTypes.js.flow +4 -3
- package/util/RelayConcreteNode.js.flow +8 -1
- package/util/RelayRuntimeTypes.js.flow +20 -1
|
@@ -44,8 +44,9 @@ import type {
|
|
|
44
44
|
CacheConfig,
|
|
45
45
|
DataID,
|
|
46
46
|
Disposable,
|
|
47
|
-
OperationType,
|
|
48
47
|
RenderPolicy,
|
|
48
|
+
UpdatableQuery,
|
|
49
|
+
UpdatableQueryType,
|
|
49
50
|
Variables,
|
|
50
51
|
} from '../util/RelayRuntimeTypes';
|
|
51
52
|
import type {InvalidationState} from './RelayModernStore';
|
|
@@ -466,8 +467,8 @@ export interface RecordSourceProxy {
|
|
|
466
467
|
get(dataID: DataID): ?RecordProxy;
|
|
467
468
|
getRoot(): RecordProxy;
|
|
468
469
|
invalidateStore(): void;
|
|
469
|
-
readUpdatableQuery_EXPERIMENTAL<TQuery:
|
|
470
|
-
query:
|
|
470
|
+
readUpdatableQuery_EXPERIMENTAL<TQuery: UpdatableQueryType>(
|
|
471
|
+
query: UpdatableQuery<TQuery['variables'], TQuery['response']>,
|
|
471
472
|
variables: TQuery['variables'],
|
|
472
473
|
): TQuery['response'];
|
|
473
474
|
}
|
|
@@ -31,6 +31,11 @@ export type ConcreteRequest = {|
|
|
|
31
31
|
+params: RequestParameters,
|
|
32
32
|
|};
|
|
33
33
|
|
|
34
|
+
export type ConcreteUpdatableQuery = {|
|
|
35
|
+
+kind: 'UpdatableQuery',
|
|
36
|
+
+fragment: ReaderFragment,
|
|
37
|
+
|};
|
|
38
|
+
|
|
34
39
|
export type NormalizationRootNode =
|
|
35
40
|
| ConcreteRequest
|
|
36
41
|
| NormalizationSplitOperation;
|
|
@@ -68,7 +73,8 @@ export type GeneratedNode =
|
|
|
68
73
|
| ConcreteRequest
|
|
69
74
|
| ReaderFragment
|
|
70
75
|
| ReaderInlineDataFragment
|
|
71
|
-
| NormalizationSplitOperation
|
|
76
|
+
| NormalizationSplitOperation
|
|
77
|
+
| ConcreteUpdatableQuery;
|
|
72
78
|
|
|
73
79
|
const RelayConcreteNode = {
|
|
74
80
|
ACTOR_CHANGE: 'ActorChange',
|
|
@@ -101,6 +107,7 @@ const RelayConcreteNode = {
|
|
|
101
107
|
SPLIT_OPERATION: 'SplitOperation',
|
|
102
108
|
STREAM: 'Stream',
|
|
103
109
|
TYPE_DISCRIMINATOR: 'TypeDiscriminator',
|
|
110
|
+
UPDATABLE_QUERY: 'UpdatableQuery',
|
|
104
111
|
VARIABLE: 'Variable',
|
|
105
112
|
};
|
|
106
113
|
|
|
@@ -17,7 +17,10 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import type {ReaderFragment, ReaderInlineDataFragment} from './ReaderNode';
|
|
20
|
-
import type {
|
|
20
|
+
import type {
|
|
21
|
+
ConcreteRequest,
|
|
22
|
+
ConcreteUpdatableQuery,
|
|
23
|
+
} from './RelayConcreteNode';
|
|
21
24
|
|
|
22
25
|
/**
|
|
23
26
|
* Represents any resource that must be explicitly disposed of. The most common
|
|
@@ -41,6 +44,14 @@ export type OperationType = {|
|
|
|
41
44
|
+rawResponse?: {...},
|
|
42
45
|
|};
|
|
43
46
|
|
|
47
|
+
/**
|
|
48
|
+
* Generated updatable query flow types are subtypes of this.
|
|
49
|
+
*/
|
|
50
|
+
export type UpdatableQueryType = {|
|
|
51
|
+
+variables: Variables,
|
|
52
|
+
+response: mixed,
|
|
53
|
+
|};
|
|
54
|
+
|
|
44
55
|
export type VariablesOf<T: OperationType> = T['variables'];
|
|
45
56
|
|
|
46
57
|
/**
|
|
@@ -84,6 +95,14 @@ declare export opaque type Operation<
|
|
|
84
95
|
TRawResponse,
|
|
85
96
|
>: ConcreteRequest;
|
|
86
97
|
|
|
98
|
+
/**
|
|
99
|
+
* Return type of graphql tag literals for updatable queries.
|
|
100
|
+
*/
|
|
101
|
+
declare export opaque type UpdatableQuery<
|
|
102
|
+
-TVariables: Variables,
|
|
103
|
+
+TData,
|
|
104
|
+
>: ConcreteUpdatableQuery;
|
|
105
|
+
|
|
87
106
|
/**
|
|
88
107
|
* Return type of graphql tag literals for queries.
|
|
89
108
|
*/
|