react-relay 0.0.0-main-e5365883 → 0.0.0-main-7b0eeb0d
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/__flowtests__/RelayModern-flowtest.js.flow +0 -3
- package/hooks.js +1 -1
- package/index.js +1 -1
- package/legacy.js +1 -1
- package/package.json +2 -2
- package/relay-hooks/__flowtests__/useBlockingPaginationFragment-flowtest.js.flow +5 -10
- package/relay-hooks/__flowtests__/usePaginationFragment-flowtest.js.flow +5 -11
- package/relay-hooks/__flowtests__/useRefetchableFragment-flowtest.js.flow +7 -14
package/ReactRelayContext.js
CHANGED
|
@@ -111,7 +111,6 @@ 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
|
-
// $FlowExpectedError
|
|
115
114
|
(names: Array<string>);
|
|
116
115
|
// $FlowExpectedError[incompatible-type]
|
|
117
116
|
(names: Array<number>);
|
|
@@ -204,7 +203,6 @@ function cb(): void {}
|
|
|
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
|
|
|
@@ -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
|
|
package/hooks.js
CHANGED
package/index.js
CHANGED
package/legacy.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-relay",
|
|
3
3
|
"description": "A framework for building GraphQL-driven React applications.",
|
|
4
|
-
"version": "0.0.0-main-
|
|
4
|
+
"version": "0.0.0-main-7b0eeb0d",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"graphql",
|
|
7
7
|
"relay",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"fbjs": "^3.0.2",
|
|
21
21
|
"invariant": "^2.2.4",
|
|
22
22
|
"nullthrows": "^1.1.1",
|
|
23
|
-
"relay-runtime": "0.0.0-main-
|
|
23
|
+
"relay-runtime": "0.0.0-main-7b0eeb0d"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"react": "^16.9.0 || ^17 || ^18 || ^19"
|
|
@@ -60,19 +60,17 @@ type ExpectedReturnType<
|
|
|
60
60
|
keyNullable,
|
|
61
61
|
): ExpectedReturnType<QueryVariables, QueryVariables, NullableData>);
|
|
62
62
|
|
|
63
|
-
// $FlowExpectedError: can't cast nullable to non-nullable
|
|
64
63
|
// $FlowFixMe[react-rule-hook]
|
|
65
|
-
// $FlowFixMe[incompatible-type]
|
|
64
|
+
// $FlowFixMe[incompatible-type] can't cast nullable to non-nullable
|
|
66
65
|
(useBlockingPaginationFragment(
|
|
67
66
|
refetchableFragmentInput,
|
|
68
67
|
keyNullable,
|
|
69
68
|
): ExpectedReturnType<QueryVariables, QueryVariables, NonNullableData>);
|
|
70
69
|
|
|
71
|
-
// $FlowExpectedError: actual type of returned data is correct
|
|
72
70
|
// $FlowFixMe[react-rule-hook]
|
|
73
71
|
// $FlowFixMe[incompatible-exact]
|
|
74
72
|
// $FlowFixMe[prop-missing]
|
|
75
|
-
// $FlowFixMe[incompatible-type]
|
|
73
|
+
// $FlowFixMe[incompatible-type] actual type of returned data is correct
|
|
76
74
|
(useBlockingPaginationFragment(
|
|
77
75
|
refetchableFragmentInput,
|
|
78
76
|
// $FlowExpectedError[incompatible-type]
|
|
@@ -87,22 +85,19 @@ type ExpectedReturnType<
|
|
|
87
85
|
keyAnotherNullable,
|
|
88
86
|
): ExpectedReturnType<QueryVariables, QueryVariables, NullableData>);
|
|
89
87
|
|
|
90
|
-
// $FlowExpectedError: Key should not be a user provided object
|
|
91
88
|
// $FlowFixMe[react-rule-hook]
|
|
92
|
-
// $FlowFixMe[incompatible-type]
|
|
89
|
+
// $FlowFixMe[incompatible-type] Key should not be a user provided object
|
|
93
90
|
// $FlowFixMe[cannot-resolve-name]
|
|
94
91
|
useBlockingPaginationFragment(fragmentInput, {abc: 123});
|
|
95
92
|
|
|
96
|
-
// $FlowExpectedError: Key should not be an empty object
|
|
97
93
|
// $FlowFixMe[react-rule-hook]
|
|
98
|
-
// $FlowFixMe[incompatible-type]
|
|
94
|
+
// $FlowFixMe[incompatible-type] Key should not be an empty object
|
|
99
95
|
// $FlowFixMe[cannot-resolve-name]
|
|
100
96
|
useBlockingPaginationFragment(fragmentInput, {});
|
|
101
97
|
|
|
102
|
-
// $FlowExpectedError: Key should be the `<name>$key` type from generated flow
|
|
103
98
|
// $FlowFixMe[react-rule-hook]
|
|
104
99
|
// $FlowFixMe[incompatible-type]
|
|
105
|
-
// $FlowFixMe[cannot-resolve-name]
|
|
100
|
+
// $FlowFixMe[cannot-resolve-name] Key should be the `<name>$key` type from generated flow
|
|
106
101
|
useBlockingPaginationFragment(fragmentInput, fragmentData);
|
|
107
102
|
|
|
108
103
|
// Refetch function options:
|
|
@@ -62,25 +62,22 @@ type ExpectedReturnType<
|
|
|
62
62
|
keyNullable,
|
|
63
63
|
): ExpectedReturnType<QueryVariables, QueryVariables, NullableData>);
|
|
64
64
|
|
|
65
|
-
// $FlowExpectedError: can't cast nullable to non-nullable
|
|
66
65
|
// $FlowFixMe[react-rule-hook]
|
|
67
|
-
// $FlowFixMe[incompatible-type]
|
|
66
|
+
// $FlowFixMe[incompatible-type] can't cast nullable to non-nullable
|
|
68
67
|
(usePaginationFragment(
|
|
69
68
|
refetchableFragmentInput,
|
|
70
69
|
keyNullable,
|
|
71
70
|
): ExpectedReturnType<QueryVariables, QueryVariables, NonNullableData>);
|
|
72
71
|
|
|
73
|
-
// $FlowExpectedError: actual type of returned data is correct
|
|
74
72
|
// $FlowFixMe[react-rule-hook]
|
|
75
73
|
// $FlowFixMe[incompatible-exact]
|
|
76
74
|
// $FlowFixMe[prop-missing]
|
|
77
|
-
// $FlowFixMe[incompatible-type]
|
|
75
|
+
// $FlowFixMe[incompatible-type] actual type of returned data is correct
|
|
78
76
|
(usePaginationFragment(
|
|
79
77
|
refetchableFragmentInput,
|
|
80
78
|
// $FlowFixMe[incompatible-type]
|
|
81
79
|
keyAnotherNonNullable,
|
|
82
80
|
): ExpectedReturnType<QueryVariables, QueryVariablesSubset, NonNullableData>);
|
|
83
|
-
// $FlowExpectedError
|
|
84
81
|
// $FlowFixMe[react-rule-hook]
|
|
85
82
|
// $FlowFixMe[incompatible-type]
|
|
86
83
|
(usePaginationFragment(
|
|
@@ -89,19 +86,16 @@ type ExpectedReturnType<
|
|
|
89
86
|
keyAnotherNullable,
|
|
90
87
|
): ExpectedReturnType<QueryVariables, QueryVariables, NonNullableData>);
|
|
91
88
|
|
|
92
|
-
// $FlowExpectedError: Key should not be a user provided object
|
|
93
89
|
// $FlowFixMe[react-rule-hook]
|
|
94
|
-
// $FlowFixMe[incompatible-type]
|
|
90
|
+
// $FlowFixMe[incompatible-type] Key should not be a user provided object
|
|
95
91
|
usePaginationFragment(refetchableFragmentInput, {abc: 123});
|
|
96
92
|
|
|
97
|
-
// $FlowExpectedError: Key should not be an empty object
|
|
98
93
|
// $FlowFixMe[react-rule-hook]
|
|
99
|
-
// $FlowFixMe[incompatible-type]
|
|
94
|
+
// $FlowFixMe[incompatible-type] Key should not be an empty object
|
|
100
95
|
usePaginationFragment(refetchableFragmentInput, {});
|
|
101
96
|
|
|
102
|
-
// $FlowExpectedError: Key should be the `<name>$key` type from generated flow
|
|
103
97
|
// $FlowFixMe[react-rule-hook]
|
|
104
|
-
// $FlowFixMe[incompatible-type]
|
|
98
|
+
// $FlowFixMe[incompatible-type] Key should be the `<name>$key` type from generated flow
|
|
105
99
|
usePaginationFragment(refetchableFragmentInput, fragmentData);
|
|
106
100
|
|
|
107
101
|
// Refetch function options:
|
|
@@ -46,55 +46,48 @@ import {
|
|
|
46
46
|
FetchFn<QueryVariables>,
|
|
47
47
|
]);
|
|
48
48
|
|
|
49
|
-
// $FlowExpectedError: can't cast nullable to non-nullable
|
|
50
49
|
// $FlowFixMe[react-rule-hook]
|
|
51
|
-
// $FlowFixMe[incompatible-type]
|
|
50
|
+
// $FlowFixMe[incompatible-type] can't cast nullable to non-nullable
|
|
52
51
|
(useRefetchableFragment(refetchableFragmentInput, keyNullable): [
|
|
53
52
|
NonNullableData,
|
|
54
53
|
FetchFn<QueryVariables>,
|
|
55
54
|
]);
|
|
56
55
|
|
|
57
|
-
// $FlowExpectedError: refetch requires exact type if key is nullable
|
|
58
56
|
// $FlowFixMe[react-rule-hook]
|
|
59
57
|
// $FlowFixMe[incompatible-exact]
|
|
60
|
-
// $FlowFixMe[incompatible-type]
|
|
58
|
+
// $FlowFixMe[incompatible-type] refetch requires exact type if key is nullable
|
|
61
59
|
(useRefetchableFragment(refetchableFragmentInput, keyNullable): [
|
|
62
60
|
NullableData,
|
|
63
61
|
FetchFn<QueryVariablesSubset>,
|
|
64
62
|
]);
|
|
65
63
|
|
|
66
|
-
// $FlowExpectedError: actual type of returned data is correct
|
|
67
64
|
// $FlowFixMe[react-rule-hook]
|
|
68
65
|
// $FlowFixMe[incompatible-type]
|
|
69
66
|
// $FlowFixMe[incompatible-exact]
|
|
70
67
|
// $FlowFixMe[prop-missing]
|
|
71
|
-
// $FlowFixMe[incompatible-type]
|
|
68
|
+
// $FlowFixMe[incompatible-type] actual type of returned data is correct
|
|
72
69
|
(useRefetchableFragment(refetchableFragmentInput, keyAnotherNonNullable): [
|
|
73
70
|
NonNullableData,
|
|
74
71
|
FetchFn<QueryVariablesSubset>,
|
|
75
72
|
]);
|
|
76
73
|
|
|
77
|
-
// $FlowExpectedError - incompatible key types
|
|
78
74
|
// $FlowFixMe[react-rule-hook]
|
|
79
|
-
// $FlowFixMe[incompatible-type]
|
|
75
|
+
// $FlowFixMe[incompatible-type]: incompatible key types
|
|
80
76
|
(useRefetchableFragment(refetchableFragmentInput, keyAnotherNullable): [
|
|
81
77
|
NullableData,
|
|
82
78
|
FetchFn<QueryVariables>,
|
|
83
79
|
]);
|
|
84
80
|
|
|
85
|
-
// $FlowExpectedError: Key should not be a user provided object
|
|
86
81
|
// $FlowFixMe[react-rule-hook]
|
|
87
|
-
// $FlowFixMe[incompatible-type]
|
|
82
|
+
// $FlowFixMe[incompatible-type] Key should not be a user provided object
|
|
88
83
|
useRefetchableFragment(refetchableFragmentInput, {abc: 123});
|
|
89
84
|
|
|
90
|
-
// $FlowExpectedError: Key should not be an empty object
|
|
91
85
|
// $FlowFixMe[react-rule-hook]
|
|
92
|
-
// $FlowFixMe[incompatible-type]
|
|
86
|
+
// $FlowFixMe[incompatible-type] Key should not be an empty object
|
|
93
87
|
useRefetchableFragment(refetchableFragmentInput, {});
|
|
94
88
|
|
|
95
|
-
// $FlowExpectedError: Key should be the `<name>$key` type from generated flow
|
|
96
89
|
// $FlowFixMe[react-rule-hook]
|
|
97
|
-
// $FlowFixMe[incompatible-type]
|
|
90
|
+
// $FlowFixMe[incompatible-type] Key should be the `<name>$key` type from generated flow
|
|
98
91
|
useRefetchableFragment(refetchableFragmentInput, fragmentData);
|
|
99
92
|
|
|
100
93
|
// Refetch function options:
|