Skip to content

Commit ed92970

Browse files
Undo changes to variables
1 parent ac450a8 commit ed92970

File tree

238 files changed

+773
-787
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

238 files changed

+773
-787
lines changed

compiler/crates/relay-compiler/tests/relay_compiler_integration/fixtures/custom_scalar_variable_default_arg_non_strict.expected

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ extend type Query {
4444
==================================== OUTPUT ===================================
4545
//- __generated__/fooCustomScalarLiteralArgQuery.graphql.js
4646
/**
47-
* <auto-generated> SignedSource<<1637ce7cbd0ba6ee3c528ef86ee61d09>>
47+
* <auto-generated> SignedSource<<3aa552e7fbe1065708942cd7012d713e>>
4848
* @flow
4949
* @lightSyntaxTransform
5050
* @nogrep
@@ -57,8 +57,8 @@ extend type Query {
5757
/*::
5858
import type { ClientRequest, ClientQuery } from 'relay-runtime';
5959
export type fooCustomScalarLiteralArgQuery$variables = {|
60-
arg?: any | null,
61-
arg_server?: any | null,
60+
arg?: ?any,
61+
arg_server?: ?any,
6262
|};
6363
export type fooCustomScalarLiteralArgQuery$data = {|
6464
+extension_field: ?{|

compiler/crates/relay-compiler/tests/relay_compiler_integration/fixtures/prefetchable_refetchable_pagination.expected

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ type Page {
6161
==================================== OUTPUT ===================================
6262
//- __generated__/RefetchableFragmentQuery.graphql.js
6363
/**
64-
* <auto-generated> SignedSource<<609d2c8a7985b58c3ee779c39d147a80>>
64+
* <auto-generated> SignedSource<<f564f1dfa61d152d3e7b6df1d206d243>>
6565
* @flow
6666
* @lightSyntaxTransform
6767
* @nogrep
@@ -76,8 +76,8 @@ import type { ConcreteRequest, Query } from 'relay-runtime';
7676
import type { FragmentType } from "relay-runtime";
7777
import type { foo$fragmentType } from "foo.graphql";
7878
export type RefetchableFragmentQuery$variables = {|
79-
count?: number | null,
80-
cursor?: string | null,
79+
count?: ?number,
80+
cursor?: ?string,
8181
|};
8282
export type RefetchableFragmentQuery$data = {|
8383
+viewer: ?{|
@@ -427,7 +427,7 @@ export default ((node/*: any*/)/*: PrefetchableRefetchableFragment<
427427

428428
//- __generated__/fooQuery.graphql.js
429429
/**
430-
* <auto-generated> SignedSource<<4505ac4727019dd25452a16cd29ac487>>
430+
* <auto-generated> SignedSource<<0692b813f39e023e6ae14977764bd0af>>
431431
* @flow
432432
* @lightSyntaxTransform
433433
* @nogrep
@@ -441,8 +441,8 @@ export default ((node/*: any*/)/*: PrefetchableRefetchableFragment<
441441
import type { ConcreteRequest, Query } from 'relay-runtime';
442442
import type { foo$fragmentType } from "foo.graphql";
443443
export type fooQuery$variables = {|
444-
count?: number | null,
445-
cursor?: string | null,
444+
count?: ?number,
445+
cursor?: ?string,
446446
|};
447447
export type fooQuery$data = {|
448448
+me: ?{|

compiler/crates/relay-typegen/src/visit.rs

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,6 @@ fn get_resolver_arguments(
557557
input_object_types,
558558
encountered_enums,
559559
custom_scalars,
560-
true,
561560
),
562561
}));
563562
}
@@ -2449,7 +2448,6 @@ fn transform_non_nullable_input_type(
24492448
input_object_types,
24502449
encountered_enums,
24512450
custom_scalars,
2452-
false,
24532451
))),
24542452
TypeReference::Named(named_type) => match named_type {
24552453
Type::Scalar(scalar) => {
@@ -2485,7 +2483,6 @@ fn transform_non_nullable_input_type(
24852483
input_object_types,
24862484
encountered_enums,
24872485
custom_scalars,
2488-
false,
24892486
),
24902487
})
24912488
})
@@ -2512,7 +2509,6 @@ pub(crate) fn transform_input_type(
25122509
input_object_types: &mut InputObjectTypes,
25132510
encountered_enums: &mut EncounteredEnums,
25142511
custom_scalars: &mut CustomScalarsImports,
2515-
should_output_optional: bool,
25162512
) -> AST {
25172513
match type_ref {
25182514
TypeReference::NonNull(of_type) => transform_non_nullable_input_type(
@@ -2522,21 +2518,13 @@ pub(crate) fn transform_input_type(
25222518
encountered_enums,
25232519
custom_scalars,
25242520
),
2525-
_ => {
2526-
let ast = Box::new(transform_non_nullable_input_type(
2527-
typegen_context,
2528-
type_ref,
2529-
input_object_types,
2530-
encountered_enums,
2531-
custom_scalars,
2532-
));
2533-
2534-
return if should_output_optional {
2535-
AST::Optional(ast)
2536-
} else {
2537-
AST::Nullable(ast)
2538-
};
2539-
}
2521+
_ => AST::Optional(Box::new(transform_non_nullable_input_type(
2522+
typegen_context,
2523+
type_ref,
2524+
input_object_types,
2525+
encountered_enums,
2526+
custom_scalars,
2527+
))),
25402528
}
25412529
}
25422530

@@ -2561,7 +2549,6 @@ pub(crate) fn get_input_variables_type<'a>(
25612549
input_object_types,
25622550
encountered_enums,
25632551
custom_scalars,
2564-
false,
25652552
),
25662553
})
25672554
})

compiler/crates/relay-typegen/src/write.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,6 @@ fn generate_provided_variables_type(
842842
input_object_types,
843843
encountered_enums,
844844
custom_scalars,
845-
false,
846845
)));
847846
let provider_module = Prop::KeyValuePair(KeyValuePairProp {
848847
key: "get".intern(),

compiler/crates/relay-typegen/tests/generate_flow/fixtures/custom-scalar-type-import.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ query Viewer($params: JSON) {
1313
==================================== OUTPUT ===================================
1414
import type { JSON } from "TypeDefsFile";
1515
export type Viewer$variables = {|
16-
params?: JSON | null,
16+
params?: ?JSON,
1717
|};
1818
export type Viewer$data = {|
1919
+viewer: ?{|

compiler/crates/relay-typegen/tests/generate_flow/fixtures/default-input.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ mutation feedbackUnLikeMutation($input: FeedbackUnLikeInput) {
88
}
99
==================================== OUTPUT ===================================
1010
export type FeedbackUnLikeInput = {|
11-
feedbackId?: string | null,
11+
feedbackId?: ?string,
1212
silent?: CustomBoolean,
1313
|};
1414
export type feedbackUnLikeMutation$variables = {|
15-
input?: FeedbackUnLikeInput | null,
15+
input?: ?FeedbackUnLikeInput,
1616
|};
1717
export type feedbackUnLikeMutation$data = {|
1818
+feedbackUnLike: ?{|

compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-input-has-array.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ mutation InputHasArray($input: UpdateAllSeenStateInput) @raw_response_type {
88
}
99
==================================== OUTPUT ===================================
1010
export type UpdateAllSeenStateInput = {|
11-
storyIds?: $ReadOnlyArray<string | null> | null,
11+
storyIds?: ?$ReadOnlyArray<?string>,
1212
|};
1313
export type InputHasArray$variables = {|
14-
input?: UpdateAllSeenStateInput | null,
14+
input?: ?UpdateAllSeenStateInput,
1515
|};
1616
export type InputHasArray$data = {|
1717
+viewerNotificationsUpdateAllSeenState: ?{|

compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-client-extension.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ type Foo {
2020
}
2121
==================================== OUTPUT ===================================
2222
export type UpdateAllSeenStateInput = {|
23-
storyIds?: $ReadOnlyArray<string | null> | null,
23+
storyIds?: ?$ReadOnlyArray<?string>,
2424
|};
2525
export type Test$variables = {|
26-
input?: UpdateAllSeenStateInput | null,
26+
input?: ?UpdateAllSeenStateInput,
2727
|};
2828
export type Test$data = {|
2929
+viewerNotificationsUpdateAllSeenState: ?{|

compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-enums-on-fragment.expected

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,19 @@ import type { FriendFragment$fragmentType } from "FriendFragment.graphql";
3131
export type TestEnums = "mark" | "zuck" | "%future added value";
3232
export type CommentCreateInput = {|
3333
client_mutation_id: string,
34-
feedback?: CommentfeedbackFeedback | null,
35-
feedbackId?: string | null,
34+
feedback?: ?CommentfeedbackFeedback,
35+
feedbackId?: ?string,
3636
|};
3737
export type CommentfeedbackFeedback = {|
38-
comment?: FeedbackcommentComment | null,
38+
comment?: ?FeedbackcommentComment,
3939
|};
4040
export type FeedbackcommentComment = {|
41-
feedback?: CommentfeedbackFeedback | null,
41+
feedback?: ?CommentfeedbackFeedback,
4242
|};
4343
export type CommentCreateMutation$variables = {|
44-
first?: number | null,
44+
first?: ?number,
4545
input: CommentCreateInput,
46-
orderBy?: $ReadOnlyArray<string> | null,
46+
orderBy?: ?$ReadOnlyArray<string>,
4747
|};
4848
export type CommentCreateMutation$data = {|
4949
+commentCreate: ?{|

compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-nested-fragments.expected

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,19 @@ fragment FeedbackFragment on Feedback {
3434
import type { FriendFragment$fragmentType } from "FriendFragment.graphql";
3535
export type CommentCreateInput = {|
3636
client_mutation_id: string,
37-
feedback?: CommentfeedbackFeedback | null,
38-
feedbackId?: string | null,
37+
feedback?: ?CommentfeedbackFeedback,
38+
feedbackId?: ?string,
3939
|};
4040
export type CommentfeedbackFeedback = {|
41-
comment?: FeedbackcommentComment | null,
41+
comment?: ?FeedbackcommentComment,
4242
|};
4343
export type FeedbackcommentComment = {|
44-
feedback?: CommentfeedbackFeedback | null,
44+
feedback?: ?CommentfeedbackFeedback,
4545
|};
4646
export type CommentCreateMutation$variables = {|
47-
first?: number | null,
47+
first?: ?number,
4848
input: CommentCreateInput,
49-
orderBy?: $ReadOnlyArray<string> | null,
49+
orderBy?: ?$ReadOnlyArray<string>,
5050
|};
5151
export type CommentCreateMutation$data = {|
5252
+commentCreate: ?{|

compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-response-on-inline-fragments.expected

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ fragment InlineFragmentWithOverlappingFields on Actor {
3030
import type { InlineFragmentWithOverlappingFields$fragmentType } from "InlineFragmentWithOverlappingFields.graphql";
3131
export type CommentCreateInput = {|
3232
client_mutation_id: string,
33-
feedback?: CommentfeedbackFeedback | null,
34-
feedbackId?: string | null,
33+
feedback?: ?CommentfeedbackFeedback,
34+
feedbackId?: ?string,
3535
|};
3636
export type CommentfeedbackFeedback = {|
37-
comment?: FeedbackcommentComment | null,
37+
comment?: ?FeedbackcommentComment,
3838
|};
3939
export type FeedbackcommentComment = {|
40-
feedback?: CommentfeedbackFeedback | null,
40+
feedback?: ?CommentfeedbackFeedback,
4141
|};
4242
export type TestMutation$variables = {|
4343
input: CommentCreateInput,

compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation.expected

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ mutation CommentCreateMutation(
1717
==================================== OUTPUT ===================================
1818
export type CommentCreateInput = {|
1919
client_mutation_id: string,
20-
feedback?: CommentfeedbackFeedback | null,
21-
feedbackId?: string | null,
20+
feedback?: ?CommentfeedbackFeedback,
21+
feedbackId?: ?string,
2222
|};
2323
export type CommentfeedbackFeedback = {|
24-
comment?: FeedbackcommentComment | null,
24+
comment?: ?FeedbackcommentComment,
2525
|};
2626
export type FeedbackcommentComment = {|
27-
feedback?: CommentfeedbackFeedback | null,
27+
feedback?: ?CommentfeedbackFeedback,
2828
|};
2929
export type CommentCreateMutation$variables = {|
30-
first?: number | null,
30+
first?: ?number,
3131
input: CommentCreateInput,
32-
orderBy?: $ReadOnlyArray<string> | null,
32+
orderBy?: ?$ReadOnlyArray<string>,
3333
|};
3434
export type CommentCreateMutation$data = {|
3535
+commentCreate: ?{|

compiler/crates/relay-typegen/tests/generate_flow/fixtures/no-inline-fragment.expected

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ import type { noInlineFragment_user$fragmentType } from "noInlineFragment_user.g
2828
import type { noInlineFragment_address$normalization } from "noInlineFragment_address$normalization.graphql";
2929
import type { noInlineFragment_user$normalization } from "noInlineFragment_user$normalization.graphql";
3030
export type noInlineFragmentQuery$variables = {|
31-
global?: number | null,
32-
global_from_parent?: number | null,
33-
shadowed_global?: number | null,
31+
global?: ?number,
32+
global_from_parent?: ?number,
33+
shadowed_global?: ?number,
3434
|};
3535
export type noInlineFragmentQuery$data = {|
3636
+me: ?{|

compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-provided-variables-custom-scalar.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export type testQuery = {|
3030
"__relay_internal__pv__includeNameProvider": require('includeNameProvider')
3131
}: {|
3232
+__relay_internal__pv__includeNameProvider: {|
33-
+get: () => JSON | null,
33+
+get: () => ?JSON,
3434
|},
3535
|});
3636
-------------------------------------------------------------------------------

compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-up-to-mutation-response.expected

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ mutation CommentCreateMutation($input: CommentCreateInput!) {
99
==================================== OUTPUT ===================================
1010
export type CommentCreateInput = {|
1111
client_mutation_id: string,
12-
feedback?: CommentfeedbackFeedback | null,
13-
feedbackId?: string | null,
12+
feedback?: ?CommentfeedbackFeedback,
13+
feedbackId?: ?string,
1414
|};
1515
export type CommentfeedbackFeedback = {|
16-
comment?: FeedbackcommentComment | null,
16+
comment?: ?FeedbackcommentComment,
1717
|};
1818
export type FeedbackcommentComment = {|
19-
feedback?: CommentfeedbackFeedback | null,
19+
feedback?: ?CommentfeedbackFeedback,
2020
|};
2121
export type CommentCreateMutation$variables = {|
2222
input: CommentCreateInput,

compiler/crates/relay-typegen/tests/generate_flow/fixtures/roots.expected

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ export type ExampleQuery = {|
4040
-------------------------------------------------------------------------------
4141
export type CommentCreateInput = {|
4242
client_mutation_id: string,
43-
feedback?: CommentfeedbackFeedback | null,
44-
feedbackId?: string | null,
43+
feedback?: ?CommentfeedbackFeedback,
44+
feedbackId?: ?string,
4545
|};
4646
export type CommentfeedbackFeedback = {|
47-
comment?: FeedbackcommentComment | null,
47+
comment?: ?FeedbackcommentComment,
4848
|};
4949
export type FeedbackcommentComment = {|
50-
feedback?: CommentfeedbackFeedback | null,
50+
feedback?: ?CommentfeedbackFeedback,
5151
|};
5252
export type TestMutation$variables = {|
5353
input: CommentCreateInput,
@@ -65,10 +65,10 @@ export type TestMutation = {|
6565
|};
6666
-------------------------------------------------------------------------------
6767
export type FeedbackLikeInput = {|
68-
feedbackId?: string | null,
68+
feedbackId?: ?string,
6969
|};
7070
export type TestSubscription$variables = {|
71-
input?: FeedbackLikeInput | null,
71+
input?: ?FeedbackLikeInput,
7272
|};
7373
export type TestSubscription$data = {|
7474
+feedbackLikeSubscribe: ?{|

compiler/crates/relay-typegen/tests/generate_typescript/fixtures/custom-scalar-type-import.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ query Viewer($params: JSON) {
1313
==================================== OUTPUT ===================================
1414
import { JSON } from "TypeDefsFile";
1515
export type Viewer$variables = {
16-
params?: JSON | null;
16+
params?: JSON | null | undefined;
1717
};
1818
export type Viewer$data = {
1919
readonly viewer: {

compiler/crates/relay-typegen/tests/generate_typescript/fixtures/default-input.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ mutation feedbackUnLikeMutation($input: FeedbackUnLikeInput) {
88
}
99
==================================== OUTPUT ===================================
1010
export type FeedbackUnLikeInput = {
11-
feedbackId?: string | null;
11+
feedbackId?: string | null | undefined;
1212
silent?: boolean;
1313
};
1414
export type feedbackUnLikeMutation$variables = {
15-
input?: FeedbackUnLikeInput | null;
15+
input?: FeedbackUnLikeInput | null | undefined;
1616
};
1717
export type feedbackUnLikeMutation$data = {
1818
readonly feedbackUnLike: {

compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-input-has-array.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ mutation InputHasArray($input: UpdateAllSeenStateInput) @raw_response_type {
88
}
99
==================================== OUTPUT ===================================
1010
export type UpdateAllSeenStateInput = {
11-
storyIds?: ReadonlyArray<string | null> | null;
11+
storyIds?: ReadonlyArray<string | null | undefined> | null | undefined;
1212
};
1313
export type InputHasArray$variables = {
14-
input?: UpdateAllSeenStateInput | null;
14+
input?: UpdateAllSeenStateInput | null | undefined;
1515
};
1616
export type InputHasArray$data = {
1717
readonly viewerNotificationsUpdateAllSeenState: {

0 commit comments

Comments
 (0)