react-relay 20.1.1 → 21.0.1
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/ReactRelayContext.js +1 -1
- package/ReactRelayContext.js.flow +2 -2
- package/ReactRelayFragmentContainer.js.flow +8 -9
- package/ReactRelayLocalQueryRenderer.js.flow +11 -3
- package/ReactRelayLoggingContext.js.flow +3 -3
- package/ReactRelayPaginationContainer.js.flow +32 -25
- package/ReactRelayQueryFetcher.js.flow +1 -1
- package/ReactRelayQueryRenderer.js.flow +2 -2
- package/ReactRelayQueryRendererContext.js.flow +2 -2
- package/ReactRelayRefetchContainer.js.flow +17 -14
- package/ReactRelayTestMocker.js.flow +10 -10
- package/ReactRelayTypes.d.ts +377 -0
- package/ReactRelayTypes.js.flow +47 -43
- package/RelayContext.js.flow +3 -3
- package/__flowtests__/ReactRelayFragmentContainer-flowtest.js.flow +11 -11
- package/__flowtests__/ReactRelayPaginationContainer-flowtest.js.flow +5 -5
- package/__flowtests__/ReactRelayRefetchContainer-flowtest.js.flow +5 -5
- package/__flowtests__/RelayModern-flowtest.js.flow +32 -32
- package/__flowtests__/RelayModernFlowtest_users.graphql.js.flow +1 -1
- package/__flowtests__/__generated__/ReactRelayFragmentContainerFlowtest_viewer.graphql.js.flow +3 -4
- package/__flowtests__/__generated__/ReactRelayFragmentContainerFlowtest_viewer2.graphql.js.flow +3 -4
- package/__flowtests__/__generated__/ReactRelayPaginationContainerFlowtestQuery.graphql.js.flow +9 -10
- package/__flowtests__/__generated__/ReactRelayPaginationContainerFlowtest_viewer.graphql.js.flow +4 -5
- package/__flowtests__/__generated__/ReactRelayRefetchContainerFlowtestQuery.graphql.js.flow +9 -10
- package/__flowtests__/__generated__/ReactRelayRefetchContainerFlowtest_viewer.graphql.js.flow +4 -5
- package/__flowtests__/__generated__/RelayModernFlowtest_badref.graphql.js.flow +3 -4
- package/__flowtests__/__generated__/RelayModernFlowtest_notref.graphql.js.flow +3 -4
- package/__flowtests__/__generated__/RelayModernFlowtest_user.graphql.js.flow +3 -4
- package/__flowtests__/__generated__/RelayModernFlowtest_users.graphql.js.flow +5 -6
- package/buildReactRelayContainer.js.flow +5 -5
- package/getRootVariablesForFragments.js.flow +1 -1
- package/hooks.d.ts +89 -0
- package/hooks.js +1 -1
- package/hooks.js.flow +23 -8
- package/index.d.ts +9 -0
- package/index.js +1 -1
- package/index.js.flow +40 -14
- package/isRelayEnvironment.js.flow +1 -1
- package/jest-react/internalAct.js.flow +1 -1
- package/legacy.d.ts +143 -0
- package/legacy.js +1 -1
- package/legacy.js.flow +32 -13
- package/lib/ReactRelayFragmentContainer.js +1 -1
- package/lib/ReactRelayPaginationContainer.js +8 -8
- package/lib/ReactRelayRefetchContainer.js +8 -8
- package/lib/ReactRelayTestMocker.js +5 -5
- package/lib/hooks.js +18 -8
- package/lib/index.js +30 -14
- package/lib/legacy.js +26 -13
- package/lib/relay-hooks/legacy/useBlockingPaginationFragment.js +5 -5
- package/lib/relay-hooks/legacy/useRefetchableFragmentNode.js +34 -34
- package/lib/relay-hooks/loadEntryPoint.js +2 -2
- package/lib/relay-hooks/loadQuery.js +14 -14
- package/lib/relay-hooks/preloadQuery_DEPRECATED.js +10 -10
- package/lib/relay-hooks/readFragmentInternal.js +6 -6
- package/lib/relay-hooks/rsc/serverFetchQuery.js +20 -0
- package/lib/relay-hooks/rsc/serverPreloadQuery.js +31 -0
- package/lib/relay-hooks/rsc/serverReadFragment.js +15 -0
- package/lib/relay-hooks/rsc/useQueryFromServer.js +62 -0
- package/lib/relay-hooks/useFragmentInternal_CURRENT.js +49 -25
- package/lib/relay-hooks/useFragmentInternal_EXPERIMENTAL.js +81 -44
- package/lib/relay-hooks/useLazyLoadQueryNode.js +32 -19
- package/lib/relay-hooks/useMutation.js +6 -14
- package/lib/relay-hooks/useMutationAction_EXPERIMENTAL.js +26 -0
- package/lib/relay-hooks/usePreloadedQuery.js +52 -47
- package/lib/relay-hooks/useQueryLoader.js +2 -2
- package/lib/relay-hooks/useQueryLoader_EXPERIMENTAL.js +2 -2
- package/lib/relay-hooks/useRefetchableFragmentInternal.js +31 -31
- package/lib/rsc-client_EXPERIMENTAL.js +7 -0
- package/lib/rsc_EXPERIMENTAL.js +43 -0
- package/multi-actor/ActorChange.js.flow +1 -1
- package/package.json +3 -2
- package/relay-hooks/EntryPointContainer.react.d.ts +22 -0
- package/relay-hooks/EntryPointContainer.react.js.flow +6 -6
- package/relay-hooks/EntryPointTypes.flow.js.flow +106 -108
- package/relay-hooks/LazyLoadEntryPointContainer_DEPRECATED.react.js.flow +23 -21
- package/relay-hooks/MatchContainer.d.ts +95 -0
- package/relay-hooks/MatchContainer.js.flow +17 -11
- package/relay-hooks/NestedRelayEntryPointBuilderUtils.js.flow +3 -9
- package/relay-hooks/ProfilerContext.d.ts +18 -0
- package/relay-hooks/QueryResource.js.flow +9 -9
- package/relay-hooks/RelayEnvironmentProvider.d.ts +16 -0
- package/relay-hooks/RelayEnvironmentProvider.js.flow +2 -2
- package/relay-hooks/__flowtests__/EntryPointTypes/EntryPointElementConfig-flowtest.js.flow +6 -6
- package/relay-hooks/__flowtests__/EntryPointTypes/ExtractQueryTypes-flowtest.js.flow +50 -3
- package/relay-hooks/__flowtests__/EntryPointTypes/NestedEntrypoints-flowtest.js.flow +9 -9
- package/relay-hooks/__flowtests__/__generated__/useFragmentFlowtest_user.graphql.js.flow +3 -4
- package/relay-hooks/__flowtests__/__generated__/useFragmentFlowtest_users.graphql.js.flow +5 -6
- package/relay-hooks/__flowtests__/useBlockingPaginationFragment-flowtest.js.flow +27 -32
- package/relay-hooks/__flowtests__/useFragment-flowtest.js.flow +25 -25
- package/relay-hooks/__flowtests__/usePaginationFragment-flowtest.js.flow +26 -32
- package/relay-hooks/__flowtests__/useRefetchableFragment-flowtest.js.flow +23 -30
- package/relay-hooks/__flowtests__/utils.js.flow +17 -17
- package/relay-hooks/getConnectionState.js.flow +2 -2
- package/relay-hooks/legacy/FragmentResource.js.flow +13 -13
- package/relay-hooks/legacy/useBlockingPaginationFragment.js.flow +28 -25
- package/relay-hooks/legacy/useFragmentNode.js.flow +4 -4
- package/relay-hooks/legacy/useRefetchableFragmentNode.js.flow +79 -81
- package/relay-hooks/loadEntryPoint.d.ts +14 -0
- package/relay-hooks/loadEntryPoint.js.flow +15 -13
- package/relay-hooks/loadQuery.d.ts +20 -0
- package/relay-hooks/loadQuery.js.flow +19 -19
- package/relay-hooks/preloadQuery_DEPRECATED.js.flow +16 -13
- package/relay-hooks/prepareEntryPoint_DEPRECATED.js.flow +7 -7
- package/relay-hooks/readFragmentInternal.js.flow +11 -11
- package/relay-hooks/rsc/serverFetchQuery.js.flow +31 -0
- package/relay-hooks/rsc/serverPreloadQuery.js.flow +69 -0
- package/relay-hooks/rsc/serverReadFragment.js.flow +33 -0
- package/relay-hooks/rsc/useQueryFromServer.js.flow +135 -0
- package/relay-hooks/useClientQuery.d.ts +16 -0
- package/relay-hooks/useClientQuery.js.flow +2 -2
- package/relay-hooks/useEntryPointLoader.d.ts +21 -0
- package/relay-hooks/useEntryPointLoader.js.flow +11 -11
- package/relay-hooks/useFragment.d.ts +36 -0
- package/relay-hooks/useFragment.js.flow +8 -8
- package/relay-hooks/useFragmentInternal.js.flow +1 -1
- package/relay-hooks/useFragmentInternal_CURRENT.js.flow +54 -22
- package/relay-hooks/useFragmentInternal_EXPERIMENTAL.js.flow +95 -46
- package/relay-hooks/useIsOperationNodeActive.js.flow +1 -1
- package/relay-hooks/useIsParentQueryActive.js.flow +5 -1
- package/relay-hooks/useLazyLoadQuery.d.ts +19 -0
- package/relay-hooks/useLazyLoadQuery.js.flow +14 -7
- package/relay-hooks/useLazyLoadQueryNode.js.flow +67 -28
- package/relay-hooks/useLoadMoreFunction.d.ts +56 -0
- package/relay-hooks/useLoadMoreFunction.js.flow +7 -6
- package/relay-hooks/useLoadMoreFunction_EXPERIMENTAL.js.flow +5 -5
- package/relay-hooks/useMemoVariables.js.flow +1 -1
- package/relay-hooks/useMutation.d.ts +36 -0
- package/relay-hooks/useMutation.js.flow +9 -17
- package/relay-hooks/useMutationAction_EXPERIMENTAL.js.flow +68 -0
- package/relay-hooks/usePaginationFragment.d.ts +33 -0
- package/relay-hooks/usePaginationFragment.js.flow +19 -11
- package/relay-hooks/usePrefetchableForwardPaginationFragment.js.flow +23 -18
- package/relay-hooks/usePrefetchableForwardPaginationFragment_EXPERIMENTAL.js.flow +23 -18
- package/relay-hooks/usePreloadedQuery.d.ts +17 -0
- package/relay-hooks/usePreloadedQuery.js.flow +119 -85
- package/relay-hooks/useQueryLoader.d.ts +33 -0
- package/relay-hooks/useQueryLoader.js.flow +28 -24
- package/relay-hooks/useQueryLoader_EXPERIMENTAL.js.flow +10 -10
- package/relay-hooks/useRefetchableFragment.d.ts +23 -0
- package/relay-hooks/useRefetchableFragment.js.flow +20 -11
- package/relay-hooks/useRefetchableFragmentInternal.js.flow +77 -79
- package/relay-hooks/useRelayEnvironment.d.ts +10 -0
- package/relay-hooks/useRelayLoggingContext.js.flow +1 -1
- package/relay-hooks/useSubscribeToInvalidationState.d.ts +19 -0
- package/relay-hooks/useSubscribeToInvalidationState.js.flow +1 -1
- package/relay-hooks/useSubscription.d.ts +14 -0
- package/relay-hooks/useSubscription.js.flow +1 -1
- package/rsc-client_EXPERIMENTAL.d.ts +17 -0
- package/rsc-client_EXPERIMENTAL.js +10 -0
- package/rsc-client_EXPERIMENTAL.js.flow +23 -0
- package/rsc_EXPERIMENTAL.d.ts +48 -0
- package/rsc_EXPERIMENTAL.js +10 -0
- package/rsc_EXPERIMENTAL.js.flow +90 -0
|
@@ -38,10 +38,10 @@ class FooComponent extends React.Component<$FlowFixMe> {
|
|
|
38
38
|
const reqLen = this.props.requiredProp.length;
|
|
39
39
|
const optionalProp = this.props.optionalProp;
|
|
40
40
|
|
|
41
|
-
/** $FlowExpectedError: `optionalProp` might be null **/
|
|
41
|
+
/** $FlowExpectedError[incompatible-use] : `optionalProp` might be null **/
|
|
42
42
|
const optionalFoo = this.props.optionalProp.foo;
|
|
43
43
|
|
|
44
|
-
/** $FlowExpectedError: there is no prop `missingProp` **/
|
|
44
|
+
/** $FlowExpectedError[prop-missing] : there is no prop `missingProp` **/
|
|
45
45
|
const missing = this.props.missingProp;
|
|
46
46
|
|
|
47
47
|
const defLen = this.props.defaultProp.length; // always a valid string, so no error
|
|
@@ -123,7 +123,7 @@ module.exports = {
|
|
|
123
123
|
return <Foo {...props} />;
|
|
124
124
|
},
|
|
125
125
|
checkStaticsAndMethodsProxying(): React.Node {
|
|
126
|
-
/* $FlowFixMe(>=0.53.0) This comment suppresses an
|
|
126
|
+
/* $FlowFixMe[missing-type-arg](>=0.53.0) This comment suppresses an
|
|
127
127
|
* error when upgrading Flow's support for React. Common errors found when
|
|
128
128
|
* upgrading Flow's React support are documented at
|
|
129
129
|
* https://fburl.com/eq7bs81w */
|
|
@@ -132,10 +132,10 @@ module.exports = {
|
|
|
132
132
|
getString(): string {
|
|
133
133
|
const ok = this._fooRef ? this._fooRef.getNum() : 'default'; // legit
|
|
134
134
|
|
|
135
|
-
/** $FlowExpectedError: Foo does not have `missingMethod` **/
|
|
135
|
+
/** $FlowExpectedError[prop-missing] : Foo does not have `missingMethod` **/
|
|
136
136
|
const bad = this._fooRef ? this._fooRef.missingMethod() : 'default';
|
|
137
137
|
|
|
138
|
-
/** $FlowExpectedError: Foo `getNum` gives number, but `getString` assumes string **/
|
|
138
|
+
/** $FlowExpectedError[incompatible-type] : Foo `getNum` gives number, but `getString` assumes string **/
|
|
139
139
|
return bad ? 'not good' : ok;
|
|
140
140
|
}
|
|
141
141
|
render(): React.Node {
|
|
@@ -54,10 +54,10 @@ class BadReferenceTest_ extends React.Component<{
|
|
|
54
54
|
...
|
|
55
55
|
}> {
|
|
56
56
|
render(): React.Node {
|
|
57
|
-
|
|
58
|
-
// $FlowExpectedError
|
|
57
|
+
this.props.badref.id as string;
|
|
58
|
+
// $FlowExpectedError[prop-missing]
|
|
59
59
|
this.props.badref.name;
|
|
60
|
-
// $FlowExpectedError
|
|
60
|
+
// $FlowExpectedError[incompatible-type] The notref fragment was not used.
|
|
61
61
|
return <NotReferencedTest notref={this.props.badref} />;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -85,13 +85,13 @@ class SingularTest extends React.Component<{
|
|
|
85
85
|
...
|
|
86
86
|
}> {
|
|
87
87
|
render(): React.Node {
|
|
88
|
-
|
|
89
|
-
// $FlowExpectedError
|
|
88
|
+
nullthrows(this.props.user.name) as string;
|
|
89
|
+
// $FlowExpectedError[incompatible-use]
|
|
90
90
|
this.props.nullableUser.name;
|
|
91
|
-
// $FlowExpectedError
|
|
91
|
+
// $FlowExpectedError[incompatible-use]
|
|
92
92
|
this.props.optionalUser.name;
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
nullthrows(nullthrows(this.props.nullableUser).name) as string;
|
|
94
|
+
nullthrows(nullthrows(this.props.optionalUser).name) as string;
|
|
95
95
|
return null;
|
|
96
96
|
}
|
|
97
97
|
}
|
|
@@ -111,10 +111,9 @@ class PluralTest extends React.Component<{
|
|
|
111
111
|
}> {
|
|
112
112
|
render(): React.Node {
|
|
113
113
|
const names = this.props.users.map(user => user.name).filter(Boolean);
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
(names: Array<number>);
|
|
114
|
+
names as Array<string>;
|
|
115
|
+
// $FlowExpectedError[incompatible-type]
|
|
116
|
+
names as Array<number>;
|
|
118
117
|
return null;
|
|
119
118
|
}
|
|
120
119
|
}
|
|
@@ -127,22 +126,22 @@ const PluralTestFragment = createFragmentContainer(PluralTest, {
|
|
|
127
126
|
});
|
|
128
127
|
|
|
129
128
|
declare var aUserRef: {
|
|
130
|
-
|
|
129
|
+
readonly $fragmentSpreads: RelayModernFlowtest_user$ref,
|
|
131
130
|
...
|
|
132
131
|
};
|
|
133
132
|
|
|
134
133
|
declare var oneOfUsersRef: {
|
|
135
|
-
|
|
134
|
+
readonly $fragmentSpreads: RelayModernFlowtest_users$ref,
|
|
136
135
|
...
|
|
137
136
|
};
|
|
138
137
|
|
|
139
|
-
declare var usersRef:
|
|
140
|
-
|
|
138
|
+
declare var usersRef: ReadonlyArray<{
|
|
139
|
+
readonly $fragmentSpreads: RelayModernFlowtest_users$ref,
|
|
141
140
|
...
|
|
142
141
|
}>;
|
|
143
142
|
|
|
144
143
|
declare var nonUserRef: {
|
|
145
|
-
|
|
144
|
+
readonly $fragmentSpreads: {thing: true, ...},
|
|
146
145
|
...
|
|
147
146
|
};
|
|
148
147
|
|
|
@@ -151,21 +150,21 @@ function cb(): void {}
|
|
|
151
150
|
<SingularTestFragment
|
|
152
151
|
onClick={cb}
|
|
153
152
|
string="x"
|
|
154
|
-
// $FlowExpectedError
|
|
153
|
+
// $FlowExpectedError[incompatible-type] - can't pass null for user
|
|
155
154
|
user={null}
|
|
156
155
|
nullableUser={null}
|
|
157
156
|
/>;
|
|
158
|
-
// $FlowExpectedError
|
|
157
|
+
// $FlowExpectedError[incompatible-type] - user is required
|
|
159
158
|
<SingularTestFragment onClick={cb} string="x" nullableUser={null} />;
|
|
160
159
|
<SingularTestFragment
|
|
161
160
|
onClick={cb}
|
|
162
161
|
string="x"
|
|
163
|
-
// $FlowExpectedError
|
|
162
|
+
// $FlowExpectedError[incompatible-type] - can't pass non-user ref for user
|
|
164
163
|
user={nonUserRef}
|
|
165
164
|
nullableUser={null}
|
|
166
165
|
/>;
|
|
167
166
|
<SingularTestFragment
|
|
168
|
-
// $FlowExpectedError
|
|
167
|
+
// $FlowExpectedError[incompatible-type] - `cb` prop is not a function
|
|
169
168
|
onClick="cb"
|
|
170
169
|
string="x"
|
|
171
170
|
user={aUserRef}
|
|
@@ -173,7 +172,7 @@ function cb(): void {}
|
|
|
173
172
|
/>;
|
|
174
173
|
<SingularTestFragment
|
|
175
174
|
onClick={cb}
|
|
176
|
-
// $FlowExpectedError
|
|
175
|
+
// $FlowExpectedError[incompatible-type] - `string` prop is not a string
|
|
177
176
|
string={1}
|
|
178
177
|
user={aUserRef}
|
|
179
178
|
nullableUser={null}
|
|
@@ -199,17 +198,19 @@ function cb(): void {}
|
|
|
199
198
|
optionalUser={aUserRef}
|
|
200
199
|
/>;
|
|
201
200
|
|
|
202
|
-
// $FlowExpectedError
|
|
201
|
+
// $FlowExpectedError[incompatible-type] - onClick is required
|
|
203
202
|
<SingularTestFragment
|
|
204
203
|
string="x"
|
|
205
204
|
user={aUserRef}
|
|
206
205
|
nullableUser={null}
|
|
207
|
-
// $FlowExpectedError - optional, not nullable!
|
|
208
206
|
optionalUser={null}
|
|
209
207
|
/>;
|
|
210
208
|
|
|
211
209
|
declare var aComplexUserRef: {
|
|
212
|
-
|
|
210
|
+
readonly $fragmentSpreads: {
|
|
211
|
+
thing1: true,
|
|
212
|
+
...
|
|
213
|
+
} & RelayModernFlowtest_user$ref & {
|
|
213
214
|
thing2: true,
|
|
214
215
|
...
|
|
215
216
|
},
|
|
@@ -223,17 +224,17 @@ declare var aComplexUserRef: {
|
|
|
223
224
|
optionalUser={aComplexUserRef}
|
|
224
225
|
/>;
|
|
225
226
|
|
|
226
|
-
// $FlowExpectedError
|
|
227
|
+
// $FlowExpectedError[incompatible-type] - can't pass null for user
|
|
227
228
|
<PluralTestFragment users={null} nullableUsers={null} />;
|
|
228
|
-
// $FlowExpectedError
|
|
229
|
+
// $FlowExpectedError[incompatible-type] - users is required
|
|
229
230
|
<PluralTestFragment nullableUsers={null} />;
|
|
230
|
-
// $FlowExpectedError
|
|
231
|
+
// $FlowExpectedError[incompatible-type] - can't pass non-user refs for user
|
|
231
232
|
<PluralTestFragment users={[nonUserRef]} nullableUsers={null} />;
|
|
232
233
|
|
|
233
234
|
<PluralTestFragment users={usersRef} nullableUsers={null} />;
|
|
234
235
|
|
|
235
236
|
<PluralTestFragment
|
|
236
|
-
users={
|
|
237
|
+
users={[oneOfUsersRef] as Array<typeof oneOfUsersRef>}
|
|
237
238
|
nullableUsers={null}
|
|
238
239
|
/>;
|
|
239
240
|
<PluralTestFragment users={[oneOfUsersRef]} nullableUsers={null} />;
|
|
@@ -247,7 +248,6 @@ declare var aComplexUserRef: {
|
|
|
247
248
|
<PluralTestFragment
|
|
248
249
|
users={usersRef}
|
|
249
250
|
nullableUsers={null}
|
|
250
|
-
// $FlowExpectedError - optional, not nullable!
|
|
251
251
|
optionalUsers={null}
|
|
252
252
|
/>;
|
|
253
253
|
|
|
@@ -259,7 +259,7 @@ const AnyTestContainer = createFragmentContainer(AnyTest, {});
|
|
|
259
259
|
<AnyTestContainer anything={42} />;
|
|
260
260
|
<AnyTestContainer anything={null} />;
|
|
261
261
|
<AnyTestContainer anything={() => {}} />;
|
|
262
|
-
// $FlowExpectedError
|
|
262
|
+
// $FlowExpectedError[incompatible-type] - any other prop can not be passed
|
|
263
263
|
<AnyTestContainer anything={null} anythingElse={42} />;
|
|
264
|
-
// $FlowExpectedError
|
|
264
|
+
// $FlowExpectedError[incompatible-type] - anything has to be passed
|
|
265
265
|
<AnyTestContainer />;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
import type {FragmentType} from 'relay-runtime';
|
|
15
15
|
|
|
16
16
|
declare export opaque type RelayModernFlowtest_users$ref: FragmentType;
|
|
17
|
-
export type RelayModernFlowtest_users =
|
|
17
|
+
export type RelayModernFlowtest_users = ReadonlyArray<{
|
|
18
18
|
+name: ?string,
|
|
19
19
|
+$fragmentType: RelayModernFlowtest_users$ref,
|
|
20
20
|
}>;
|
package/__flowtests__/__generated__/ReactRelayFragmentContainerFlowtest_viewer.graphql.js.flow
CHANGED
|
@@ -6,10 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @oncall relay
|
|
8
8
|
*
|
|
9
|
-
* @generated SignedSource<<
|
|
9
|
+
* @generated SignedSource<<2034f0572b67fa53eeb04dcd78545d61>>
|
|
10
10
|
* @flow
|
|
11
11
|
* @lightSyntaxTransform
|
|
12
|
-
* @nogrep
|
|
13
12
|
*/
|
|
14
13
|
|
|
15
14
|
/* eslint-disable */
|
|
@@ -63,10 +62,10 @@ var node/*: ReaderFragment*/ = {
|
|
|
63
62
|
};
|
|
64
63
|
|
|
65
64
|
if (__DEV__) {
|
|
66
|
-
(node
|
|
65
|
+
(node/*:: as any*/).hash = "75147ebd599fe1c406f2dfc7abb164f8";
|
|
67
66
|
}
|
|
68
67
|
|
|
69
|
-
module.exports = ((node
|
|
68
|
+
module.exports = ((node/*:: as any*/)/*:: as Fragment<
|
|
70
69
|
ReactRelayFragmentContainerFlowtest_viewer$fragmentType,
|
|
71
70
|
ReactRelayFragmentContainerFlowtest_viewer$data,
|
|
72
71
|
>*/);
|
package/__flowtests__/__generated__/ReactRelayFragmentContainerFlowtest_viewer2.graphql.js.flow
CHANGED
|
@@ -6,10 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @oncall relay
|
|
8
8
|
*
|
|
9
|
-
* @generated SignedSource<<
|
|
9
|
+
* @generated SignedSource<<aea64ad988451a135fcb765d0cd946c2>>
|
|
10
10
|
* @flow
|
|
11
11
|
* @lightSyntaxTransform
|
|
12
|
-
* @nogrep
|
|
13
12
|
*/
|
|
14
13
|
|
|
15
14
|
/* eslint-disable */
|
|
@@ -63,10 +62,10 @@ var node/*: ReaderFragment*/ = {
|
|
|
63
62
|
};
|
|
64
63
|
|
|
65
64
|
if (__DEV__) {
|
|
66
|
-
(node
|
|
65
|
+
(node/*:: as any*/).hash = "0f55965b7c9aca0d661ebdd96c70e384";
|
|
67
66
|
}
|
|
68
67
|
|
|
69
|
-
module.exports = ((node
|
|
68
|
+
module.exports = ((node/*:: as any*/)/*:: as Fragment<
|
|
70
69
|
ReactRelayFragmentContainerFlowtest_viewer2$fragmentType,
|
|
71
70
|
ReactRelayFragmentContainerFlowtest_viewer2$data,
|
|
72
71
|
>*/);
|
package/__flowtests__/__generated__/ReactRelayPaginationContainerFlowtestQuery.graphql.js.flow
CHANGED
|
@@ -6,10 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @oncall relay
|
|
8
8
|
*
|
|
9
|
-
* @generated SignedSource<<
|
|
9
|
+
* @generated SignedSource<<1c9560651db1e7a97aea91331c3d65f8>>
|
|
10
10
|
* @flow
|
|
11
11
|
* @lightSyntaxTransform
|
|
12
|
-
* @nogrep
|
|
13
12
|
*/
|
|
14
13
|
|
|
15
14
|
/* eslint-disable */
|
|
@@ -68,7 +67,7 @@ v2 = {
|
|
|
68
67
|
};
|
|
69
68
|
return {
|
|
70
69
|
"fragment": {
|
|
71
|
-
"argumentDefinitions": (v0
|
|
70
|
+
"argumentDefinitions": (v0/*:: as any*/),
|
|
72
71
|
"kind": "Fragment",
|
|
73
72
|
"metadata": null,
|
|
74
73
|
"name": "ReactRelayPaginationContainerFlowtestQuery",
|
|
@@ -95,7 +94,7 @@ return {
|
|
|
95
94
|
},
|
|
96
95
|
"kind": "Request",
|
|
97
96
|
"operation": {
|
|
98
|
-
"argumentDefinitions": (v0
|
|
97
|
+
"argumentDefinitions": (v0/*:: as any*/),
|
|
99
98
|
"kind": "Operation",
|
|
100
99
|
"name": "ReactRelayPaginationContainerFlowtestQuery",
|
|
101
100
|
"selections": [
|
|
@@ -117,7 +116,7 @@ return {
|
|
|
117
116
|
"selections": [
|
|
118
117
|
{
|
|
119
118
|
"alias": null,
|
|
120
|
-
"args": (v1
|
|
119
|
+
"args": (v1/*:: as any*/),
|
|
121
120
|
"concreteType": "FriendsConnection",
|
|
122
121
|
"kind": "LinkedField",
|
|
123
122
|
"name": "friends",
|
|
@@ -146,7 +145,7 @@ return {
|
|
|
146
145
|
"name": "__typename",
|
|
147
146
|
"storageKey": null
|
|
148
147
|
},
|
|
149
|
-
(v2
|
|
148
|
+
(v2/*:: as any*/)
|
|
150
149
|
],
|
|
151
150
|
"storageKey": null
|
|
152
151
|
},
|
|
@@ -190,14 +189,14 @@ return {
|
|
|
190
189
|
},
|
|
191
190
|
{
|
|
192
191
|
"alias": null,
|
|
193
|
-
"args": (v1
|
|
192
|
+
"args": (v1/*:: as any*/),
|
|
194
193
|
"filters": null,
|
|
195
194
|
"handle": "connection",
|
|
196
195
|
"key": "ReactRelayPaginationContainerFlowtest_viewer__friends",
|
|
197
196
|
"kind": "LinkedHandle",
|
|
198
197
|
"name": "friends"
|
|
199
198
|
},
|
|
200
|
-
(v2
|
|
199
|
+
(v2/*:: as any*/)
|
|
201
200
|
],
|
|
202
201
|
"storageKey": null
|
|
203
202
|
}
|
|
@@ -218,10 +217,10 @@ return {
|
|
|
218
217
|
})();
|
|
219
218
|
|
|
220
219
|
if (__DEV__) {
|
|
221
|
-
(node
|
|
220
|
+
(node/*:: as any*/).hash = "712afeafa1f51bfe391719629a0fcea0";
|
|
222
221
|
}
|
|
223
222
|
|
|
224
|
-
module.exports = ((node
|
|
223
|
+
module.exports = ((node/*:: as any*/)/*:: as Query<
|
|
225
224
|
ReactRelayPaginationContainerFlowtestQuery$variables,
|
|
226
225
|
ReactRelayPaginationContainerFlowtestQuery$data,
|
|
227
226
|
>*/);
|
package/__flowtests__/__generated__/ReactRelayPaginationContainerFlowtest_viewer.graphql.js.flow
CHANGED
|
@@ -6,10 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @oncall relay
|
|
8
8
|
*
|
|
9
|
-
* @generated SignedSource<<
|
|
9
|
+
* @generated SignedSource<<019829c7b1641c9b37e656f022dd56c7>>
|
|
10
10
|
* @flow
|
|
11
11
|
* @lightSyntaxTransform
|
|
12
|
-
* @nogrep
|
|
13
12
|
*/
|
|
14
13
|
|
|
15
14
|
/* eslint-disable */
|
|
@@ -23,7 +22,7 @@ declare export opaque type ReactRelayPaginationContainerFlowtest_viewer$fragment
|
|
|
23
22
|
export type ReactRelayPaginationContainerFlowtest_viewer$data = {|
|
|
24
23
|
+account_user: ?{|
|
|
25
24
|
+friends: ?{|
|
|
26
|
-
+edges:
|
|
25
|
+
+edges: ?ReadonlyArray<?{|
|
|
27
26
|
+node: ?{|
|
|
28
27
|
+__typename: "User",
|
|
29
28
|
|},
|
|
@@ -155,10 +154,10 @@ var node/*: ReaderFragment*/ = {
|
|
|
155
154
|
};
|
|
156
155
|
|
|
157
156
|
if (__DEV__) {
|
|
158
|
-
(node
|
|
157
|
+
(node/*:: as any*/).hash = "0db8995009ebfee6165f6bbaa465d13f";
|
|
159
158
|
}
|
|
160
159
|
|
|
161
|
-
module.exports = ((node
|
|
160
|
+
module.exports = ((node/*:: as any*/)/*:: as Fragment<
|
|
162
161
|
ReactRelayPaginationContainerFlowtest_viewer$fragmentType,
|
|
163
162
|
ReactRelayPaginationContainerFlowtest_viewer$data,
|
|
164
163
|
>*/);
|
|
@@ -6,10 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @oncall relay
|
|
8
8
|
*
|
|
9
|
-
* @generated SignedSource<<
|
|
9
|
+
* @generated SignedSource<<9d4aa8f307189ead66500df17b9f4134>>
|
|
10
10
|
* @flow
|
|
11
11
|
* @lightSyntaxTransform
|
|
12
|
-
* @nogrep
|
|
13
12
|
*/
|
|
14
13
|
|
|
15
14
|
/* eslint-disable */
|
|
@@ -68,7 +67,7 @@ v2 = {
|
|
|
68
67
|
};
|
|
69
68
|
return {
|
|
70
69
|
"fragment": {
|
|
71
|
-
"argumentDefinitions": (v0
|
|
70
|
+
"argumentDefinitions": (v0/*:: as any*/),
|
|
72
71
|
"kind": "Fragment",
|
|
73
72
|
"metadata": null,
|
|
74
73
|
"name": "ReactRelayRefetchContainerFlowtestQuery",
|
|
@@ -95,7 +94,7 @@ return {
|
|
|
95
94
|
},
|
|
96
95
|
"kind": "Request",
|
|
97
96
|
"operation": {
|
|
98
|
-
"argumentDefinitions": (v0
|
|
97
|
+
"argumentDefinitions": (v0/*:: as any*/),
|
|
99
98
|
"kind": "Operation",
|
|
100
99
|
"name": "ReactRelayRefetchContainerFlowtestQuery",
|
|
101
100
|
"selections": [
|
|
@@ -117,7 +116,7 @@ return {
|
|
|
117
116
|
"selections": [
|
|
118
117
|
{
|
|
119
118
|
"alias": null,
|
|
120
|
-
"args": (v1
|
|
119
|
+
"args": (v1/*:: as any*/),
|
|
121
120
|
"concreteType": "FriendsConnection",
|
|
122
121
|
"kind": "LinkedField",
|
|
123
122
|
"name": "friends",
|
|
@@ -146,7 +145,7 @@ return {
|
|
|
146
145
|
"name": "__typename",
|
|
147
146
|
"storageKey": null
|
|
148
147
|
},
|
|
149
|
-
(v2
|
|
148
|
+
(v2/*:: as any*/)
|
|
150
149
|
],
|
|
151
150
|
"storageKey": null
|
|
152
151
|
},
|
|
@@ -190,14 +189,14 @@ return {
|
|
|
190
189
|
},
|
|
191
190
|
{
|
|
192
191
|
"alias": null,
|
|
193
|
-
"args": (v1
|
|
192
|
+
"args": (v1/*:: as any*/),
|
|
194
193
|
"filters": null,
|
|
195
194
|
"handle": "connection",
|
|
196
195
|
"key": "ReactRelayRefetchContainerFlowtest_viewer__friends",
|
|
197
196
|
"kind": "LinkedHandle",
|
|
198
197
|
"name": "friends"
|
|
199
198
|
},
|
|
200
|
-
(v2
|
|
199
|
+
(v2/*:: as any*/)
|
|
201
200
|
],
|
|
202
201
|
"storageKey": null
|
|
203
202
|
}
|
|
@@ -218,10 +217,10 @@ return {
|
|
|
218
217
|
})();
|
|
219
218
|
|
|
220
219
|
if (__DEV__) {
|
|
221
|
-
(node
|
|
220
|
+
(node/*:: as any*/).hash = "ce05ae9de6327d14ff0f3813ec77e594";
|
|
222
221
|
}
|
|
223
222
|
|
|
224
|
-
module.exports = ((node
|
|
223
|
+
module.exports = ((node/*:: as any*/)/*:: as Query<
|
|
225
224
|
ReactRelayRefetchContainerFlowtestQuery$variables,
|
|
226
225
|
ReactRelayRefetchContainerFlowtestQuery$data,
|
|
227
226
|
>*/);
|
package/__flowtests__/__generated__/ReactRelayRefetchContainerFlowtest_viewer.graphql.js.flow
CHANGED
|
@@ -6,10 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @oncall relay
|
|
8
8
|
*
|
|
9
|
-
* @generated SignedSource<<
|
|
9
|
+
* @generated SignedSource<<48593a8ed28fec622cbc4e20e8292494>>
|
|
10
10
|
* @flow
|
|
11
11
|
* @lightSyntaxTransform
|
|
12
|
-
* @nogrep
|
|
13
12
|
*/
|
|
14
13
|
|
|
15
14
|
/* eslint-disable */
|
|
@@ -23,7 +22,7 @@ declare export opaque type ReactRelayRefetchContainerFlowtest_viewer$fragmentTyp
|
|
|
23
22
|
export type ReactRelayRefetchContainerFlowtest_viewer$data = {|
|
|
24
23
|
+account_user: ?{|
|
|
25
24
|
+friends: ?{|
|
|
26
|
-
+edges:
|
|
25
|
+
+edges: ?ReadonlyArray<?{|
|
|
27
26
|
+node: ?{|
|
|
28
27
|
+__typename: "User",
|
|
29
28
|
|},
|
|
@@ -155,10 +154,10 @@ var node/*: ReaderFragment*/ = {
|
|
|
155
154
|
};
|
|
156
155
|
|
|
157
156
|
if (__DEV__) {
|
|
158
|
-
(node
|
|
157
|
+
(node/*:: as any*/).hash = "cf098b4248d8ddfacfc0d356838697bb";
|
|
159
158
|
}
|
|
160
159
|
|
|
161
|
-
module.exports = ((node
|
|
160
|
+
module.exports = ((node/*:: as any*/)/*:: as Fragment<
|
|
162
161
|
ReactRelayRefetchContainerFlowtest_viewer$fragmentType,
|
|
163
162
|
ReactRelayRefetchContainerFlowtest_viewer$data,
|
|
164
163
|
>*/);
|
|
@@ -6,10 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @oncall relay
|
|
8
8
|
*
|
|
9
|
-
* @generated SignedSource<<
|
|
9
|
+
* @generated SignedSource<<2693dada5777cc6dc61cb195adeba6c9>>
|
|
10
10
|
* @flow
|
|
11
11
|
* @lightSyntaxTransform
|
|
12
|
-
* @nogrep
|
|
13
12
|
*/
|
|
14
13
|
|
|
15
14
|
/* eslint-disable */
|
|
@@ -57,10 +56,10 @@ var node/*: ReaderFragment*/ = {
|
|
|
57
56
|
};
|
|
58
57
|
|
|
59
58
|
if (__DEV__) {
|
|
60
|
-
(node
|
|
59
|
+
(node/*:: as any*/).hash = "a04dc2854770919bd070bdc717de7812";
|
|
61
60
|
}
|
|
62
61
|
|
|
63
|
-
module.exports = ((node
|
|
62
|
+
module.exports = ((node/*:: as any*/)/*:: as Fragment<
|
|
64
63
|
RelayModernFlowtest_badref$fragmentType,
|
|
65
64
|
RelayModernFlowtest_badref$data,
|
|
66
65
|
>*/);
|
|
@@ -6,10 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @oncall relay
|
|
8
8
|
*
|
|
9
|
-
* @generated SignedSource<<
|
|
9
|
+
* @generated SignedSource<<ba6e97b77f0002238c6c7810d738d92f>>
|
|
10
10
|
* @flow
|
|
11
11
|
* @lightSyntaxTransform
|
|
12
|
-
* @nogrep
|
|
13
12
|
*/
|
|
14
13
|
|
|
15
14
|
/* eslint-disable */
|
|
@@ -57,10 +56,10 @@ var node/*: ReaderFragment*/ = {
|
|
|
57
56
|
};
|
|
58
57
|
|
|
59
58
|
if (__DEV__) {
|
|
60
|
-
(node
|
|
59
|
+
(node/*:: as any*/).hash = "d61c43d07b2fe8f623c9b84fcdf70ac8";
|
|
61
60
|
}
|
|
62
61
|
|
|
63
|
-
module.exports = ((node
|
|
62
|
+
module.exports = ((node/*:: as any*/)/*:: as Fragment<
|
|
64
63
|
RelayModernFlowtest_notref$fragmentType,
|
|
65
64
|
RelayModernFlowtest_notref$data,
|
|
66
65
|
>*/);
|
|
@@ -6,10 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @oncall relay
|
|
8
8
|
*
|
|
9
|
-
* @generated SignedSource<<
|
|
9
|
+
* @generated SignedSource<<b9581ad468793bb28a69abed562d378c>>
|
|
10
10
|
* @flow
|
|
11
11
|
* @lightSyntaxTransform
|
|
12
|
-
* @nogrep
|
|
13
12
|
*/
|
|
14
13
|
|
|
15
14
|
/* eslint-disable */
|
|
@@ -50,10 +49,10 @@ var node/*: ReaderFragment*/ = {
|
|
|
50
49
|
};
|
|
51
50
|
|
|
52
51
|
if (__DEV__) {
|
|
53
|
-
(node
|
|
52
|
+
(node/*:: as any*/).hash = "18a730295ff54e88446f4f000f5fef7e";
|
|
54
53
|
}
|
|
55
54
|
|
|
56
|
-
module.exports = ((node
|
|
55
|
+
module.exports = ((node/*:: as any*/)/*:: as Fragment<
|
|
57
56
|
RelayModernFlowtest_user$fragmentType,
|
|
58
57
|
RelayModernFlowtest_user$data,
|
|
59
58
|
>*/);
|
|
@@ -6,10 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @oncall relay
|
|
8
8
|
*
|
|
9
|
-
* @generated SignedSource<<
|
|
9
|
+
* @generated SignedSource<<5b479f9774127420b57137125b4efd98>>
|
|
10
10
|
* @flow
|
|
11
11
|
* @lightSyntaxTransform
|
|
12
|
-
* @nogrep
|
|
13
12
|
*/
|
|
14
13
|
|
|
15
14
|
/* eslint-disable */
|
|
@@ -20,11 +19,11 @@
|
|
|
20
19
|
import type { Fragment, ReaderFragment } from 'relay-runtime';
|
|
21
20
|
import type { FragmentType } from "relay-runtime";
|
|
22
21
|
declare export opaque type RelayModernFlowtest_users$fragmentType: FragmentType;
|
|
23
|
-
export type RelayModernFlowtest_users$data =
|
|
22
|
+
export type RelayModernFlowtest_users$data = ReadonlyArray<{|
|
|
24
23
|
+name: ?string,
|
|
25
24
|
+$fragmentType: RelayModernFlowtest_users$fragmentType,
|
|
26
25
|
|}>;
|
|
27
|
-
export type RelayModernFlowtest_users$key =
|
|
26
|
+
export type RelayModernFlowtest_users$key = ReadonlyArray<{
|
|
28
27
|
+$data?: RelayModernFlowtest_users$data,
|
|
29
28
|
+$fragmentSpreads: RelayModernFlowtest_users$fragmentType,
|
|
30
29
|
...
|
|
@@ -52,10 +51,10 @@ var node/*: ReaderFragment*/ = {
|
|
|
52
51
|
};
|
|
53
52
|
|
|
54
53
|
if (__DEV__) {
|
|
55
|
-
(node
|
|
54
|
+
(node/*:: as any*/).hash = "4e6f0e70d48ec58651c17e3150c63d05";
|
|
56
55
|
}
|
|
57
56
|
|
|
58
|
-
module.exports = ((node
|
|
57
|
+
module.exports = ((node/*:: as any*/)/*:: as Fragment<
|
|
59
58
|
RelayModernFlowtest_users$fragmentType,
|
|
60
59
|
RelayModernFlowtest_users$data,
|
|
61
60
|
>*/);
|
|
@@ -36,7 +36,7 @@ type ContainerCreator = (
|
|
|
36
36
|
* Helper to create the Relay HOCs with ref forwarding, setting the displayName
|
|
37
37
|
* and reading the React context.
|
|
38
38
|
*/
|
|
39
|
-
function buildReactRelayContainer<TBase
|
|
39
|
+
function buildReactRelayContainer<TBase extends component(...empty)>(
|
|
40
40
|
ComponentClass: TBase,
|
|
41
41
|
fragmentSpec: GeneratedNodeMap,
|
|
42
42
|
createContainerWithFragments: ContainerCreator,
|
|
@@ -55,8 +55,8 @@ function buildReactRelayContainer<TBase: component(...empty)>(
|
|
|
55
55
|
function ForwardRef(
|
|
56
56
|
props: any,
|
|
57
57
|
ref:
|
|
58
|
-
| ((null | React.ElementRef<TBase>) =>
|
|
59
|
-
| {
|
|
58
|
+
| ((null | React.ElementRef<TBase>) => unknown)
|
|
59
|
+
| {writeonly current: null | React.ElementRef<TBase>, ...},
|
|
60
60
|
) {
|
|
61
61
|
// $FlowFixMe[react-rule-hook]
|
|
62
62
|
const context = useContext(ReactRelayContext);
|
|
@@ -86,11 +86,11 @@ function buildReactRelayContainer<TBase: component(...empty)>(
|
|
|
86
86
|
|
|
87
87
|
if (__DEV__) {
|
|
88
88
|
// Used by RelayModernTestUtils
|
|
89
|
-
(ForwardContainer
|
|
89
|
+
(ForwardContainer as any).__ComponentClass = ComponentClass;
|
|
90
90
|
ForwardContainer.displayName = containerName;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
// $FlowFixMe[incompatible-
|
|
93
|
+
// $FlowFixMe[incompatible-type]
|
|
94
94
|
return ForwardContainer;
|
|
95
95
|
}
|
|
96
96
|
|
|
@@ -15,7 +15,7 @@ import type {FragmentMap, Variables} from 'relay-runtime';
|
|
|
15
15
|
|
|
16
16
|
const {getSelector} = require('relay-runtime');
|
|
17
17
|
|
|
18
|
-
function getRootVariablesForFragments<TProps
|
|
18
|
+
function getRootVariablesForFragments<TProps extends {...}>(
|
|
19
19
|
fragments: FragmentMap,
|
|
20
20
|
props: TProps,
|
|
21
21
|
): Variables {
|