react-relay 20.1.1 → 21.0.0
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 +31 -24
- 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.js.flow +18 -20
- 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 +24 -27
- 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 +4 -4
- package/getRootVariablesForFragments.js.flow +1 -1
- package/hooks.js +1 -1
- package/hooks.js.flow +23 -8
- 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.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.js.flow +6 -6
- package/relay-hooks/EntryPointTypes.flow.js.flow +61 -67
- package/relay-hooks/LazyLoadEntryPointContainer_DEPRECATED.react.js.flow +23 -21
- package/relay-hooks/MatchContainer.js.flow +12 -6
- package/relay-hooks/NestedRelayEntryPointBuilderUtils.js.flow +3 -9
- package/relay-hooks/QueryResource.js.flow +6 -6
- 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 +48 -1
- 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 +4 -4
- package/relay-hooks/getConnectionState.js.flow +2 -2
- package/relay-hooks/legacy/FragmentResource.js.flow +13 -13
- package/relay-hooks/legacy/useBlockingPaginationFragment.js.flow +24 -25
- package/relay-hooks/legacy/useFragmentNode.js.flow +4 -4
- package/relay-hooks/legacy/useRefetchableFragmentNode.js.flow +79 -81
- package/relay-hooks/loadEntryPoint.js.flow +15 -13
- package/relay-hooks/loadQuery.js.flow +18 -18
- package/relay-hooks/preloadQuery_DEPRECATED.js.flow +16 -13
- package/relay-hooks/prepareEntryPoint_DEPRECATED.js.flow +7 -7
- package/relay-hooks/readFragmentInternal.js.flow +9 -9
- 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.js.flow +2 -2
- package/relay-hooks/useEntryPointLoader.js.flow +11 -11
- package/relay-hooks/useFragment.js.flow +7 -7
- 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 +1 -1
- package/relay-hooks/useLazyLoadQuery.js.flow +10 -3
- package/relay-hooks/useLazyLoadQueryNode.js.flow +67 -28
- 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.js.flow +8 -16
- package/relay-hooks/useMutationAction_EXPERIMENTAL.js.flow +68 -0
- package/relay-hooks/usePaginationFragment.js.flow +15 -11
- package/relay-hooks/usePrefetchableForwardPaginationFragment.js.flow +19 -18
- package/relay-hooks/usePrefetchableForwardPaginationFragment_EXPERIMENTAL.js.flow +19 -18
- package/relay-hooks/usePreloadedQuery.js.flow +119 -85
- package/relay-hooks/useQueryLoader.js.flow +27 -23
- package/relay-hooks/useQueryLoader_EXPERIMENTAL.js.flow +10 -10
- package/relay-hooks/useRefetchableFragment.js.flow +16 -11
- package/relay-hooks/useRefetchableFragmentInternal.js.flow +77 -79
- package/relay-hooks/useRelayLoggingContext.js.flow +1 -1
- package/relay-hooks/useSubscribeToInvalidationState.js.flow +1 -1
- package/relay-hooks/useSubscription.js.flow +1 -1
- package/rsc-client_EXPERIMENTAL.js +10 -0
- package/rsc-client_EXPERIMENTAL.js.flow +23 -0
- package/rsc_EXPERIMENTAL.js +10 -0
- package/rsc_EXPERIMENTAL.js.flow +90 -0
|
@@ -54,10 +54,10 @@ class BarComponent extends React.Component<{
|
|
|
54
54
|
const reqLen = this.props.requiredProp.length;
|
|
55
55
|
const optionalProp = this.props.optionalProp;
|
|
56
56
|
|
|
57
|
-
/** $FlowExpectedError: `optionalProp` might be null **/
|
|
57
|
+
/** $FlowExpectedError[incompatible-use] : `optionalProp` might be null **/
|
|
58
58
|
const optionalFoo = this.props.optionalProp.foo;
|
|
59
59
|
|
|
60
|
-
/** $FlowExpectedError: there is no prop `missingProp` **/
|
|
60
|
+
/** $FlowExpectedError[prop-missing] : there is no prop `missingProp` **/
|
|
61
61
|
const missing = this.props.missingProp;
|
|
62
62
|
|
|
63
63
|
const defLen = this.props.defaultProp.length; // always a valid string, so no error
|
|
@@ -78,7 +78,7 @@ const Bar = createFragmentContainer(BarComponent, {
|
|
|
78
78
|
|
|
79
79
|
module.exports = {
|
|
80
80
|
checkMissingPropOnFunctionalComponent(): React.Node {
|
|
81
|
-
/** $FlowExpectedError: Foo missing `requiredProp` **/
|
|
81
|
+
/** $FlowExpectedError[incompatible-type] : Foo missing `requiredProp` **/
|
|
82
82
|
return <Foo />;
|
|
83
83
|
},
|
|
84
84
|
checkMinimalPropsOnFunctionalComponent(): React.Node {
|
|
@@ -86,7 +86,7 @@ module.exports = {
|
|
|
86
86
|
return <Foo requiredProp="foo" />;
|
|
87
87
|
},
|
|
88
88
|
checkMissingPropOnClassComponent(): React.Node {
|
|
89
|
-
/** $FlowExpectedError: Bar missing `requiredProp` **/
|
|
89
|
+
/** $FlowExpectedError[incompatible-type] : Bar missing `requiredProp` **/
|
|
90
90
|
return <Bar />;
|
|
91
91
|
},
|
|
92
92
|
checkMinimalPropsOnClassComponent(): React.Node {
|
|
@@ -94,19 +94,19 @@ module.exports = {
|
|
|
94
94
|
return <Bar requiredProp="foo" />;
|
|
95
95
|
},
|
|
96
96
|
checkWrongPropType(): React.Node {
|
|
97
|
-
/** $FlowExpectedError: Bar wrong `requiredProp` type, should be string **/
|
|
97
|
+
/** $FlowExpectedError[incompatible-type] : Bar wrong `requiredProp` type, should be string **/
|
|
98
98
|
return <Bar requiredProp={17} />;
|
|
99
99
|
},
|
|
100
100
|
checkWrongOptionalType(): React.Node {
|
|
101
|
-
/** $FlowExpectedError: Bar wrong `optionalProp` type, should be `{foo: string}` **/
|
|
101
|
+
/** $FlowExpectedError[incompatible-type] : Bar wrong `optionalProp` type, should be `{foo: string}` **/
|
|
102
102
|
return <Bar optionalProp="wrongType" requiredProp="foo" />;
|
|
103
103
|
},
|
|
104
104
|
checkNullOptionalType(): React.Node {
|
|
105
|
-
/** $FlowExpectedError: Bar `optionalProp` must be omitted or truthy, not null **/
|
|
105
|
+
/** $FlowExpectedError[incompatible-type] : Bar `optionalProp` must be omitted or truthy, not null **/
|
|
106
106
|
return <Bar optionalProp={null} requiredProp="foo" />;
|
|
107
107
|
},
|
|
108
108
|
checkWrongDefaultPropType(): React.Node {
|
|
109
|
-
/** $FlowExpectedError: Bar wrong `defaultProp` type, should be string **/
|
|
109
|
+
/** $FlowExpectedError[incompatible-type] : Bar wrong `defaultProp` type, should be string **/
|
|
110
110
|
return <Bar defaultProp={false} requiredProp="foo" />;
|
|
111
111
|
},
|
|
112
112
|
checkAllPossibleProps(): React.Node {
|
|
@@ -122,7 +122,7 @@ module.exports = {
|
|
|
122
122
|
},
|
|
123
123
|
checkMissingPropSpread(): React.Node {
|
|
124
124
|
const props = {defaultProp: 'foo'};
|
|
125
|
-
/** $FlowExpectedError: Bar missing `requiredProp` with spread **/
|
|
125
|
+
/** $FlowExpectedError[incompatible-type] : Bar missing `requiredProp` with spread **/
|
|
126
126
|
return <Bar {...props} />;
|
|
127
127
|
},
|
|
128
128
|
checkStaticsAndMethodsProxying(): React.Node {
|
|
@@ -131,10 +131,10 @@ module.exports = {
|
|
|
131
131
|
getString(): string {
|
|
132
132
|
const ok = this._barRef ? this._barRef.getNum() : 'default'; // legit
|
|
133
133
|
|
|
134
|
-
/** $FlowExpectedError: Bar does not have `missingMethod` **/
|
|
134
|
+
/** $FlowExpectedError[prop-missing] : Bar does not have `missingMethod` **/
|
|
135
135
|
const bad = this._barRef ? this._barRef.missingMethod() : 'default';
|
|
136
136
|
|
|
137
|
-
/** $FlowExpectedError: Bar `getNum` gives number, but `getString` assumes string **/
|
|
137
|
+
/** $FlowExpectedError[incompatible-type] : Bar `getNum` gives number, but `getString` assumes string **/
|
|
138
138
|
return bad ? 'not good' : ok;
|
|
139
139
|
}
|
|
140
140
|
render(): React.MixedElement {
|
|
@@ -39,10 +39,10 @@ class FooComponent extends React.Component<$FlowFixMe> {
|
|
|
39
39
|
const reqLen = this.props.requiredProp.length;
|
|
40
40
|
const optionalProp = this.props.optionalProp;
|
|
41
41
|
|
|
42
|
-
/** $FlowExpectedError: `optionalProp` might be null **/
|
|
42
|
+
/** $FlowExpectedError[incompatible-use] : `optionalProp` might be null **/
|
|
43
43
|
const optionalFoo = this.props.optionalProp.foo;
|
|
44
44
|
|
|
45
|
-
/** $FlowExpectedError: there is no prop `missingProp` **/
|
|
45
|
+
/** $FlowExpectedError[prop-missing] : there is no prop `missingProp` **/
|
|
46
46
|
const missing = this.props.missingProp;
|
|
47
47
|
|
|
48
48
|
const defLen = this.props.defaultProp.length; // always a valid string, so no error
|
|
@@ -140,7 +140,7 @@ module.exports = {
|
|
|
140
140
|
return <Foo {...props} />;
|
|
141
141
|
},
|
|
142
142
|
checkStaticsAndMethodsProxying(): React.Node {
|
|
143
|
-
/* $FlowFixMe(>=0.53.0) This comment suppresses an
|
|
143
|
+
/* $FlowFixMe[missing-type-arg](>=0.53.0) This comment suppresses an
|
|
144
144
|
* error when upgrading Flow's support for React. Common errors found when
|
|
145
145
|
* upgrading Flow's React support are documented at
|
|
146
146
|
* https://fburl.com/eq7bs81w */
|
|
@@ -149,10 +149,10 @@ module.exports = {
|
|
|
149
149
|
getString(): string {
|
|
150
150
|
const ok = this._fooRef ? this._fooRef.getNum() : 'default'; // legit
|
|
151
151
|
|
|
152
|
-
/** $FlowExpectedError: Foo does not have `missingMethod` **/
|
|
152
|
+
/** $FlowExpectedError[prop-missing] : Foo does not have `missingMethod` **/
|
|
153
153
|
const bad = this._fooRef ? this._fooRef.missingMethod() : 'default';
|
|
154
154
|
|
|
155
|
-
/** $FlowExpectedError: Foo `getNum` gives number, but `getString` assumes string **/
|
|
155
|
+
/** $FlowExpectedError[incompatible-type] : Foo `getNum` gives number, but `getString` assumes string **/
|
|
156
156
|
return bad ? 'not good' : ok;
|
|
157
157
|
}
|
|
158
158
|
render(): React.Node {
|
|
@@ -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
|
}
|
|
@@ -136,7 +135,7 @@ declare var oneOfUsersRef: {
|
|
|
136
135
|
...
|
|
137
136
|
};
|
|
138
137
|
|
|
139
|
-
declare var usersRef:
|
|
138
|
+
declare var usersRef: ReadonlyArray<{
|
|
140
139
|
+$fragmentSpreads: RelayModernFlowtest_users$ref,
|
|
141
140
|
...
|
|
142
141
|
}>;
|
|
@@ -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,12 +198,11 @@ 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
|
|
|
@@ -223,17 +221,17 @@ declare var aComplexUserRef: {
|
|
|
223
221
|
optionalUser={aComplexUserRef}
|
|
224
222
|
/>;
|
|
225
223
|
|
|
226
|
-
// $FlowExpectedError
|
|
224
|
+
// $FlowExpectedError[incompatible-type] - can't pass null for user
|
|
227
225
|
<PluralTestFragment users={null} nullableUsers={null} />;
|
|
228
|
-
// $FlowExpectedError
|
|
226
|
+
// $FlowExpectedError[incompatible-type] - users is required
|
|
229
227
|
<PluralTestFragment nullableUsers={null} />;
|
|
230
|
-
// $FlowExpectedError
|
|
228
|
+
// $FlowExpectedError[incompatible-type] - can't pass non-user refs for user
|
|
231
229
|
<PluralTestFragment users={[nonUserRef]} nullableUsers={null} />;
|
|
232
230
|
|
|
233
231
|
<PluralTestFragment users={usersRef} nullableUsers={null} />;
|
|
234
232
|
|
|
235
233
|
<PluralTestFragment
|
|
236
|
-
users={
|
|
234
|
+
users={[oneOfUsersRef] as Array<typeof oneOfUsersRef>}
|
|
237
235
|
nullableUsers={null}
|
|
238
236
|
/>;
|
|
239
237
|
<PluralTestFragment users={[oneOfUsersRef]} nullableUsers={null} />;
|
|
@@ -247,7 +245,6 @@ declare var aComplexUserRef: {
|
|
|
247
245
|
<PluralTestFragment
|
|
248
246
|
users={usersRef}
|
|
249
247
|
nullableUsers={null}
|
|
250
|
-
// $FlowExpectedError - optional, not nullable!
|
|
251
248
|
optionalUsers={null}
|
|
252
249
|
/>;
|
|
253
250
|
|
|
@@ -259,7 +256,7 @@ const AnyTestContainer = createFragmentContainer(AnyTest, {});
|
|
|
259
256
|
<AnyTestContainer anything={42} />;
|
|
260
257
|
<AnyTestContainer anything={null} />;
|
|
261
258
|
<AnyTestContainer anything={() => {}} />;
|
|
262
|
-
// $FlowExpectedError
|
|
259
|
+
// $FlowExpectedError[incompatible-type] - any other prop can not be passed
|
|
263
260
|
<AnyTestContainer anything={null} anythingElse={42} />;
|
|
264
|
-
// $FlowExpectedError
|
|
261
|
+
// $FlowExpectedError[incompatible-type] - anything has to be passed
|
|
265
262
|
<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
|
>*/);
|