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: ?{|

0 commit comments

Comments
 (0)