From 21c09e063e29ff52a3d1a93a3416f93d7c73132e Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Sat, 17 Oct 2020 17:28:15 +0200 Subject: [PATCH 01/41] Fix remaining cases with hardcoded output, rather than using AST. --- compiler/crates/relay-typegen/src/lib.rs | 45 ++++++++++++------- .../fixtures/fragment-spread.expected | 10 ++--- .../fixtures/inline-fragment.expected | 2 +- .../fixtures/match-field-in-query.expected | 4 +- .../fixtures/match-field.expected | 4 +- ...with-response-on-inline-fragments.expected | 2 +- .../mutation-with-enums-on-fragment.expected | 2 +- .../mutation-with-nested-fragments.expected | 4 +- .../fixtures/query-with-match-fields.expected | 6 +-- .../fixtures/query-with-module-field.expected | 4 +- .../query-with-multiple-match-fields.expected | 12 ++--- ...-with-raw-response-on-conditional.expected | 2 +- ...w-response-on-literal-conditional.expected | 2 +- .../unmasked-fragment-spreads.expected | 2 +- .../fixtures/fragment-spread.expected | 10 ++--- .../fixtures/inline-fragment.expected | 2 +- .../fixtures/match-field-in-query.expected | 4 +- .../fixtures/match-field.expected | 4 +- ...with-response-on-inline-fragments.expected | 2 +- .../mutation-with-enums-on-fragment.expected | 2 +- .../mutation-with-nested-fragments.expected | 4 +- .../fixtures/query-with-match-fields.expected | 6 +-- .../fixtures/query-with-module-field.expected | 4 +- .../query-with-multiple-match-fields.expected | 12 ++--- ...-with-raw-response-on-conditional.expected | 2 +- ...w-response-on-literal-conditional.expected | 2 +- .../unmasked-fragment-spreads.expected | 2 +- 27 files changed, 86 insertions(+), 71 deletions(-) diff --git a/compiler/crates/relay-typegen/src/lib.rs b/compiler/crates/relay-typegen/src/lib.rs index c9685dc8a0a88..8b488e472aa11 100644 --- a/compiler/crates/relay-typegen/src/lib.rs +++ b/compiler/crates/relay-typegen/src/lib.rs @@ -1068,8 +1068,11 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { // // fragments writeln!( self.result, - "import type {{ {} }} from \"{}.graphql\";", - fragment_type_name, used_fragment + "{}", + self.writer.write_ast(&AST::ImportType( + vec![fragment_type_name], + format!("./{}.graphql", used_fragment).intern() + )) )?; // } else if (state.useSingleArtifactDirectory) { // imports.push( @@ -1091,13 +1094,19 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { let new_fragment_type_name = format!("{}$fragmentType", refetchable_fragment_name).intern(); writeln!( self.result, - "declare export opaque type {}: FragmentReference;", - old_fragment_type_name + "{}", + self.writer.write_ast(&AST::DeclareExportOpaqueType( + old_fragment_type_name, + "FragmentReference".intern() + )) )?; writeln!( self.result, - "declare export opaque type {}: {};", - new_fragment_type_name, old_fragment_type_name + "{}", + self.writer.write_ast(&AST::DeclareExportOpaqueType( + new_fragment_type_name, + old_fragment_type_name + )) )?; Ok(()) } @@ -1110,9 +1119,11 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { if let Some(enum_module_suffix) = &self.typegen_config.enum_module_suffix { writeln!( self.result, - "import type {{ {enum_name} }} from \"{enum_name}{enum_suffix}\";", - enum_name = enum_type.name, - enum_suffix = enum_module_suffix + "{}", + self.writer.write_ast(&AST::ImportType( + vec![enum_type.name], + format!("{}{}", enum_type.name, enum_module_suffix).intern() + )) )?; } else { let mut members: Vec = enum_type @@ -1123,9 +1134,11 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { members.push(AST::StringLiteral(*FUTURE_ENUM_VALUE)); writeln!( self.result, - "export type {} = {};", - enum_type.name, - self.writer.write_ast(&AST::Union(members)) + "{}", + self.writer.write_ast(&AST::ExportTypeEquals( + enum_type.name, + Box::from(AST::Union(members)) + )) )?; } } @@ -1152,9 +1165,11 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { GeneratedInputObject::Resolved(input_object_type) => { writeln!( self.result, - "export type {} = {};", - type_identifier, - self.writer.write_ast(&input_object_type) + "{}", + self.writer.write_ast(&AST::ExportTypeEquals( + type_identifier.clone(), + Box::from(input_object_type.clone()) + )) )?; } GeneratedInputObject::Pending => panic!("expected a resolved type here"), diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/fragment-spread.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/fragment-spread.expected index a4b0b04a59fe9..94fa31fbf884a 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/fragment-spread.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/fragment-spread.expected @@ -48,7 +48,7 @@ fragment UserFrag2 on User { __typename } ==================================== OUTPUT =================================== -import type { PageFragment$ref } from "PageFragment.graphql"; +import type { PageFragment$ref } from "./PageFragment.graphql"; import type { FragmentReference } from "relay-runtime"; declare export opaque type ConcreateTypes$ref: FragmentReference; declare export opaque type ConcreateTypes$fragmentType: ConcreateTypes$ref; @@ -74,10 +74,10 @@ export type ConcreateTypes$key = { ... }; ------------------------------------------------------------------------------- -import type { OtherFragment$ref } from "OtherFragment.graphql"; -import type { PictureFragment$ref } from "PictureFragment.graphql"; -import type { UserFrag1$ref } from "UserFrag1.graphql"; -import type { UserFrag2$ref } from "UserFrag2.graphql"; +import type { OtherFragment$ref } from "./OtherFragment.graphql"; +import type { PictureFragment$ref } from "./PictureFragment.graphql"; +import type { UserFrag1$ref } from "./UserFrag1.graphql"; +import type { UserFrag2$ref } from "./UserFrag2.graphql"; import type { FragmentReference } from "relay-runtime"; declare export opaque type FragmentSpread$ref: FragmentReference; declare export opaque type FragmentSpread$fragmentType: FragmentSpread$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/inline-fragment.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/inline-fragment.expected index 7343873932901..23a11a51f3220 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/inline-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/inline-fragment.expected @@ -97,7 +97,7 @@ export type InlineFragmentConditionalID$key = { ... }; ------------------------------------------------------------------------------- -import type { SomeFragment$ref } from "SomeFragment.graphql"; +import type { SomeFragment$ref } from "./SomeFragment.graphql"; import type { FragmentReference } from "relay-runtime"; declare export opaque type InlineFragmentKitchenSink$ref: FragmentReference; declare export opaque type InlineFragmentKitchenSink$fragmentType: InlineFragmentKitchenSink$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/match-field-in-query.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/match-field-in-query.expected index b05cd7f52e50f..1157563d6ff80 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/match-field-in-query.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/match-field-in-query.expected @@ -23,8 +23,8 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { } } ==================================== OUTPUT =================================== -import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; -import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; +import type { MarkdownUserNameRenderer_name$ref } from "./MarkdownUserNameRenderer_name.graphql"; +import type { PlainUserNameRenderer_name$ref } from "./PlainUserNameRenderer_name.graphql"; export type NameRendererQueryVariables = {||}; export type NameRendererQueryResponse = {| +me: ?{| diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/match-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/match-field.expected index 85b4148c28bcd..789f426ca7cea 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/match-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/match-field.expected @@ -39,8 +39,8 @@ export type MarkdownUserNameRenderer_name$key = { ... }; ------------------------------------------------------------------------------- -import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; -import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; +import type { MarkdownUserNameRenderer_name$ref } from "./MarkdownUserNameRenderer_name.graphql"; +import type { PlainUserNameRenderer_name$ref } from "./PlainUserNameRenderer_name.graphql"; import type { FragmentReference } from "relay-runtime"; declare export opaque type NameRendererFragment$ref: FragmentReference; declare export opaque type NameRendererFragment$fragmentType: NameRendererFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutaion-with-response-on-inline-fragments.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutaion-with-response-on-inline-fragments.expected index 39e9f4467e901..eb34ae90c06f7 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutaion-with-response-on-inline-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutaion-with-response-on-inline-fragments.expected @@ -27,7 +27,7 @@ fragment InlineFragmentWithOverlappingFields on Actor { } } ==================================== OUTPUT =================================== -import type { InlineFragmentWithOverlappingFields$ref } from "InlineFragmentWithOverlappingFields.graphql"; +import type { InlineFragmentWithOverlappingFields$ref } from "./InlineFragmentWithOverlappingFields.graphql"; export type CommentCreateInput = {| clientMutationId?: ?string, feedbackId?: ?string, diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-enums-on-fragment.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-enums-on-fragment.expected index 9b0709bf2da7d..01835bbdc26a8 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-enums-on-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-enums-on-fragment.expected @@ -27,7 +27,7 @@ fragment FriendFragment on User { } } ==================================== OUTPUT =================================== -import type { FriendFragment$ref } from "FriendFragment.graphql"; +import type { FriendFragment$ref } from "./FriendFragment.graphql"; export type TestEnums = "mark" | "zuck" | "%future added value"; export type CommentCreateInput = {| clientMutationId?: ?string, diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-nested-fragments.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-nested-fragments.expected index 9439a4b045a62..35975ec793652 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-nested-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-nested-fragments.expected @@ -31,7 +31,7 @@ fragment FeedbackFragment on Feedback { name } ==================================== OUTPUT =================================== -import type { FriendFragment$ref } from "FriendFragment.graphql"; +import type { FriendFragment$ref } from "./FriendFragment.graphql"; export type CommentCreateInput = {| clientMutationId?: ?string, feedbackId?: ?string, @@ -103,7 +103,7 @@ export type FeedbackFragment$key = { ... }; ------------------------------------------------------------------------------- -import type { FeedbackFragment$ref } from "FeedbackFragment.graphql"; +import type { FeedbackFragment$ref } from "./FeedbackFragment.graphql"; import type { FragmentReference } from "relay-runtime"; declare export opaque type FriendFragment$ref: FragmentReference; declare export opaque type FriendFragment$fragmentType: FriendFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-match-fields.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-match-fields.expected index b4a44c8a7cf66..5c6f8ac1b4f35 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-match-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-match-fields.expected @@ -29,7 +29,7 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { } ==================================== OUTPUT =================================== import type { Local3DPayload } from "relay-runtime"; -import type { NameRendererFragment$ref } from "NameRendererFragment.graphql"; +import type { NameRendererFragment$ref } from "./NameRendererFragment.graphql"; export type TestVariables = {||}; export type TestResponse = {| +node: ?{| @@ -101,8 +101,8 @@ export type MarkdownUserNameRenderer_name$key = { ... }; ------------------------------------------------------------------------------- -import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; -import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; +import type { MarkdownUserNameRenderer_name$ref } from "./MarkdownUserNameRenderer_name.graphql"; +import type { PlainUserNameRenderer_name$ref } from "./PlainUserNameRenderer_name.graphql"; import type { FragmentReference } from "relay-runtime"; declare export opaque type NameRendererFragment$ref: FragmentReference; declare export opaque type NameRendererFragment$fragmentType: NameRendererFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-module-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-module-field.expected index 2f71e93af88bc..553928e498d9b 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-module-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-module-field.expected @@ -18,7 +18,7 @@ fragment Test_userRenderer on PlainUserRenderer { } ==================================== OUTPUT =================================== import type { Local3DPayload } from "relay-runtime"; -import type { Test_user$ref } from "Test_user.graphql"; +import type { Test_user$ref } from "./Test_user.graphql"; export type TestVariables = {||}; export type TestResponse = {| +node: ?{| @@ -52,7 +52,7 @@ export type Test = {| rawResponse: TestRawResponse, |}; ------------------------------------------------------------------------------- -import type { Test_userRenderer$ref } from "Test_userRenderer.graphql"; +import type { Test_userRenderer$ref } from "./Test_userRenderer.graphql"; import type { FragmentReference } from "relay-runtime"; declare export opaque type Test_user$ref: FragmentReference; declare export opaque type Test_user$fragmentType: Test_user$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-multiple-match-fields.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-multiple-match-fields.expected index 9aca04648dca8..13b2b37eeac73 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-multiple-match-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-multiple-match-fields.expected @@ -49,8 +49,8 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { } ==================================== OUTPUT =================================== import type { Local3DPayload } from "relay-runtime"; -import type { AnotherNameRendererFragment$ref } from "AnotherNameRendererFragment.graphql"; -import type { NameRendererFragment$ref } from "NameRendererFragment.graphql"; +import type { AnotherNameRendererFragment$ref } from "./AnotherNameRendererFragment.graphql"; +import type { NameRendererFragment$ref } from "./NameRendererFragment.graphql"; export type TestVariables = {||}; export type TestResponse = {| +node: ?{| @@ -142,8 +142,8 @@ export type Test = {| rawResponse: TestRawResponse, |}; ------------------------------------------------------------------------------- -import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; -import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; +import type { MarkdownUserNameRenderer_name$ref } from "./MarkdownUserNameRenderer_name.graphql"; +import type { PlainUserNameRenderer_name$ref } from "./PlainUserNameRenderer_name.graphql"; import type { FragmentReference } from "relay-runtime"; declare export opaque type AnotherNameRendererFragment$ref: FragmentReference; declare export opaque type AnotherNameRendererFragment$fragmentType: AnotherNameRendererFragment$ref; @@ -180,8 +180,8 @@ export type MarkdownUserNameRenderer_name$key = { ... }; ------------------------------------------------------------------------------- -import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; -import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; +import type { MarkdownUserNameRenderer_name$ref } from "./MarkdownUserNameRenderer_name.graphql"; +import type { PlainUserNameRenderer_name$ref } from "./PlainUserNameRenderer_name.graphql"; import type { FragmentReference } from "relay-runtime"; declare export opaque type NameRendererFragment$ref: FragmentReference; declare export opaque type NameRendererFragment$fragmentType: NameRendererFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-conditional.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-conditional.expected index bd52665aa1ba3..83aa52655090b 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-conditional.expected @@ -16,7 +16,7 @@ fragment FriendFragment on User { } } ==================================== OUTPUT =================================== -import type { FriendFragment$ref } from "FriendFragment.graphql"; +import type { FriendFragment$ref } from "./FriendFragment.graphql"; export type ExampleQueryVariables = {| id: string, condition: boolean, diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-literal-conditional.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-literal-conditional.expected index 27d3673975f8b..33556ec8d8bd1 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-literal-conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-literal-conditional.expected @@ -22,7 +22,7 @@ fragment FriendFragment on User { } } ==================================== OUTPUT =================================== -import type { FriendFragment$ref } from "FriendFragment.graphql"; +import type { FriendFragment$ref } from "./FriendFragment.graphql"; export type ExampleQueryVariables = {| id: string |}; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/unmasked-fragment-spreads.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/unmasked-fragment-spreads.expected index 76c43e1335d38..ad8e4eeb71fe8 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/unmasked-fragment-spreads.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/unmasked-fragment-spreads.expected @@ -71,7 +71,7 @@ export type RecursiveFragment$key = { ... }; ------------------------------------------------------------------------------- -import type { PhotoFragment$ref } from "PhotoFragment.graphql"; +import type { PhotoFragment$ref } from "./PhotoFragment.graphql"; import type { FragmentReference } from "relay-runtime"; declare export opaque type UserProfile$ref: FragmentReference; declare export opaque type UserProfile$fragmentType: UserProfile$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected index daae24c71795a..f076c6c0c992f 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected @@ -48,7 +48,7 @@ fragment UserFrag2 on User { __typename } ==================================== OUTPUT =================================== -import type { PageFragment$ref } from "PageFragment.graphql"; +import { PageFragment$ref } from "./PageFragment.graphql"; import { FragmentReference } from "relay-runtime"; export type ConcreateTypes$ref = FragmentReference & { _: "ConcreateTypes$ref" }; export type ConcreateTypes$fragmentType = ConcreateTypes$ref & { _: "ConcreateTypes$fragmentType" }; @@ -73,10 +73,10 @@ export type ConcreateTypes$key = { readonly $fragmentRefs: ConcreateTypes$ref, }; ------------------------------------------------------------------------------- -import type { OtherFragment$ref } from "OtherFragment.graphql"; -import type { PictureFragment$ref } from "PictureFragment.graphql"; -import type { UserFrag1$ref } from "UserFrag1.graphql"; -import type { UserFrag2$ref } from "UserFrag2.graphql"; +import { OtherFragment$ref } from "./OtherFragment.graphql"; +import { PictureFragment$ref } from "./PictureFragment.graphql"; +import { UserFrag1$ref } from "./UserFrag1.graphql"; +import { UserFrag2$ref } from "./UserFrag2.graphql"; import { FragmentReference } from "relay-runtime"; export type FragmentSpread$ref = FragmentReference & { _: "FragmentSpread$ref" }; export type FragmentSpread$fragmentType = FragmentSpread$ref & { _: "FragmentSpread$fragmentType" }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected index 12873541acd25..c6ffab4ff8c2f 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected @@ -95,7 +95,7 @@ export type InlineFragmentConditionalID$key = { readonly $fragmentRefs: InlineFragmentConditionalID$ref, }; ------------------------------------------------------------------------------- -import type { SomeFragment$ref } from "SomeFragment.graphql"; +import { SomeFragment$ref } from "./SomeFragment.graphql"; import { FragmentReference } from "relay-runtime"; export type InlineFragmentKitchenSink$ref = FragmentReference & { _: "InlineFragmentKitchenSink$ref" }; export type InlineFragmentKitchenSink$fragmentType = InlineFragmentKitchenSink$ref & { _: "InlineFragmentKitchenSink$fragmentType" }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected index 0e4ce6d1ba6ea..b034d81eeda7f 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected @@ -23,8 +23,8 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { } } ==================================== OUTPUT =================================== -import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; -import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; +import type { MarkdownUserNameRenderer_name$ref } from "./MarkdownUserNameRenderer_name.graphql"; +import type { PlainUserNameRenderer_name$ref } from "./PlainUserNameRenderer_name.graphql"; export type NameRendererQueryVariables = {||}; export type NameRendererQueryResponse = {| +me: ?{| diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected index 1414a19275ac7..40719cce79468 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected @@ -38,8 +38,8 @@ export type MarkdownUserNameRenderer_name$key = { readonly $fragmentRefs: MarkdownUserNameRenderer_name$ref, }; ------------------------------------------------------------------------------- -import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; -import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; +import { MarkdownUserNameRenderer_name$ref } from "./MarkdownUserNameRenderer_name.graphql"; +import { PlainUserNameRenderer_name$ref } from "./PlainUserNameRenderer_name.graphql"; import { FragmentReference } from "relay-runtime"; export type NameRendererFragment$ref = FragmentReference & { _: "NameRendererFragment$ref" }; export type NameRendererFragment$fragmentType = NameRendererFragment$ref & { _: "NameRendererFragment$fragmentType" }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutaion-with-response-on-inline-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutaion-with-response-on-inline-fragments.expected index 7fbe23ed78b0b..44b2787736db4 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutaion-with-response-on-inline-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutaion-with-response-on-inline-fragments.expected @@ -27,7 +27,7 @@ fragment InlineFragmentWithOverlappingFields on Actor { } } ==================================== OUTPUT =================================== -import type { InlineFragmentWithOverlappingFields$ref } from "InlineFragmentWithOverlappingFields.graphql"; +import type { InlineFragmentWithOverlappingFields$ref } from "./InlineFragmentWithOverlappingFields.graphql"; export type CommentCreateInput = {| clientMutationId?: ?string, feedbackId?: ?string, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected index a48e8686fdddc..bf4444dc60b7f 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected @@ -27,7 +27,7 @@ fragment FriendFragment on User { } } ==================================== OUTPUT =================================== -import type { FriendFragment$ref } from "FriendFragment.graphql"; +import type { FriendFragment$ref } from "./FriendFragment.graphql"; export type TestEnums = "mark" | "zuck" | "%future added value"; export type CommentCreateInput = {| clientMutationId?: ?string, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected index c4d11d2e21284..2d74ffeeb6510 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected @@ -31,7 +31,7 @@ fragment FeedbackFragment on Feedback { name } ==================================== OUTPUT =================================== -import type { FriendFragment$ref } from "FriendFragment.graphql"; +import type { FriendFragment$ref } from "./FriendFragment.graphql"; export type CommentCreateInput = {| clientMutationId?: ?string, feedbackId?: ?string, @@ -102,7 +102,7 @@ export type FeedbackFragment$key = { readonly $fragmentRefs: FeedbackFragment$ref, }; ------------------------------------------------------------------------------- -import type { FeedbackFragment$ref } from "FeedbackFragment.graphql"; +import { FeedbackFragment$ref } from "./FeedbackFragment.graphql"; import { FragmentReference } from "relay-runtime"; export type FriendFragment$ref = FragmentReference & { _: "FriendFragment$ref" }; export type FriendFragment$fragmentType = FriendFragment$ref & { _: "FriendFragment$fragmentType" }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected index cedd2a7b5cda6..9e5e67a484dcf 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected @@ -29,7 +29,7 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { } ==================================== OUTPUT =================================== import type { Local3DPayload } from "relay-runtime"; -import type { NameRendererFragment$ref } from "NameRendererFragment.graphql"; +import type { NameRendererFragment$ref } from "./NameRendererFragment.graphql"; export type TestVariables = {||}; export type TestResponse = {| +node: ?{| @@ -100,8 +100,8 @@ export type MarkdownUserNameRenderer_name$key = { readonly $fragmentRefs: MarkdownUserNameRenderer_name$ref, }; ------------------------------------------------------------------------------- -import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; -import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; +import { MarkdownUserNameRenderer_name$ref } from "./MarkdownUserNameRenderer_name.graphql"; +import { PlainUserNameRenderer_name$ref } from "./PlainUserNameRenderer_name.graphql"; import { FragmentReference } from "relay-runtime"; export type NameRendererFragment$ref = FragmentReference & { _: "NameRendererFragment$ref" }; export type NameRendererFragment$fragmentType = NameRendererFragment$ref & { _: "NameRendererFragment$fragmentType" }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected index 0b3b0847b30cd..46f20ff505efe 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected @@ -18,7 +18,7 @@ fragment Test_userRenderer on PlainUserRenderer { } ==================================== OUTPUT =================================== import type { Local3DPayload } from "relay-runtime"; -import type { Test_user$ref } from "Test_user.graphql"; +import type { Test_user$ref } from "./Test_user.graphql"; export type TestVariables = {||}; export type TestResponse = {| +node: ?{| @@ -52,7 +52,7 @@ export type Test = {| rawResponse: TestRawResponse, |}; ------------------------------------------------------------------------------- -import type { Test_userRenderer$ref } from "Test_userRenderer.graphql"; +import { Test_userRenderer$ref } from "./Test_userRenderer.graphql"; import { FragmentReference } from "relay-runtime"; export type Test_user$ref = FragmentReference & { _: "Test_user$ref" }; export type Test_user$fragmentType = Test_user$ref & { _: "Test_user$fragmentType" }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected index 28ae226c177f7..d9f74cbc6c5ed 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected @@ -49,8 +49,8 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { } ==================================== OUTPUT =================================== import type { Local3DPayload } from "relay-runtime"; -import type { AnotherNameRendererFragment$ref } from "AnotherNameRendererFragment.graphql"; -import type { NameRendererFragment$ref } from "NameRendererFragment.graphql"; +import type { AnotherNameRendererFragment$ref } from "./AnotherNameRendererFragment.graphql"; +import type { NameRendererFragment$ref } from "./NameRendererFragment.graphql"; export type TestVariables = {||}; export type TestResponse = {| +node: ?{| @@ -142,8 +142,8 @@ export type Test = {| rawResponse: TestRawResponse, |}; ------------------------------------------------------------------------------- -import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; -import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; +import { MarkdownUserNameRenderer_name$ref } from "./MarkdownUserNameRenderer_name.graphql"; +import { PlainUserNameRenderer_name$ref } from "./PlainUserNameRenderer_name.graphql"; import { FragmentReference } from "relay-runtime"; export type AnotherNameRendererFragment$ref = FragmentReference & { _: "AnotherNameRendererFragment$ref" }; export type AnotherNameRendererFragment$fragmentType = AnotherNameRendererFragment$ref & { _: "AnotherNameRendererFragment$fragmentType" }; @@ -178,8 +178,8 @@ export type MarkdownUserNameRenderer_name$key = { readonly $fragmentRefs: MarkdownUserNameRenderer_name$ref, }; ------------------------------------------------------------------------------- -import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; -import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; +import { MarkdownUserNameRenderer_name$ref } from "./MarkdownUserNameRenderer_name.graphql"; +import { PlainUserNameRenderer_name$ref } from "./PlainUserNameRenderer_name.graphql"; import { FragmentReference } from "relay-runtime"; export type NameRendererFragment$ref = FragmentReference & { _: "NameRendererFragment$ref" }; export type NameRendererFragment$fragmentType = NameRendererFragment$ref & { _: "NameRendererFragment$fragmentType" }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected index 38c277115e923..93b884789fedf 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected @@ -16,7 +16,7 @@ fragment FriendFragment on User { } } ==================================== OUTPUT =================================== -import type { FriendFragment$ref } from "FriendFragment.graphql"; +import type { FriendFragment$ref } from "./FriendFragment.graphql"; export type ExampleQueryVariables = {| id: string, condition: boolean, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected index 291580c1e4d87..e085e6c53e4a5 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected @@ -22,7 +22,7 @@ fragment FriendFragment on User { } } ==================================== OUTPUT =================================== -import type { FriendFragment$ref } from "FriendFragment.graphql"; +import type { FriendFragment$ref } from "./FriendFragment.graphql"; export type ExampleQueryVariables = {| id: string |}; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected index 278de8553f0b0..fd2c61fbaa192 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected @@ -67,7 +67,7 @@ export type RecursiveFragment$key = { readonly $fragmentRefs: RecursiveFragment$ref, }; ------------------------------------------------------------------------------- -import type { PhotoFragment$ref } from "PhotoFragment.graphql"; +import { PhotoFragment$ref } from "./PhotoFragment.graphql"; import { FragmentReference } from "relay-runtime"; export type UserProfile$ref = FragmentReference & { _: "UserProfile$ref" }; export type UserProfile$fragmentType = UserProfile$ref & { _: "UserProfile$fragmentType" }; From 18ad02800361531eebe43baa7587d97fbb2ea5ae Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Sat, 17 Oct 2020 18:11:15 +0200 Subject: [PATCH 02/41] Reduce code duplication for writing AST. --- compiler/crates/relay-typegen/src/lib.rs | 214 +++++++++-------------- 1 file changed, 79 insertions(+), 135 deletions(-) diff --git a/compiler/crates/relay-typegen/src/lib.rs b/compiler/crates/relay-typegen/src/lib.rs index 8b488e472aa11..57483c6661dae 100644 --- a/compiler/crates/relay-typegen/src/lib.rs +++ b/compiler/crates/relay-typegen/src/lib.rs @@ -57,6 +57,12 @@ lazy_static! { static ref JS_FIELD_NAME: StringKey = "js".intern(); } +macro_rules! write_ast { + ($self:ident, $ast:expr) => { + ::std::writeln!($self.result, "{}", $self.writer.write_ast(&$ast)) + }; +} + pub fn generate_fragment_type( fragment: &FragmentDefinition, schema: &Schema, @@ -170,21 +176,13 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { } self.write_enum_definitions()?; self.write_input_object_types()?; - writeln!( - self.result, - "{}", - self.writer.write_ast(&AST::ExportTypeEquals( - input_variables_identifier, - Box::from(input_variables_type) - )) + write_ast!( + self, + AST::ExportTypeEquals(input_variables_identifier, Box::from(input_variables_type),) )?; - writeln!( - self.result, - "{}", - self.writer.write_ast(&AST::ExportTypeEquals( - response_identifier, - Box::from(response_type) - )), + write_ast!( + self, + AST::ExportTypeEquals(response_identifier, Box::from(response_type),) )?; let mut operation_types = vec![ @@ -204,22 +202,13 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { if let Some(raw_response_type) = raw_response_type { for (key, ast) in self.match_fields.iter() { - writeln!( - self.result, - "{}", - self.writer - .write_ast(&AST::ExportTypeEquals(*key, Box::from(ast.clone()))) - )?; + write_ast!(self, AST::ExportTypeEquals(*key, Box::from(ast.clone())))?; } let raw_response_identifier = format!("{}RawResponse", typegen_operation.name.item).intern(); - writeln!( - self.result, - "{}", - self.writer.write_ast(&AST::ExportTypeEquals( - raw_response_identifier, - Box::from(raw_response_type) - )) + write_ast!( + self, + AST::ExportTypeEquals(raw_response_identifier, Box::from(raw_response_type),) )?; operation_types.push(Prop { key: *KEY_RAW_RESPONSE, @@ -229,13 +218,12 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { }) } - writeln!( - self.result, - "{}", - self.writer.write_ast(&AST::ExportTypeEquals( + write_ast!( + self, + AST::ExportTypeEquals( typegen_operation.name.item, - Box::from(AST::ExactObject(operation_types)) - )) + Box::from(AST::ExactObject(operation_types)), + ) )?; Ok(()) } @@ -319,61 +307,41 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { let refetchable_metadata = extract_refetch_metadata_from_directive(&node.directives); if let Some(refetchable_metadata) = refetchable_metadata { - writeln!( - self.result, - "{}", - self.writer.write_ast(&AST::ImportType( + write_ast!( + self, + AST::ImportType( vec![old_fragment_type_name, new_fragment_type_name], - format!("{}.graphql", refetchable_metadata.operation_name).intern() - )) + format!("{}.graphql", refetchable_metadata.operation_name).intern(), + ) )?; - writeln!( - self.result, - "{}", - self.writer.write_ast(&AST::ExportList(vec![ - old_fragment_type_name, - new_fragment_type_name - ])) + write_ast!( + self, + AST::ExportList(vec![old_fragment_type_name, new_fragment_type_name,]) )?; } else { - writeln!( - self.result, - "{}", - self.writer.write_ast(&AST::DeclareExportOpaqueType( - old_fragment_type_name, - "FragmentReference".intern() - )) + write_ast!( + self, + AST::DeclareExportOpaqueType(old_fragment_type_name, "FragmentReference".intern(),) )?; - writeln!( - self.result, - "{}", - self.writer.write_ast(&AST::DeclareExportOpaqueType( - new_fragment_type_name, - old_fragment_type_name - )) + write_ast!( + self, + AST::DeclareExportOpaqueType(new_fragment_type_name, old_fragment_type_name,) )?; } - writeln!( - self.result, - "{}", - self.writer - .write_ast(&AST::ExportTypeEquals(node.name.item, Box::from(type_))) + write_ast!( + self, + AST::ExportTypeEquals(node.name.item, Box::from(type_)) )?; - writeln!( - self.result, - "{}", - self.writer.write_ast(&AST::ExportTypeEquals( + write_ast!( + self, + AST::ExportTypeEquals( data_type_name.intern(), - Box::from(AST::RawType(data_type.intern())) - )) + Box::from(AST::RawType(data_type.intern())), + ) )?; - writeln!( - self.result, - "{}", - self.writer.write_ast(&AST::ExportTypeEquals( - ref_type_name.intern(), - Box::from(ref_type) - )) + write_ast!( + self, + AST::ExportTypeEquals(ref_type_name.intern(), Box::from(ref_type),) )?; Ok(()) @@ -1020,35 +988,26 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { RuntimeImports { local_3d_payload: true, fragment_reference: true, - } => writeln!( - self.result, - "{}", - self.writer.write_ast(&AST::ImportType( + } => write_ast!( + self, + AST::ImportType( vec!["FragmentReference".intern(), "Local3DPayload".intern()], - "relay-runtime".intern() - )) + "relay-runtime".intern(), + ) ), RuntimeImports { local_3d_payload: true, fragment_reference: false, - } => writeln!( - self.result, - "{}", - self.writer.write_ast(&AST::ImportType( - vec!["Local3DPayload".intern()], - "relay-runtime".intern() - )) + } => write_ast!( + self, + AST::ImportType(vec!["Local3DPayload".intern()], "relay-runtime".intern(),) ), RuntimeImports { local_3d_payload: false, fragment_reference: true, - } => writeln!( - self.result, - "{}", - self.writer.write_ast(&AST::ImportType( - vec!["FragmentReference".intern()], - "relay-runtime".intern() - )) + } => write_ast!( + self, + AST::ImportType(vec!["FragmentReference".intern()], "relay-runtime".intern(),) ), RuntimeImports { local_3d_payload: false, @@ -1066,13 +1025,12 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { // if (state.useHaste) { // // TODO(T22653277) support non-haste environments when importing // // fragments - writeln!( - self.result, - "{}", - self.writer.write_ast(&AST::ImportType( + write_ast!( + self, + AST::ImportType( vec![fragment_type_name], - format!("./{}.graphql", used_fragment).intern() - )) + format!("./{}.graphql", used_fragment).intern(), + ) )?; // } else if (state.useSingleArtifactDirectory) { // imports.push( @@ -1092,21 +1050,13 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { ) -> Result { let old_fragment_type_name = format!("{}$ref", refetchable_fragment_name).intern(); let new_fragment_type_name = format!("{}$fragmentType", refetchable_fragment_name).intern(); - writeln!( - self.result, - "{}", - self.writer.write_ast(&AST::DeclareExportOpaqueType( - old_fragment_type_name, - "FragmentReference".intern() - )) + write_ast!( + self, + AST::DeclareExportOpaqueType(old_fragment_type_name, "FragmentReference".intern(),) )?; - writeln!( - self.result, - "{}", - self.writer.write_ast(&AST::DeclareExportOpaqueType( - new_fragment_type_name, - old_fragment_type_name - )) + write_ast!( + self, + AST::DeclareExportOpaqueType(new_fragment_type_name, old_fragment_type_name,) )?; Ok(()) } @@ -1117,13 +1067,12 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { for enum_id in enum_ids { let enum_type = self.schema.enum_(enum_id); if let Some(enum_module_suffix) = &self.typegen_config.enum_module_suffix { - writeln!( - self.result, - "{}", - self.writer.write_ast(&AST::ImportType( + write_ast!( + self, + AST::ImportType( vec![enum_type.name], format!("{}{}", enum_type.name, enum_module_suffix).intern() - )) + ) )?; } else { let mut members: Vec = enum_type @@ -1132,13 +1081,9 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { .map(|enum_value| AST::StringLiteral(enum_value.value)) .collect(); members.push(AST::StringLiteral(*FUTURE_ENUM_VALUE)); - writeln!( - self.result, - "{}", - self.writer.write_ast(&AST::ExportTypeEquals( - enum_type.name, - Box::from(AST::Union(members)) - )) + write_ast!( + self, + AST::ExportTypeEquals(enum_type.name, Box::from(AST::Union(members))) )?; } } @@ -1163,13 +1108,12 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { for (type_identifier, input_object_type) in self.generated_input_object_types.iter() { match input_object_type { GeneratedInputObject::Resolved(input_object_type) => { - writeln!( - self.result, - "{}", - self.writer.write_ast(&AST::ExportTypeEquals( + write_ast!( + self, + AST::ExportTypeEquals( type_identifier.clone(), Box::from(input_object_type.clone()) - )) + ) )?; } GeneratedInputObject::Pending => panic!("expected a resolved type here"), From c95f333adcd18268029fe305b8ffaefc0762ef59 Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Sat, 17 Oct 2020 18:33:35 +0200 Subject: [PATCH 03/41] Fix some typescript tests using Flow typing instead. --- .../fixtures/linked-field.expected | 22 +- .../fixtures/match-field-in-query.expected | 28 +- .../mutaion-with-client-extension.expected | 52 --- .../mutation-input-has-array.expected | 48 +- .../mutation-with-client-extension.expected | 52 +++ ...=> mutation-with-client-extension.graphql} | 0 .../mutation-with-enums-on-fragment.expected | 106 ++--- .../mutation-with-nested-fragments.expected | 104 ++--- ...ith-response-on-inline-fragments.expected} | 110 ++--- ...with-response-on-inline-fragments.graphql} | 0 .../fixtures/mutation.expected | 56 +-- .../fixtures/query-with-handles.expected | 84 ++-- .../fixtures/query-with-match-fields.expected | 100 ++-- .../fixtures/query-with-module-field.expected | 60 ++- .../query-with-multiple-match-fields.expected | 172 ++++--- ...-with-raw-response-on-conditional.expected | 50 +- ...w-response-on-literal-conditional.expected | 42 +- .../query-with-stream-connection.expected | 90 ++-- .../fixtures/query-with-stream.expected | 76 +-- .../fixtures/refetchable-fragment.expected | 24 +- .../fixtures/refetchable.expected | 24 +- .../fixtures/relay-client-id-field.expected | 52 +-- .../required-bubbles-to-query.expected | 18 +- ...d-bubbles-up-to-mutation-response.expected | 44 +- .../required-raw-response-type.expected | 30 +- ...red-throw-doesnt-bubbles-to-query.expected | 18 +- .../fixtures/required-throws-nested.expected | 18 +- .../fixtures/required.expected | 18 +- .../fixtures/roots.expected | 94 ++-- .../tests/generate_typescript/mod.rs | 9 +- .../tests/generate_typescript_test.rs | 442 +++++++++++++++--- 31 files changed, 1159 insertions(+), 884 deletions(-) delete mode 100644 compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutaion-with-client-extension.expected create mode 100644 compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-client-extension.expected rename compiler/crates/relay-typegen/tests/generate_typescript/fixtures/{mutaion-with-client-extension.graphql => mutation-with-client-extension.graphql} (100%) rename compiler/crates/relay-typegen/tests/generate_typescript/fixtures/{mutaion-with-response-on-inline-fragments.expected => mutation-with-response-on-inline-fragments.expected} (54%) rename compiler/crates/relay-typegen/tests/generate_typescript/fixtures/{mutaion-with-response-on-inline-fragments.graphql => mutation-with-response-on-inline-fragments.graphql} (100%) diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected index ec60fce46e30a..0838629157fba 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected @@ -27,21 +27,21 @@ query UnionTypeTest { } } ==================================== OUTPUT =================================== -export type UnionTypeTestVariables = {||}; -export type UnionTypeTestResponse = {| - +neverNode: ?({| - +__typename: "FakeNode", - +id: string, - |} | {| +export type UnionTypeTestVariables = {}; +export type UnionTypeTestResponse = { + readonly neverNode?: { + readonly __typename: "FakeNode", + readonly id: string, + } | { // This will never be '%other', but we need some // value in case none of the concrete values match. - +__typename: "%other" - |}) -|}; -export type UnionTypeTest = {| + readonly __typename: "%other" + } +}; +export type UnionTypeTest = { variables: UnionTypeTestVariables, response: UnionTypeTestResponse, -|}; +}; ------------------------------------------------------------------------------- import { FragmentReference } from "relay-runtime"; export type LinkedField$ref = FragmentReference & { _: "LinkedField$ref" }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected index b034d81eeda7f..8bacb5672c0a0 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected @@ -23,22 +23,22 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { } } ==================================== OUTPUT =================================== -import type { MarkdownUserNameRenderer_name$ref } from "./MarkdownUserNameRenderer_name.graphql"; -import type { PlainUserNameRenderer_name$ref } from "./PlainUserNameRenderer_name.graphql"; -export type NameRendererQueryVariables = {||}; -export type NameRendererQueryResponse = {| - +me: ?{| - +nameRenderer: ?{| - +__fragmentPropName?: ?string, - +__module_component?: ?string, - +$fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, - |} - |} -|}; -export type NameRendererQuery = {| +import { MarkdownUserNameRenderer_name$ref } from "./MarkdownUserNameRenderer_name.graphql"; +import { PlainUserNameRenderer_name$ref } from "./PlainUserNameRenderer_name.graphql"; +export type NameRendererQueryVariables = {}; +export type NameRendererQueryResponse = { + readonly me?: { + readonly nameRenderer?: { + readonly __fragmentPropName?: string, + readonly __module_component?: string, + readonly $fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, + } + } +}; +export type NameRendererQuery = { variables: NameRendererQueryVariables, response: NameRendererQueryResponse, -|}; +}; ------------------------------------------------------------------------------- import { FragmentReference } from "relay-runtime"; export type MarkdownUserNameRenderer_name$ref = FragmentReference & { _: "MarkdownUserNameRenderer_name$ref" }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutaion-with-client-extension.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutaion-with-client-extension.expected deleted file mode 100644 index 19a6626bbbe1c..0000000000000 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutaion-with-client-extension.expected +++ /dev/null @@ -1,52 +0,0 @@ -==================================== INPUT ==================================== -mutation Test($input: UpdateAllSeenStateInput) @raw_response_type { - viewerNotificationsUpdateAllSeenState(input: $input) { - stories { - foos { - bar - } - } - } -} - -#%extensions% - -extend type Story { - foos: [Foo] -} - -type Foo { - bar: String -} -==================================== OUTPUT =================================== -export type UpdateAllSeenStateInput = {| - clientMutationId?: ?string, - storyIds?: ?$ReadOnlyArray, -|}; -export type TestVariables = {| - input?: ?UpdateAllSeenStateInput -|}; -export type TestResponse = {| - +viewerNotificationsUpdateAllSeenState: ?{| - +stories: ?$ReadOnlyArray - |}> - |} -|}; -export type TestRawResponse = {| - +viewerNotificationsUpdateAllSeenState: ?{| - +stories: ?$ReadOnlyArray, - |}> - |} -|}; -export type Test = {| - variables: TestVariables, - response: TestResponse, - rawResponse: TestRawResponse, -|}; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-input-has-array.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-input-has-array.expected index 6a3454c07951e..f0325bbb92445 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-input-has-array.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-input-has-array.expected @@ -7,30 +7,30 @@ mutation InputHasArray($input: UpdateAllSeenStateInput) @raw_response_type { } } ==================================== OUTPUT =================================== -export type UpdateAllSeenStateInput = {| - clientMutationId?: ?string, - storyIds?: ?$ReadOnlyArray, -|}; -export type InputHasArrayVariables = {| - input?: ?UpdateAllSeenStateInput -|}; -export type InputHasArrayResponse = {| - +viewerNotificationsUpdateAllSeenState: ?{| - +stories: ?$ReadOnlyArray - |} -|}; -export type InputHasArrayRawResponse = {| - +viewerNotificationsUpdateAllSeenState: ?{| - +stories: ?$ReadOnlyArray - |} -|}; -export type InputHasArray = {| +export type UpdateAllSeenStateInput = { + clientMutationId?: string, + storyIds?: ReadonlyArray, +}; +export type InputHasArrayVariables = { + input?: UpdateAllSeenStateInput +}; +export type InputHasArrayResponse = { + readonly viewerNotificationsUpdateAllSeenState?: { + readonly stories?: ReadonlyArray<{ + readonly actorCount?: number + } | null> + } +}; +export type InputHasArrayRawResponse = { + readonly viewerNotificationsUpdateAllSeenState?: { + readonly stories?: ReadonlyArray<{ + readonly actorCount?: number, + readonly id: string, + } | null> + } +}; +export type InputHasArray = { variables: InputHasArrayVariables, response: InputHasArrayResponse, rawResponse: InputHasArrayRawResponse, -|}; +}; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-client-extension.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-client-extension.expected new file mode 100644 index 0000000000000..4a2ac9ea06ad6 --- /dev/null +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-client-extension.expected @@ -0,0 +1,52 @@ +==================================== INPUT ==================================== +mutation Test($input: UpdateAllSeenStateInput) @raw_response_type { + viewerNotificationsUpdateAllSeenState(input: $input) { + stories { + foos { + bar + } + } + } +} + +#%extensions% + +extend type Story { + foos: [Foo] +} + +type Foo { + bar: String +} +==================================== OUTPUT =================================== +export type UpdateAllSeenStateInput = { + clientMutationId?: string, + storyIds?: ReadonlyArray, +}; +export type TestVariables = { + input?: UpdateAllSeenStateInput +}; +export type TestResponse = { + readonly viewerNotificationsUpdateAllSeenState?: { + readonly stories?: ReadonlyArray<{ + readonly foos?: ReadonlyArray<{ + readonly bar?: string + } | null> + } | null> + } +}; +export type TestRawResponse = { + readonly viewerNotificationsUpdateAllSeenState?: { + readonly stories?: ReadonlyArray<{ + readonly id: string, + readonly foos?: ReadonlyArray<{ + readonly bar?: string + } | null>, + } | null> + } +}; +export type Test = { + variables: TestVariables, + response: TestResponse, + rawResponse: TestRawResponse, +}; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutaion-with-client-extension.graphql b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-client-extension.graphql similarity index 100% rename from compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutaion-with-client-extension.graphql rename to compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-client-extension.graphql diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected index bf4444dc60b7f..40490a1c9dcf9 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected @@ -27,64 +27,64 @@ fragment FriendFragment on User { } } ==================================== OUTPUT =================================== -import type { FriendFragment$ref } from "./FriendFragment.graphql"; +import { FriendFragment$ref } from "./FriendFragment.graphql"; export type TestEnums = "mark" | "zuck" | "%future added value"; -export type CommentCreateInput = {| - clientMutationId?: ?string, - feedbackId?: ?string, - feedback?: ?CommentfeedbackFeedback, -|}; -export type CommentfeedbackFeedback = {| - comment?: ?FeedbackcommentComment -|}; -export type FeedbackcommentComment = {| - feedback?: ?CommentfeedbackFeedback -|}; -export type CommentCreateMutationVariables = {| +export type CommentCreateInput = { + clientMutationId?: string, + feedbackId?: string, + feedback?: CommentfeedbackFeedback, +}; +export type CommentfeedbackFeedback = { + comment?: FeedbackcommentComment +}; +export type FeedbackcommentComment = { + feedback?: CommentfeedbackFeedback +}; +export type CommentCreateMutationVariables = { input: CommentCreateInput, - first?: ?number, - orderBy?: ?$ReadOnlyArray, -|}; -export type CommentCreateMutationResponse = {| - +commentCreate: ?{| - +comment: ?{| - +friends: ?{| - +edges: ?$ReadOnlyArray - |} - |} - |} -|}; -export type CommentCreateMutationRawResponse = {| - +commentCreate: ?{| - +comment: ?{| - +friends: ?{| - +edges: ?$ReadOnlyArray - |}, - +id: string, - |} - |} -|}; -export type CommentCreateMutation = {| + first?: number, + orderBy?: ReadonlyArray, +}; +export type CommentCreateMutationResponse = { + readonly commentCreate?: { + readonly comment?: { + readonly friends?: { + readonly edges?: ReadonlyArray<{ + readonly node?: { + readonly id: string, + readonly __typename: string, + readonly $fragmentRefs: FriendFragment$ref, + } + } | null> + } + } + } +}; +export type CommentCreateMutationRawResponse = { + readonly commentCreate?: { + readonly comment?: { + readonly friends?: { + readonly edges?: ReadonlyArray<{ + readonly node?: { + readonly id: string, + readonly __typename: "User", + readonly name?: string, + readonly lastName?: string, + readonly profilePicture2?: { + readonly test_enums?: TestEnums + }, + } + } | null> + }, + readonly id: string, + } + } +}; +export type CommentCreateMutation = { variables: CommentCreateMutationVariables, response: CommentCreateMutationResponse, rawResponse: CommentCreateMutationRawResponse, -|}; +}; ------------------------------------------------------------------------------- export type TestEnums = "mark" | "zuck" | "%future added value"; import { FragmentReference } from "relay-runtime"; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected index 2d74ffeeb6510..4c9fb27e9e20a 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected @@ -31,62 +31,62 @@ fragment FeedbackFragment on Feedback { name } ==================================== OUTPUT =================================== -import type { FriendFragment$ref } from "./FriendFragment.graphql"; -export type CommentCreateInput = {| - clientMutationId?: ?string, - feedbackId?: ?string, - feedback?: ?CommentfeedbackFeedback, -|}; -export type CommentfeedbackFeedback = {| - comment?: ?FeedbackcommentComment -|}; -export type FeedbackcommentComment = {| - feedback?: ?CommentfeedbackFeedback -|}; -export type CommentCreateMutationVariables = {| +import { FriendFragment$ref } from "./FriendFragment.graphql"; +export type CommentCreateInput = { + clientMutationId?: string, + feedbackId?: string, + feedback?: CommentfeedbackFeedback, +}; +export type CommentfeedbackFeedback = { + comment?: FeedbackcommentComment +}; +export type FeedbackcommentComment = { + feedback?: CommentfeedbackFeedback +}; +export type CommentCreateMutationVariables = { input: CommentCreateInput, - first?: ?number, - orderBy?: ?$ReadOnlyArray, -|}; -export type CommentCreateMutationResponse = {| - +commentCreate: ?{| - +comment: ?{| - +friends: ?{| - +edges: ?$ReadOnlyArray - |} - |} - |} -|}; -export type CommentCreateMutationRawResponse = {| - +commentCreate: ?{| - +comment: ?{| - +friends: ?{| - +edges: ?$ReadOnlyArray - |}, - +id: string, - |} - |} -|}; -export type CommentCreateMutation = {| + first?: number, + orderBy?: ReadonlyArray, +}; +export type CommentCreateMutationResponse = { + readonly commentCreate?: { + readonly comment?: { + readonly friends?: { + readonly edges?: ReadonlyArray<{ + readonly node?: { + readonly lastName?: string, + readonly $fragmentRefs: FriendFragment$ref, + } + } | null> + } + } + } +}; +export type CommentCreateMutationRawResponse = { + readonly commentCreate?: { + readonly comment?: { + readonly friends?: { + readonly edges?: ReadonlyArray<{ + readonly node?: { + readonly lastName?: string, + readonly name?: string, + readonly feedback?: { + readonly id: string, + readonly name?: string, + }, + readonly id: string, + } + } | null> + }, + readonly id: string, + } + } +}; +export type CommentCreateMutation = { variables: CommentCreateMutationVariables, response: CommentCreateMutationResponse, rawResponse: CommentCreateMutationRawResponse, -|}; +}; ------------------------------------------------------------------------------- import { FragmentReference } from "relay-runtime"; export type FeedbackFragment$ref = FragmentReference & { _: "FeedbackFragment$ref" }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutaion-with-response-on-inline-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected similarity index 54% rename from compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutaion-with-response-on-inline-fragments.expected rename to compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected index 44b2787736db4..f194dc1816161 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutaion-with-response-on-inline-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected @@ -27,65 +27,65 @@ fragment InlineFragmentWithOverlappingFields on Actor { } } ==================================== OUTPUT =================================== -import type { InlineFragmentWithOverlappingFields$ref } from "./InlineFragmentWithOverlappingFields.graphql"; -export type CommentCreateInput = {| - clientMutationId?: ?string, - feedbackId?: ?string, - feedback?: ?CommentfeedbackFeedback, -|}; -export type CommentfeedbackFeedback = {| - comment?: ?FeedbackcommentComment -|}; -export type FeedbackcommentComment = {| - feedback?: ?CommentfeedbackFeedback -|}; -export type TestMutationVariables = {| +import { InlineFragmentWithOverlappingFields$ref } from "./InlineFragmentWithOverlappingFields.graphql"; +export type CommentCreateInput = { + clientMutationId?: string, + feedbackId?: string, + feedback?: CommentfeedbackFeedback, +}; +export type CommentfeedbackFeedback = { + comment?: FeedbackcommentComment +}; +export type FeedbackcommentComment = { + feedback?: CommentfeedbackFeedback +}; +export type TestMutationVariables = { input: CommentCreateInput -|}; -export type TestMutationResponse = {| - +commentCreate: ?{| - +viewer: ?{| - +actor: ?{| - +$fragmentRefs: InlineFragmentWithOverlappingFields$ref - |} - |} - |} -|}; -export type TestMutationRawResponse = {| - +commentCreate: ?{| - +viewer: ?{| - +actor: ?({| - +__typename: "User", - +__isActor: "User", - +id: string, - +hometown: ?{| - +id: string, - +name: ?string, - |}, - |} | {| - +__typename: "Page", - +__isActor: "Page", - +id: string, - +name: ?string, - +hometown: ?{| - +id: string, - +message: ?{| - +text: ?string - |}, - |}, - |} | {| - +__typename: string, - +__isActor: string, - +id: string, - |}) - |} - |} -|}; -export type TestMutation = {| +}; +export type TestMutationResponse = { + readonly commentCreate?: { + readonly viewer?: { + readonly actor?: { + readonly $fragmentRefs: InlineFragmentWithOverlappingFields$ref + } + } + } +}; +export type TestMutationRawResponse = { + readonly commentCreate?: { + readonly viewer?: { + readonly actor?: { + readonly __typename: "User", + readonly __isActor: "User", + readonly id: string, + readonly hometown?: { + readonly id: string, + readonly name?: string, + }, + } | { + readonly __typename: "Page", + readonly __isActor: "Page", + readonly id: string, + readonly name?: string, + readonly hometown?: { + readonly id: string, + readonly message?: { + readonly text?: string + }, + }, + } | { + readonly __typename: string, + readonly __isActor: string, + readonly id: string, + } + } + } +}; +export type TestMutation = { variables: TestMutationVariables, response: TestMutationResponse, rawResponse: TestMutationRawResponse, -|}; +}; ------------------------------------------------------------------------------- import { FragmentReference } from "relay-runtime"; export type InlineFragmentWithOverlappingFields$ref = FragmentReference & { _: "InlineFragmentWithOverlappingFields$ref" }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutaion-with-response-on-inline-fragments.graphql b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.graphql similarity index 100% rename from compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutaion-with-response-on-inline-fragments.graphql rename to compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.graphql diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation.expected index 73dfff5c2df67..8550cc110a956 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation.expected @@ -15,34 +15,34 @@ mutation CommentCreateMutation( } } ==================================== OUTPUT =================================== -export type CommentCreateInput = {| - clientMutationId?: ?string, - feedbackId?: ?string, - feedback?: ?CommentfeedbackFeedback, -|}; -export type CommentfeedbackFeedback = {| - comment?: ?FeedbackcommentComment -|}; -export type FeedbackcommentComment = {| - feedback?: ?CommentfeedbackFeedback -|}; -export type CommentCreateMutationVariables = {| +export type CommentCreateInput = { + clientMutationId?: string, + feedbackId?: string, + feedback?: CommentfeedbackFeedback, +}; +export type CommentfeedbackFeedback = { + comment?: FeedbackcommentComment +}; +export type FeedbackcommentComment = { + feedback?: CommentfeedbackFeedback +}; +export type CommentCreateMutationVariables = { input: CommentCreateInput, - first?: ?number, - orderBy?: ?$ReadOnlyArray, -|}; -export type CommentCreateMutationResponse = {| - +commentCreate: ?{| - +comment: ?{| - +id: string, - +name: ?string, - +friends: ?{| - +count: ?number - |}, - |} - |} -|}; -export type CommentCreateMutation = {| + first?: number, + orderBy?: ReadonlyArray, +}; +export type CommentCreateMutationResponse = { + readonly commentCreate?: { + readonly comment?: { + readonly id: string, + readonly name?: string, + readonly friends?: { + readonly count?: number + }, + } + } +}; +export type CommentCreateMutation = { variables: CommentCreateMutationVariables, response: CommentCreateMutationResponse, -|}; +}; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-handles.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-handles.expected index 54fdc48eb8006..939cbfb833a25 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-handles.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-handles.expected @@ -17,54 +17,54 @@ query ScalarHandleField($id: ID!) @raw_response_type { } } ==================================== OUTPUT =================================== -export type LinkedHandleFieldVariables = {| +export type LinkedHandleFieldVariables = { id: string -|}; -export type LinkedHandleFieldResponse = {| - +node: ?{| - +friends?: ?{| - +count: ?number - |} - |} -|}; -export type LinkedHandleFieldRawResponse = {| - +node: ?({| - +__typename: "User", - +id: string, - +friends: ?{| - +count: ?number - |}, - |} | {| - +__typename: string, - +id: string, - |}) -|}; -export type LinkedHandleField = {| +}; +export type LinkedHandleFieldResponse = { + readonly node?: { + readonly friends?: { + readonly count?: number + } + } +}; +export type LinkedHandleFieldRawResponse = { + readonly node?: { + readonly __typename: "User", + readonly id: string, + readonly friends?: { + readonly count?: number + }, + } | { + readonly __typename: string, + readonly id: string, + } +}; +export type LinkedHandleField = { variables: LinkedHandleFieldVariables, response: LinkedHandleFieldResponse, rawResponse: LinkedHandleFieldRawResponse, -|}; +}; ------------------------------------------------------------------------------- -export type ScalarHandleFieldVariables = {| +export type ScalarHandleFieldVariables = { id: string -|}; -export type ScalarHandleFieldResponse = {| - +node: ?{| - +name?: ?string - |} -|}; -export type ScalarHandleFieldRawResponse = {| - +node: ?({| - +__typename: "User", - +id: string, - +name: ?string, - |} | {| - +__typename: string, - +id: string, - |}) -|}; -export type ScalarHandleField = {| +}; +export type ScalarHandleFieldResponse = { + readonly node?: { + readonly name?: string + } +}; +export type ScalarHandleFieldRawResponse = { + readonly node?: { + readonly __typename: "User", + readonly id: string, + readonly name?: string, + } | { + readonly __typename: string, + readonly id: string, + } +}; +export type ScalarHandleField = { variables: ScalarHandleFieldVariables, response: ScalarHandleFieldResponse, rawResponse: ScalarHandleFieldRawResponse, -|}; +}; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected index 9e5e67a484dcf..9111f41bbd246 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected @@ -28,61 +28,57 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { } } ==================================== OUTPUT =================================== -import type { Local3DPayload } from "relay-runtime"; -import type { NameRendererFragment$ref } from "./NameRendererFragment.graphql"; -export type TestVariables = {||}; -export type TestResponse = {| - +node: ?{| - +$fragmentRefs: NameRendererFragment$ref - |} -|}; -export type PlainUserNameRenderer_name = {| - +plaintext: ?string, - +data: ?{| - +text: ?string, - +id: ?string, - |}, -|}; -export type MarkdownUserNameRenderer_name = {| - +markdown: ?string, - +data: ?{| - +markup: ?string, - +id: ?string, - |}, -|}; -export type TestRawResponse = {| - +node: ?({| - +__typename: "User", - +id: string, - +nameRenderer: ?({| - +__typename: "PlainUserNameRenderer", - +__module_operation_NameRendererFragment: ?any, - +__module_component_NameRendererFragment: ?any, - ...PlainUserNameRenderer_name, - |} | Local3DPayload<"NameRendererFragment", {| - +__typename: "PlainUserNameRenderer", - ...PlainUserNameRenderer_name, - |}> | {| - +__typename: "MarkdownUserNameRenderer", - +__module_operation_NameRendererFragment: ?any, - +__module_component_NameRendererFragment: ?any, - ...MarkdownUserNameRenderer_name, - |} | Local3DPayload<"NameRendererFragment", {| - +__typename: "MarkdownUserNameRenderer", - ...MarkdownUserNameRenderer_name, - |}> | {| - +__typename: string - |}), - |} | {| - +__typename: string, - +id: string, - |}) -|}; -export type Test = {| +import { Local3DPayload } from "relay-runtime"; +import { NameRendererFragment$ref } from "./NameRendererFragment.graphql"; +export type TestVariables = {}; +export type TestResponse = { + readonly node?: { + readonly $fragmentRefs: NameRendererFragment$ref + } +}; +export type PlainUserNameRenderer_name = { + readonly plaintext?: string, + readonly data?: { + readonly text?: string, + readonly id?: string, + }, +}; +export type MarkdownUserNameRenderer_name = { + readonly markdown?: string, + readonly data?: { + readonly markup?: string, + readonly id?: string, + }, +}; +export type TestRawResponse = { + readonly node?: { + readonly __typename: "User", + readonly id: string, + readonly nameRenderer?: { + readonly __typename: "PlainUserNameRenderer", + readonly __module_operation_NameRendererFragment?: any, + readonly __module_component_NameRendererFragment?: any, + } | Local3DPayload<"NameRendererFragment", { + readonly __typename: "PlainUserNameRenderer", + }> | { + readonly __typename: "MarkdownUserNameRenderer", + readonly __module_operation_NameRendererFragment?: any, + readonly __module_component_NameRendererFragment?: any, + } | Local3DPayload<"NameRendererFragment", { + readonly __typename: "MarkdownUserNameRenderer", + }> | { + readonly __typename: string + }, + } | { + readonly __typename: string, + readonly id: string, + } +}; +export type Test = { variables: TestVariables, response: TestResponse, rawResponse: TestRawResponse, -|}; +}; ------------------------------------------------------------------------------- import { FragmentReference } from "relay-runtime"; export type MarkdownUserNameRenderer_name$ref = FragmentReference & { _: "MarkdownUserNameRenderer_name$ref" }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected index 46f20ff505efe..ec9c77cb5ed88 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected @@ -17,40 +17,38 @@ fragment Test_userRenderer on PlainUserRenderer { } } ==================================== OUTPUT =================================== -import type { Local3DPayload } from "relay-runtime"; -import type { Test_user$ref } from "./Test_user.graphql"; -export type TestVariables = {||}; -export type TestResponse = {| - +node: ?{| - +$fragmentRefs: Test_user$ref - |} -|}; -export type Test_userRenderer = {| - +user: ?{| - +username: ?string, - +id: string, - |} -|}; -export type TestRawResponse = {| - +node: ?({| - +__typename: "User", - +id: string, - +plainUserRenderer: ?({| - +__module_operation_Test_user: ?any, - +__module_component_Test_user: ?any, - ...Test_userRenderer, - |} | Local3DPayload<"Test_user", {| ...Test_userRenderer - |}>), - |} | {| - +__typename: string, - +id: string, - |}) -|}; -export type Test = {| +import { Local3DPayload } from "relay-runtime"; +import { Test_user$ref } from "./Test_user.graphql"; +export type TestVariables = {}; +export type TestResponse = { + readonly node?: { + readonly $fragmentRefs: Test_user$ref + } +}; +export type Test_userRenderer = { + readonly user?: { + readonly username?: string, + readonly id: string, + } +}; +export type TestRawResponse = { + readonly node?: { + readonly __typename: "User", + readonly id: string, + readonly plainUserRenderer?: { + readonly __module_operation_Test_user?: any, + readonly __module_component_Test_user?: any, + } | Local3DPayload<"Test_user", {}>, + } | { + readonly __typename: string, + readonly id: string, + } +}; +export type Test = { variables: TestVariables, response: TestResponse, rawResponse: TestRawResponse, -|}; +}; ------------------------------------------------------------------------------- import { Test_userRenderer$ref } from "./Test_userRenderer.graphql"; import { FragmentReference } from "relay-runtime"; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected index d9f74cbc6c5ed..3ee5c728751be 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected @@ -48,99 +48,91 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { } } ==================================== OUTPUT =================================== -import type { Local3DPayload } from "relay-runtime"; -import type { AnotherNameRendererFragment$ref } from "./AnotherNameRendererFragment.graphql"; -import type { NameRendererFragment$ref } from "./NameRendererFragment.graphql"; -export type TestVariables = {||}; -export type TestResponse = {| - +node: ?{| - +username?: ?string, - +$fragmentRefs: NameRendererFragment$ref, - |}, - +viewer: ?{| - +actor: ?{| - +name?: ?string, - +$fragmentRefs: AnotherNameRendererFragment$ref, - |} - |}, -|}; -export type PlainUserNameRenderer_name = {| - +plaintext: ?string, - +data: ?{| - +text: ?string, - +id: ?string, - |}, -|}; -export type MarkdownUserNameRenderer_name = {| - +markdown: ?string, - +data: ?{| - +markup: ?string, - +id: ?string, - |}, -|}; -export type TestRawResponse = {| - +node: ?({| - +__typename: "User", - +id: string, - +username: ?string, - +nameRenderer: ?({| - +__typename: "PlainUserNameRenderer", - +__module_operation_NameRendererFragment: ?any, - +__module_component_NameRendererFragment: ?any, - ...PlainUserNameRenderer_name, - |} | Local3DPayload<"NameRendererFragment", {| - +__typename: "PlainUserNameRenderer", - ...PlainUserNameRenderer_name, - |}> | {| - +__typename: "MarkdownUserNameRenderer", - +__module_operation_NameRendererFragment: ?any, - +__module_component_NameRendererFragment: ?any, - ...MarkdownUserNameRenderer_name, - |} | Local3DPayload<"NameRendererFragment", {| - +__typename: "MarkdownUserNameRenderer", - ...MarkdownUserNameRenderer_name, - |}> | {| - +__typename: string - |}), - |} | {| - +__typename: string, - +id: string, - |}), - +viewer: ?{| - +actor: ?({| - +__typename: "User", - +id: string, - +name: ?string, - +nameRenderer: ?({| - +__typename: "PlainUserNameRenderer", - +__module_operation_AnotherNameRendererFragment: ?any, - +__module_component_AnotherNameRendererFragment: ?any, - ...PlainUserNameRenderer_name, - |} | Local3DPayload<"AnotherNameRendererFragment", {| - +__typename: "PlainUserNameRenderer", - ...PlainUserNameRenderer_name, - |}> | {| - +__typename: "MarkdownUserNameRenderer", - +__module_operation_AnotherNameRendererFragment: ?any, - +__module_component_AnotherNameRendererFragment: ?any, - ...MarkdownUserNameRenderer_name, - |} | Local3DPayload<"AnotherNameRendererFragment", {| - +__typename: "MarkdownUserNameRenderer", - ...MarkdownUserNameRenderer_name, - |}> | {| - +__typename: string - |}), - |} | {| - +__typename: string, - +id: string, - |}) - |}, -|}; -export type Test = {| +import { Local3DPayload } from "relay-runtime"; +import { AnotherNameRendererFragment$ref } from "./AnotherNameRendererFragment.graphql"; +import { NameRendererFragment$ref } from "./NameRendererFragment.graphql"; +export type TestVariables = {}; +export type TestResponse = { + readonly node?: { + readonly username?: string, + readonly $fragmentRefs: NameRendererFragment$ref, + }, + readonly viewer?: { + readonly actor?: { + readonly name?: string, + readonly $fragmentRefs: AnotherNameRendererFragment$ref, + } + }, +}; +export type PlainUserNameRenderer_name = { + readonly plaintext?: string, + readonly data?: { + readonly text?: string, + readonly id?: string, + }, +}; +export type MarkdownUserNameRenderer_name = { + readonly markdown?: string, + readonly data?: { + readonly markup?: string, + readonly id?: string, + }, +}; +export type TestRawResponse = { + readonly node?: { + readonly __typename: "User", + readonly id: string, + readonly username?: string, + readonly nameRenderer?: { + readonly __typename: "PlainUserNameRenderer", + readonly __module_operation_NameRendererFragment?: any, + readonly __module_component_NameRendererFragment?: any, + } | Local3DPayload<"NameRendererFragment", { + readonly __typename: "PlainUserNameRenderer", + }> | { + readonly __typename: "MarkdownUserNameRenderer", + readonly __module_operation_NameRendererFragment?: any, + readonly __module_component_NameRendererFragment?: any, + } | Local3DPayload<"NameRendererFragment", { + readonly __typename: "MarkdownUserNameRenderer", + }> | { + readonly __typename: string + }, + } | { + readonly __typename: string, + readonly id: string, + }, + readonly viewer?: { + readonly actor?: { + readonly __typename: "User", + readonly id: string, + readonly name?: string, + readonly nameRenderer?: { + readonly __typename: "PlainUserNameRenderer", + readonly __module_operation_AnotherNameRendererFragment?: any, + readonly __module_component_AnotherNameRendererFragment?: any, + } | Local3DPayload<"AnotherNameRendererFragment", { + readonly __typename: "PlainUserNameRenderer", + }> | { + readonly __typename: "MarkdownUserNameRenderer", + readonly __module_operation_AnotherNameRendererFragment?: any, + readonly __module_component_AnotherNameRendererFragment?: any, + } | Local3DPayload<"AnotherNameRendererFragment", { + readonly __typename: "MarkdownUserNameRenderer", + }> | { + readonly __typename: string + }, + } | { + readonly __typename: string, + readonly id: string, + } + }, +}; +export type Test = { variables: TestVariables, response: TestResponse, rawResponse: TestRawResponse, -|}; +}; ------------------------------------------------------------------------------- import { MarkdownUserNameRenderer_name$ref } from "./MarkdownUserNameRenderer_name.graphql"; import { PlainUserNameRenderer_name$ref } from "./PlainUserNameRenderer_name.graphql"; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected index 93b884789fedf..5540c86d9cedf 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected @@ -16,36 +16,36 @@ fragment FriendFragment on User { } } ==================================== OUTPUT =================================== -import type { FriendFragment$ref } from "./FriendFragment.graphql"; -export type ExampleQueryVariables = {| +import { FriendFragment$ref } from "./FriendFragment.graphql"; +export type ExampleQueryVariables = { id: string, condition: boolean, -|}; -export type ExampleQueryResponse = {| - +node: ?{| - +$fragmentRefs: FriendFragment$ref - |} -|}; -export type ExampleQueryRawResponse = {| - +node: ?({| - +__typename: "User", - +id: string, - +name: ?string, - +lastName: ?string, - +feedback: ?{| - +id: string, - +name: ?string, - |}, - |} | {| - +__typename: string, - +id: string, - |}) -|}; -export type ExampleQuery = {| +}; +export type ExampleQueryResponse = { + readonly node?: { + readonly $fragmentRefs: FriendFragment$ref + } +}; +export type ExampleQueryRawResponse = { + readonly node?: { + readonly __typename: "User", + readonly id: string, + readonly name?: string, + readonly lastName?: string, + readonly feedback?: { + readonly id: string, + readonly name?: string, + }, + } | { + readonly __typename: string, + readonly id: string, + } +}; +export type ExampleQuery = { variables: ExampleQueryVariables, response: ExampleQueryResponse, rawResponse: ExampleQueryRawResponse, -|}; +}; ------------------------------------------------------------------------------- import { FragmentReference } from "relay-runtime"; export type FriendFragment$ref = FragmentReference & { _: "FriendFragment$ref" }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected index e085e6c53e4a5..e63a960f33e04 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected @@ -22,31 +22,31 @@ fragment FriendFragment on User { } } ==================================== OUTPUT =================================== -import type { FriendFragment$ref } from "./FriendFragment.graphql"; -export type ExampleQueryVariables = {| +import { FriendFragment$ref } from "./FriendFragment.graphql"; +export type ExampleQueryVariables = { id: string -|}; -export type ExampleQueryResponse = {| - +node: ?{| - +username: ?string, - +friends?: ?{| - +count: ?number - |}, - +$fragmentRefs: FriendFragment$ref, - |} -|}; -export type ExampleQueryRawResponse = {| - +node: ?{| - +__typename: string, - +username: ?string, - +id: string, - |} -|}; -export type ExampleQuery = {| +}; +export type ExampleQueryResponse = { + readonly node?: { + readonly username?: string, + readonly friends?: { + readonly count?: number + }, + readonly $fragmentRefs: FriendFragment$ref, + } +}; +export type ExampleQueryRawResponse = { + readonly node?: { + readonly __typename: string, + readonly username?: string, + readonly id: string, + } +}; +export type ExampleQuery = { variables: ExampleQueryVariables, response: ExampleQueryResponse, rawResponse: ExampleQueryRawResponse, -|}; +}; ------------------------------------------------------------------------------- import { FragmentReference } from "relay-runtime"; export type FriendFragment$ref = FragmentReference & { _: "FriendFragment$ref" }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream-connection.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream-connection.expected index db869695cc30f..b2d2ba205483f 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream-connection.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream-connection.expected @@ -17,51 +17,51 @@ query TestDefer @raw_response_type { } } ==================================== OUTPUT =================================== -export type TestDeferVariables = {||}; -export type TestDeferResponse = {| - +node: ?{| - +name?: ?string, - +friends?: ?{| - +edges: ?$ReadOnlyArray - |}, - |} -|}; -export type TestDeferRawResponse = {| - +node: ?({| - +__typename: "User", - +id: string, - +name: ?string, - +friends: ?{| - +edges: ?$ReadOnlyArray, - +pageInfo: ?{| - +endCursor: ?string, - +hasNextPage: ?boolean, - |}, - |}, - |} | {| - +__typename: string, - +id: string, - |}) -|}; -export type TestDefer = {| +export type TestDeferVariables = {}; +export type TestDeferResponse = { + readonly node?: { + readonly name?: string, + readonly friends?: { + readonly edges?: ReadonlyArray<{ + readonly node?: { + readonly actor?: { + readonly name?: string + } + } + } | null> + }, + } +}; +export type TestDeferRawResponse = { + readonly node?: { + readonly __typename: "User", + readonly id: string, + readonly name?: string, + readonly friends?: { + readonly edges?: ReadonlyArray<{ + readonly node?: { + readonly actor?: { + readonly __typename: string, + readonly name?: string, + readonly id: string, + }, + readonly id: string, + readonly __typename: "User", + }, + readonly cursor?: string, + } | null>, + readonly pageInfo?: { + readonly endCursor?: string, + readonly hasNextPage?: boolean, + }, + }, + } | { + readonly __typename: string, + readonly id: string, + } +}; +export type TestDefer = { variables: TestDeferVariables, response: TestDeferResponse, rawResponse: TestDeferRawResponse, -|}; +}; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream.expected index e79ebc313b654..cd61ba203e72e 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream.expected @@ -18,44 +18,44 @@ query TestStream @raw_response_type { } } ==================================== OUTPUT =================================== -export type TestStreamVariables = {||}; -export type TestStreamResponse = {| - +node: ?{| - +name?: ?string, - +friends?: ?{| - +edges: ?$ReadOnlyArray - |}, - |} -|}; -export type TestStreamRawResponse = {| - +node: ?({| - +__typename: "User", - +id: string, - +name: ?string, - +friends: ?{| - +edges: ?$ReadOnlyArray, - +pageInfo: ?{| - +endCursor: ?string, - +hasNextPage: ?boolean, - |}, - |}, - |} | {| - +__typename: string, - +id: string, - |}) -|}; -export type TestStream = {| +export type TestStreamVariables = {}; +export type TestStreamResponse = { + readonly node?: { + readonly name?: string, + readonly friends?: { + readonly edges?: ReadonlyArray<{ + readonly node?: { + readonly id: string + } + } | null> + }, + } +}; +export type TestStreamRawResponse = { + readonly node?: { + readonly __typename: "User", + readonly id: string, + readonly name?: string, + readonly friends?: { + readonly edges?: ReadonlyArray<{ + readonly node?: { + readonly id: string, + readonly __typename: "User", + }, + readonly cursor?: string, + } | null>, + readonly pageInfo?: { + readonly endCursor?: string, + readonly hasNextPage?: boolean, + }, + }, + } | { + readonly __typename: string, + readonly id: string, + } +}; +export type TestStream = { variables: TestStreamVariables, response: TestStreamResponse, rawResponse: TestStreamRawResponse, -|}; +}; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected index 37a6fee6a8d7c..a7a90ce64c8ec 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected @@ -7,21 +7,21 @@ fragment RefetchableFragment on Node } } ==================================== OUTPUT =================================== -import type { FragmentReference } from "relay-runtime"; -declare export opaque type RefetchableFragment$ref: FragmentReference; -declare export opaque type RefetchableFragment$fragmentType: RefetchableFragment$ref; -export type RefetchableFragmentQueryVariables = {| +import { FragmentReference } from "relay-runtime"; +export type RefetchableFragment$ref = FragmentReference & { _: "RefetchableFragment$ref" }; +export type RefetchableFragment$fragmentType = RefetchableFragment$ref & { _: "RefetchableFragment$fragmentType" }; +export type RefetchableFragmentQueryVariables = { id: string -|}; -export type RefetchableFragmentQueryResponse = {| - +node: ?{| - +$fragmentRefs: RefetchableFragment$ref - |} -|}; -export type RefetchableFragmentQuery = {| +}; +export type RefetchableFragmentQueryResponse = { + readonly node?: { + readonly $fragmentRefs: RefetchableFragment$ref + } +}; +export type RefetchableFragmentQuery = { variables: RefetchableFragmentQueryVariables, response: RefetchableFragmentQueryResponse, -|}; +}; ------------------------------------------------------------------------------- import { FragmentReference } from "relay-runtime"; import { RefetchableFragment$ref, RefetchableFragment$fragmentType } from "RefetchableFragmentQuery.graphql"; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected index 8c720efa0754a..01fd97c4ed44a 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected @@ -7,21 +7,21 @@ fragment FlowRefetchableFragment on Node } } ==================================== OUTPUT =================================== -import type { FragmentReference } from "relay-runtime"; -declare export opaque type FlowRefetchableFragment$ref: FragmentReference; -declare export opaque type FlowRefetchableFragment$fragmentType: FlowRefetchableFragment$ref; -export type FlowRefetchableFragmentQueryVariables = {| +import { FragmentReference } from "relay-runtime"; +export type FlowRefetchableFragment$ref = FragmentReference & { _: "FlowRefetchableFragment$ref" }; +export type FlowRefetchableFragment$fragmentType = FlowRefetchableFragment$ref & { _: "FlowRefetchableFragment$fragmentType" }; +export type FlowRefetchableFragmentQueryVariables = { id: string -|}; -export type FlowRefetchableFragmentQueryResponse = {| - +node: ?{| - +$fragmentRefs: FlowRefetchableFragment$ref - |} -|}; -export type FlowRefetchableFragmentQuery = {| +}; +export type FlowRefetchableFragmentQueryResponse = { + readonly node?: { + readonly $fragmentRefs: FlowRefetchableFragment$ref + } +}; +export type FlowRefetchableFragmentQuery = { variables: FlowRefetchableFragmentQueryVariables, response: FlowRefetchableFragmentQueryResponse, -|}; +}; ------------------------------------------------------------------------------- import { FragmentReference } from "relay-runtime"; import { FlowRefetchableFragment$ref, FlowRefetchableFragment$fragmentType } from "FlowRefetchableFragmentQuery.graphql"; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected index 39ec042b5bb8e..2a1961ecb3719 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected @@ -27,32 +27,32 @@ query RelayClientIDFieldQuery($id: ID!) { } } ==================================== OUTPUT =================================== -export type RelayClientIDFieldQueryVariables = {| +export type RelayClientIDFieldQueryVariables = { id: string -|}; -export type RelayClientIDFieldQueryResponse = {| - +__id: string, - +me: ?{| - +__id: string, - +__typename: string, - +id: string, - |}, - +node: ?{| - +__id: string, - +__typename: string, - +id: string, - +commentBody?: ?{| - +__id: string, - +__typename: string, - +text?: ?{| - +__id: string, - +__typename: string, - +text: ?string, - |}, - |}, - |}, -|}; -export type RelayClientIDFieldQuery = {| +}; +export type RelayClientIDFieldQueryResponse = { + readonly __id: string, + readonly me?: { + readonly __id: string, + readonly __typename: string, + readonly id: string, + }, + readonly node?: { + readonly __id: string, + readonly __typename: string, + readonly id: string, + readonly commentBody?: { + readonly __id: string, + readonly __typename: string, + readonly text?: { + readonly __id: string, + readonly __typename: string, + readonly text?: string, + }, + }, + }, +}; +export type RelayClientIDFieldQuery = { variables: RelayClientIDFieldQueryVariables, response: RelayClientIDFieldQueryResponse, -|}; +}; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-query.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-query.expected index 09cf659b48458..4941f6846908c 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-query.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-query.expected @@ -6,14 +6,14 @@ query FooQuery { } } ==================================== OUTPUT =================================== -export type FooQueryVariables = {||}; -export type FooQueryResponse = ?{| - +me: {| - +firstName: ?string, - +lastName: string, - |} -|}; -export type FooQuery = {| +export type FooQueryVariables = {}; +export type FooQueryResponse = { + readonly me: { + readonly firstName?: string, + readonly lastName: string, + } +} | null; +export type FooQuery = { variables: FooQueryVariables, response: FooQueryResponse, -|}; +}; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-up-to-mutation-response.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-up-to-mutation-response.expected index 361231f2e410c..16d78bc4616fa 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-up-to-mutation-response.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-up-to-mutation-response.expected @@ -7,28 +7,28 @@ mutation CommentCreateMutation($input: CommentCreateInput!) { } } ==================================== OUTPUT =================================== -export type CommentCreateInput = {| - clientMutationId?: ?string, - feedbackId?: ?string, - feedback?: ?CommentfeedbackFeedback, -|}; -export type CommentfeedbackFeedback = {| - comment?: ?FeedbackcommentComment -|}; -export type FeedbackcommentComment = {| - feedback?: ?CommentfeedbackFeedback -|}; -export type CommentCreateMutationVariables = {| +export type CommentCreateInput = { + clientMutationId?: string, + feedbackId?: string, + feedback?: CommentfeedbackFeedback, +}; +export type CommentfeedbackFeedback = { + comment?: FeedbackcommentComment +}; +export type FeedbackcommentComment = { + feedback?: CommentfeedbackFeedback +}; +export type CommentCreateMutationVariables = { input: CommentCreateInput -|}; -export type CommentCreateMutationResponse = ?{| - +commentCreate: {| - +comment: {| - +id: string - |} - |} -|}; -export type CommentCreateMutation = {| +}; +export type CommentCreateMutationResponse = { + readonly commentCreate: { + readonly comment: { + readonly id: string + } + } +} | null; +export type CommentCreateMutation = { variables: CommentCreateMutationVariables, response: CommentCreateMutationResponse, -|}; +}; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-raw-response-type.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-raw-response-type.expected index 97b084a29690f..faa9095c4b521 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-raw-response-type.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-raw-response-type.expected @@ -6,21 +6,21 @@ query MyQuery @raw_response_type { } } ==================================== OUTPUT =================================== -export type MyQueryVariables = {||}; -export type MyQueryResponse = ?{| - +me: {| - +id: string, - +name: string, - |} -|}; -export type MyQueryRawResponse = {| - +me: ?{| - +id: string, - +name: ?string, - |} -|}; -export type MyQuery = {| +export type MyQueryVariables = {}; +export type MyQueryResponse = { + readonly me: { + readonly id: string, + readonly name: string, + } +} | null; +export type MyQueryRawResponse = { + readonly me?: { + readonly id: string, + readonly name?: string, + } +}; +export type MyQuery = { variables: MyQueryVariables, response: MyQueryResponse, rawResponse: MyQueryRawResponse, -|}; +}; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-query.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-query.expected index 2bbcbc3c1baa0..7614bb7a98d48 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-query.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-query.expected @@ -6,14 +6,14 @@ query FooQuery { } } ==================================== OUTPUT =================================== -export type FooQueryVariables = {||}; -export type FooQueryResponse = {| - +me: {| - +firstName: ?string, - +lastName: ?string, - |} -|}; -export type FooQuery = {| +export type FooQueryVariables = {}; +export type FooQueryResponse = { + readonly me: { + readonly firstName?: string, + readonly lastName?: string, + } +}; +export type FooQuery = { variables: FooQueryVariables, response: FooQueryResponse, -|}; +}; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throws-nested.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throws-nested.expected index 8b1ab03230fd8..59d3f5ff9d45f 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throws-nested.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throws-nested.expected @@ -6,14 +6,14 @@ query FooQuery { } } ==================================== OUTPUT =================================== -export type FooQueryVariables = {||}; -export type FooQueryResponse = {| - +me: ?{| - +firstName: ?string, - +lastName: string, - |} -|}; -export type FooQuery = {| +export type FooQueryVariables = {}; +export type FooQueryResponse = { + readonly me?: { + readonly firstName?: string, + readonly lastName: string, + } +}; +export type FooQuery = { variables: FooQueryVariables, response: FooQueryResponse, -|}; +}; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required.expected index e82aac670513c..423db27687a04 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required.expected @@ -6,14 +6,14 @@ query FooQuery { } } ==================================== OUTPUT =================================== -export type FooQueryVariables = {||}; -export type FooQueryResponse = {| - +me: ?{| - +firstName: ?string, - +lastName: string, - |} -|}; -export type FooQuery = {| +export type FooQueryVariables = {}; +export type FooQueryResponse = { + readonly me?: { + readonly firstName?: string, + readonly lastName: string, + } +}; +export type FooQuery = { variables: FooQueryVariables, response: FooQueryResponse, -|}; +}; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected index fb45f9daf717e..0cf57d9d10c08 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected @@ -25,63 +25,63 @@ subscription TestSubscription($input: FeedbackLikeInput) { } } ==================================== OUTPUT =================================== -export type ExampleQueryVariables = {| +export type ExampleQueryVariables = { id: string -|}; -export type ExampleQueryResponse = {| - +node: ?{| - +id: string - |} -|}; -export type ExampleQuery = {| +}; +export type ExampleQueryResponse = { + readonly node?: { + readonly id: string + } +}; +export type ExampleQuery = { variables: ExampleQueryVariables, response: ExampleQueryResponse, -|}; +}; ------------------------------------------------------------------------------- -export type CommentCreateInput = {| - clientMutationId?: ?string, - feedbackId?: ?string, - feedback?: ?CommentfeedbackFeedback, -|}; -export type CommentfeedbackFeedback = {| - comment?: ?FeedbackcommentComment -|}; -export type FeedbackcommentComment = {| - feedback?: ?CommentfeedbackFeedback -|}; -export type TestMutationVariables = {| +export type CommentCreateInput = { + clientMutationId?: string, + feedbackId?: string, + feedback?: CommentfeedbackFeedback, +}; +export type CommentfeedbackFeedback = { + comment?: FeedbackcommentComment +}; +export type FeedbackcommentComment = { + feedback?: CommentfeedbackFeedback +}; +export type TestMutationVariables = { input: CommentCreateInput -|}; -export type TestMutationResponse = {| - +commentCreate: ?{| - +comment: ?{| - +id: string - |} - |} -|}; -export type TestMutation = {| +}; +export type TestMutationResponse = { + readonly commentCreate?: { + readonly comment?: { + readonly id: string + } + } +}; +export type TestMutation = { variables: TestMutationVariables, response: TestMutationResponse, -|}; +}; ------------------------------------------------------------------------------- -export type FeedbackLikeInput = {| - clientMutationId?: ?string, - feedbackId?: ?string, -|}; -export type TestSubscriptionVariables = {| - input?: ?FeedbackLikeInput -|}; -export type TestSubscriptionResponse = {| - +feedbackLikeSubscribe: ?{| - +feedback: ?{| - +id: string - |} - |} -|}; -export type TestSubscription = {| +export type FeedbackLikeInput = { + clientMutationId?: string, + feedbackId?: string, +}; +export type TestSubscriptionVariables = { + input?: FeedbackLikeInput +}; +export type TestSubscriptionResponse = { + readonly feedbackLikeSubscribe?: { + readonly feedback?: { + readonly id: string + } + } +}; +export type TestSubscription = { variables: TestSubscriptionVariables, response: TestSubscriptionResponse, -|}; +}; ------------------------------------------------------------------------------- import { FragmentReference } from "relay-runtime"; export type ExampleFragment$ref = FragmentReference & { _: "ExampleFragment$ref" }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/mod.rs b/compiler/crates/relay-typegen/tests/generate_typescript/mod.rs index c37f84629501e..e16eea2821b78 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/mod.rs +++ b/compiler/crates/relay-typegen/tests/generate_typescript/mod.rs @@ -56,7 +56,10 @@ pub fn transform_fixture(fixture: &Fixture<'_>) -> Result { typegen_operation, normalization_operation, &schema, - &TypegenConfig::default(), + &TypegenConfig { + language: TypegenLanguage::TypeScript, + ..Default::default() + }, ) }); @@ -68,9 +71,7 @@ pub fn transform_fixture(fixture: &Fixture<'_>) -> Result { &schema, &TypegenConfig { language: TypegenLanguage::TypeScript, - enum_module_suffix: None, - optional_input_fields: vec![], - custom_scalar_types: Default::default(), + ..Default::default() }, ) }); diff --git a/compiler/crates/relay-typegen/tests/generate_typescript_test.rs b/compiler/crates/relay-typegen/tests/generate_typescript_test.rs index 1d2b2e0d1cfef..db8a02aa2df4a 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript_test.rs +++ b/compiler/crates/relay-typegen/tests/generate_typescript_test.rs @@ -2,189 +2,363 @@ mod generate_typescript; -use generate_typescript::transform_fixture; use fixture_tests::test_fixture; +use generate_typescript::transform_fixture; #[test] fn conditional() { let input = include_str!("generate_typescript/fixtures/conditional.graphql"); let expected = include_str!("generate_typescript/fixtures/conditional.expected"); - test_fixture(transform_fixture, "conditional.graphql", "generate_typescript/fixtures/conditional.expected", input, expected); + test_fixture( + transform_fixture, + "conditional.graphql", + "generate_typescript/fixtures/conditional.expected", + input, + expected, + ); } #[test] fn fragment_spread() { let input = include_str!("generate_typescript/fixtures/fragment-spread.graphql"); let expected = include_str!("generate_typescript/fixtures/fragment-spread.expected"); - test_fixture(transform_fixture, "fragment-spread.graphql", "generate_typescript/fixtures/fragment-spread.expected", input, expected); + test_fixture( + transform_fixture, + "fragment-spread.graphql", + "generate_typescript/fixtures/fragment-spread.expected", + input, + expected, + ); } #[test] fn inline_fragment() { let input = include_str!("generate_typescript/fixtures/inline-fragment.graphql"); let expected = include_str!("generate_typescript/fixtures/inline-fragment.expected"); - test_fixture(transform_fixture, "inline-fragment.graphql", "generate_typescript/fixtures/inline-fragment.expected", input, expected); + test_fixture( + transform_fixture, + "inline-fragment.graphql", + "generate_typescript/fixtures/inline-fragment.expected", + input, + expected, + ); } #[test] fn linked_field() { let input = include_str!("generate_typescript/fixtures/linked-field.graphql"); let expected = include_str!("generate_typescript/fixtures/linked-field.expected"); - test_fixture(transform_fixture, "linked-field.graphql", "generate_typescript/fixtures/linked-field.expected", input, expected); + test_fixture( + transform_fixture, + "linked-field.graphql", + "generate_typescript/fixtures/linked-field.expected", + input, + expected, + ); } #[test] fn match_field() { let input = include_str!("generate_typescript/fixtures/match-field.graphql"); let expected = include_str!("generate_typescript/fixtures/match-field.expected"); - test_fixture(transform_fixture, "match-field.graphql", "generate_typescript/fixtures/match-field.expected", input, expected); + test_fixture( + transform_fixture, + "match-field.graphql", + "generate_typescript/fixtures/match-field.expected", + input, + expected, + ); } #[test] fn match_field_in_query() { let input = include_str!("generate_typescript/fixtures/match-field-in-query.graphql"); let expected = include_str!("generate_typescript/fixtures/match-field-in-query.expected"); - test_fixture(transform_fixture, "match-field-in-query.graphql", "generate_typescript/fixtures/match-field-in-query.expected", input, expected); -} - -#[test] -fn mutaion_with_client_extension() { - let input = include_str!("generate_typescript/fixtures/mutaion-with-client-extension.graphql"); - let expected = include_str!("generate_typescript/fixtures/mutaion-with-client-extension.expected"); - test_fixture(transform_fixture, "mutaion-with-client-extension.graphql", "generate_typescript/fixtures/mutaion-with-client-extension.expected", input, expected); -} - -#[test] -fn mutaion_with_response_on_inline_fragments() { - let input = include_str!("generate_typescript/fixtures/mutaion-with-response-on-inline-fragments.graphql"); - let expected = include_str!("generate_typescript/fixtures/mutaion-with-response-on-inline-fragments.expected"); - test_fixture(transform_fixture, "mutaion-with-response-on-inline-fragments.graphql", "generate_typescript/fixtures/mutaion-with-response-on-inline-fragments.expected", input, expected); + test_fixture( + transform_fixture, + "match-field-in-query.graphql", + "generate_typescript/fixtures/match-field-in-query.expected", + input, + expected, + ); +} + +#[test] +fn mutation_with_client_extension() { + let input = include_str!("generate_typescript/fixtures/mutation-with-client-extension.graphql"); + let expected = + include_str!("generate_typescript/fixtures/mutation-with-client-extension.expected"); + test_fixture( + transform_fixture, + "mutation-with-client-extension.graphql", + "generate_typescript/fixtures/mutation-with-client-extension.expected", + input, + expected, + ); +} + +#[test] +fn mutation_with_response_on_inline_fragments() { + let input = include_str!( + "generate_typescript/fixtures/mutation-with-response-on-inline-fragments.graphql" + ); + let expected = include_str!( + "generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected" + ); + test_fixture( + transform_fixture, + "mutation-with-response-on-inline-fragments.graphql", + "generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected", + input, + expected, + ); } #[test] fn mutation() { let input = include_str!("generate_typescript/fixtures/mutation.graphql"); let expected = include_str!("generate_typescript/fixtures/mutation.expected"); - test_fixture(transform_fixture, "mutation.graphql", "generate_typescript/fixtures/mutation.expected", input, expected); + test_fixture( + transform_fixture, + "mutation.graphql", + "generate_typescript/fixtures/mutation.expected", + input, + expected, + ); } #[test] fn mutation_input_has_array() { let input = include_str!("generate_typescript/fixtures/mutation-input-has-array.graphql"); let expected = include_str!("generate_typescript/fixtures/mutation-input-has-array.expected"); - test_fixture(transform_fixture, "mutation-input-has-array.graphql", "generate_typescript/fixtures/mutation-input-has-array.expected", input, expected); + test_fixture( + transform_fixture, + "mutation-input-has-array.graphql", + "generate_typescript/fixtures/mutation-input-has-array.expected", + input, + expected, + ); } #[test] fn mutation_with_enums_on_fragment() { - let input = include_str!("generate_typescript/fixtures/mutation-with-enums-on-fragment.graphql"); - let expected = include_str!("generate_typescript/fixtures/mutation-with-enums-on-fragment.expected"); - test_fixture(transform_fixture, "mutation-with-enums-on-fragment.graphql", "generate_typescript/fixtures/mutation-with-enums-on-fragment.expected", input, expected); + let input = + include_str!("generate_typescript/fixtures/mutation-with-enums-on-fragment.graphql"); + let expected = + include_str!("generate_typescript/fixtures/mutation-with-enums-on-fragment.expected"); + test_fixture( + transform_fixture, + "mutation-with-enums-on-fragment.graphql", + "generate_typescript/fixtures/mutation-with-enums-on-fragment.expected", + input, + expected, + ); } #[test] fn mutation_with_nested_fragments() { let input = include_str!("generate_typescript/fixtures/mutation-with-nested-fragments.graphql"); - let expected = include_str!("generate_typescript/fixtures/mutation-with-nested-fragments.expected"); - test_fixture(transform_fixture, "mutation-with-nested-fragments.graphql", "generate_typescript/fixtures/mutation-with-nested-fragments.expected", input, expected); + let expected = + include_str!("generate_typescript/fixtures/mutation-with-nested-fragments.expected"); + test_fixture( + transform_fixture, + "mutation-with-nested-fragments.graphql", + "generate_typescript/fixtures/mutation-with-nested-fragments.expected", + input, + expected, + ); } #[test] fn plural_fragment() { let input = include_str!("generate_typescript/fixtures/plural-fragment.graphql"); let expected = include_str!("generate_typescript/fixtures/plural-fragment.expected"); - test_fixture(transform_fixture, "plural-fragment.graphql", "generate_typescript/fixtures/plural-fragment.expected", input, expected); + test_fixture( + transform_fixture, + "plural-fragment.graphql", + "generate_typescript/fixtures/plural-fragment.expected", + input, + expected, + ); } #[test] fn query_with_handles() { let input = include_str!("generate_typescript/fixtures/query-with-handles.graphql"); let expected = include_str!("generate_typescript/fixtures/query-with-handles.expected"); - test_fixture(transform_fixture, "query-with-handles.graphql", "generate_typescript/fixtures/query-with-handles.expected", input, expected); + test_fixture( + transform_fixture, + "query-with-handles.graphql", + "generate_typescript/fixtures/query-with-handles.expected", + input, + expected, + ); } #[test] fn query_with_match_fields() { let input = include_str!("generate_typescript/fixtures/query-with-match-fields.graphql"); let expected = include_str!("generate_typescript/fixtures/query-with-match-fields.expected"); - test_fixture(transform_fixture, "query-with-match-fields.graphql", "generate_typescript/fixtures/query-with-match-fields.expected", input, expected); + test_fixture( + transform_fixture, + "query-with-match-fields.graphql", + "generate_typescript/fixtures/query-with-match-fields.expected", + input, + expected, + ); } #[test] fn query_with_module_field() { let input = include_str!("generate_typescript/fixtures/query-with-module-field.graphql"); let expected = include_str!("generate_typescript/fixtures/query-with-module-field.expected"); - test_fixture(transform_fixture, "query-with-module-field.graphql", "generate_typescript/fixtures/query-with-module-field.expected", input, expected); + test_fixture( + transform_fixture, + "query-with-module-field.graphql", + "generate_typescript/fixtures/query-with-module-field.expected", + input, + expected, + ); } #[test] fn query_with_multiple_match_fields() { - let input = include_str!("generate_typescript/fixtures/query-with-multiple-match-fields.graphql"); - let expected = include_str!("generate_typescript/fixtures/query-with-multiple-match-fields.expected"); - test_fixture(transform_fixture, "query-with-multiple-match-fields.graphql", "generate_typescript/fixtures/query-with-multiple-match-fields.expected", input, expected); + let input = + include_str!("generate_typescript/fixtures/query-with-multiple-match-fields.graphql"); + let expected = + include_str!("generate_typescript/fixtures/query-with-multiple-match-fields.expected"); + test_fixture( + transform_fixture, + "query-with-multiple-match-fields.graphql", + "generate_typescript/fixtures/query-with-multiple-match-fields.expected", + input, + expected, + ); } #[test] fn query_with_raw_response_on_conditional() { - let input = include_str!("generate_typescript/fixtures/query-with-raw-response-on-conditional.graphql"); - let expected = include_str!("generate_typescript/fixtures/query-with-raw-response-on-conditional.expected"); - test_fixture(transform_fixture, "query-with-raw-response-on-conditional.graphql", "generate_typescript/fixtures/query-with-raw-response-on-conditional.expected", input, expected); + let input = + include_str!("generate_typescript/fixtures/query-with-raw-response-on-conditional.graphql"); + let expected = include_str!( + "generate_typescript/fixtures/query-with-raw-response-on-conditional.expected" + ); + test_fixture( + transform_fixture, + "query-with-raw-response-on-conditional.graphql", + "generate_typescript/fixtures/query-with-raw-response-on-conditional.expected", + input, + expected, + ); } #[test] fn query_with_raw_response_on_literal_conditional() { - let input = include_str!("generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.graphql"); - let expected = include_str!("generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected"); - test_fixture(transform_fixture, "query-with-raw-response-on-literal-conditional.graphql", "generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected", input, expected); + let input = include_str!( + "generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.graphql" + ); + let expected = include_str!( + "generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected" + ); + test_fixture( + transform_fixture, + "query-with-raw-response-on-literal-conditional.graphql", + "generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected", + input, + expected, + ); } #[test] fn query_with_stream() { let input = include_str!("generate_typescript/fixtures/query-with-stream.graphql"); let expected = include_str!("generate_typescript/fixtures/query-with-stream.expected"); - test_fixture(transform_fixture, "query-with-stream.graphql", "generate_typescript/fixtures/query-with-stream.expected", input, expected); + test_fixture( + transform_fixture, + "query-with-stream.graphql", + "generate_typescript/fixtures/query-with-stream.expected", + input, + expected, + ); } #[test] fn query_with_stream_connection() { let input = include_str!("generate_typescript/fixtures/query-with-stream-connection.graphql"); - let expected = include_str!("generate_typescript/fixtures/query-with-stream-connection.expected"); - test_fixture(transform_fixture, "query-with-stream-connection.graphql", "generate_typescript/fixtures/query-with-stream-connection.expected", input, expected); + let expected = + include_str!("generate_typescript/fixtures/query-with-stream-connection.expected"); + test_fixture( + transform_fixture, + "query-with-stream-connection.graphql", + "generate_typescript/fixtures/query-with-stream-connection.expected", + input, + expected, + ); } #[test] fn recursive_fragments() { let input = include_str!("generate_typescript/fixtures/recursive-fragments.graphql"); let expected = include_str!("generate_typescript/fixtures/recursive-fragments.expected"); - test_fixture(transform_fixture, "recursive-fragments.graphql", "generate_typescript/fixtures/recursive-fragments.expected", input, expected); + test_fixture( + transform_fixture, + "recursive-fragments.graphql", + "generate_typescript/fixtures/recursive-fragments.expected", + input, + expected, + ); } #[test] fn refetchable() { let input = include_str!("generate_typescript/fixtures/refetchable.graphql"); let expected = include_str!("generate_typescript/fixtures/refetchable.expected"); - test_fixture(transform_fixture, "refetchable.graphql", "generate_typescript/fixtures/refetchable.expected", input, expected); + test_fixture( + transform_fixture, + "refetchable.graphql", + "generate_typescript/fixtures/refetchable.expected", + input, + expected, + ); } #[test] fn refetchable_fragment() { let input = include_str!("generate_typescript/fixtures/refetchable-fragment.graphql"); let expected = include_str!("generate_typescript/fixtures/refetchable-fragment.expected"); - test_fixture(transform_fixture, "refetchable-fragment.graphql", "generate_typescript/fixtures/refetchable-fragment.expected", input, expected); + test_fixture( + transform_fixture, + "refetchable-fragment.graphql", + "generate_typescript/fixtures/refetchable-fragment.expected", + input, + expected, + ); } #[test] fn relay_client_id_field() { let input = include_str!("generate_typescript/fixtures/relay-client-id-field.graphql"); let expected = include_str!("generate_typescript/fixtures/relay-client-id-field.expected"); - test_fixture(transform_fixture, "relay-client-id-field.graphql", "generate_typescript/fixtures/relay-client-id-field.expected", input, expected); + test_fixture( + transform_fixture, + "relay-client-id-field.graphql", + "generate_typescript/fixtures/relay-client-id-field.expected", + input, + expected, + ); } #[test] fn required() { let input = include_str!("generate_typescript/fixtures/required.graphql"); let expected = include_str!("generate_typescript/fixtures/required.expected"); - test_fixture(transform_fixture, "required.graphql", "generate_typescript/fixtures/required.expected", input, expected); + test_fixture( + transform_fixture, + "required.graphql", + "generate_typescript/fixtures/required.expected", + input, + expected, + ); } #[test] @@ -197,104 +371,218 @@ fn required_bubbles_through_inline_fragments_to_fragment() { #[test] fn required_bubbles_to_fragment() { let input = include_str!("generate_typescript/fixtures/required-bubbles-to-fragment.graphql"); - let expected = include_str!("generate_typescript/fixtures/required-bubbles-to-fragment.expected"); - test_fixture(transform_fixture, "required-bubbles-to-fragment.graphql", "generate_typescript/fixtures/required-bubbles-to-fragment.expected", input, expected); + let expected = + include_str!("generate_typescript/fixtures/required-bubbles-to-fragment.expected"); + test_fixture( + transform_fixture, + "required-bubbles-to-fragment.graphql", + "generate_typescript/fixtures/required-bubbles-to-fragment.expected", + input, + expected, + ); } #[test] fn required_bubbles_to_item_in_plural_field() { - let input = include_str!("generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.graphql"); - let expected = include_str!("generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected"); - test_fixture(transform_fixture, "required-bubbles-to-item-in-plural-field.graphql", "generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected", input, expected); + let input = include_str!( + "generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.graphql" + ); + let expected = include_str!( + "generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected" + ); + test_fixture( + transform_fixture, + "required-bubbles-to-item-in-plural-field.graphql", + "generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected", + input, + expected, + ); } #[test] fn required_bubbles_to_query() { let input = include_str!("generate_typescript/fixtures/required-bubbles-to-query.graphql"); let expected = include_str!("generate_typescript/fixtures/required-bubbles-to-query.expected"); - test_fixture(transform_fixture, "required-bubbles-to-query.graphql", "generate_typescript/fixtures/required-bubbles-to-query.expected", input, expected); + test_fixture( + transform_fixture, + "required-bubbles-to-query.graphql", + "generate_typescript/fixtures/required-bubbles-to-query.expected", + input, + expected, + ); } #[test] fn required_bubbles_up_to_mutation_response() { - let input = include_str!("generate_typescript/fixtures/required-bubbles-up-to-mutation-response.graphql"); - let expected = include_str!("generate_typescript/fixtures/required-bubbles-up-to-mutation-response.expected"); - test_fixture(transform_fixture, "required-bubbles-up-to-mutation-response.graphql", "generate_typescript/fixtures/required-bubbles-up-to-mutation-response.expected", input, expected); + let input = include_str!( + "generate_typescript/fixtures/required-bubbles-up-to-mutation-response.graphql" + ); + let expected = include_str!( + "generate_typescript/fixtures/required-bubbles-up-to-mutation-response.expected" + ); + test_fixture( + transform_fixture, + "required-bubbles-up-to-mutation-response.graphql", + "generate_typescript/fixtures/required-bubbles-up-to-mutation-response.expected", + input, + expected, + ); } #[test] fn required_isolates_concrete_inline_fragments() { - let input = include_str!("generate_typescript/fixtures/required-isolates-concrete-inline-fragments.graphql"); - let expected = include_str!("generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected"); - test_fixture(transform_fixture, "required-isolates-concrete-inline-fragments.graphql", "generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected", input, expected); + let input = include_str!( + "generate_typescript/fixtures/required-isolates-concrete-inline-fragments.graphql" + ); + let expected = include_str!( + "generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected" + ); + test_fixture( + transform_fixture, + "required-isolates-concrete-inline-fragments.graphql", + "generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected", + input, + expected, + ); } #[test] fn required_raw_response_type() { let input = include_str!("generate_typescript/fixtures/required-raw-response-type.graphql"); let expected = include_str!("generate_typescript/fixtures/required-raw-response-type.expected"); - test_fixture(transform_fixture, "required-raw-response-type.graphql", "generate_typescript/fixtures/required-raw-response-type.expected", input, expected); + test_fixture( + transform_fixture, + "required-raw-response-type.graphql", + "generate_typescript/fixtures/required-raw-response-type.expected", + input, + expected, + ); } #[test] fn required_throw_doesnt_bubbles_to_fragment() { - let input = include_str!("generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.graphql"); - let expected = include_str!("generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected"); - test_fixture(transform_fixture, "required-throw-doesnt-bubbles-to-fragment.graphql", "generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected", input, expected); + let input = include_str!( + "generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.graphql" + ); + let expected = include_str!( + "generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected" + ); + test_fixture( + transform_fixture, + "required-throw-doesnt-bubbles-to-fragment.graphql", + "generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected", + input, + expected, + ); } #[test] fn required_throw_doesnt_bubbles_to_query() { - let input = include_str!("generate_typescript/fixtures/required-throw-doesnt-bubbles-to-query.graphql"); - let expected = include_str!("generate_typescript/fixtures/required-throw-doesnt-bubbles-to-query.expected"); - test_fixture(transform_fixture, "required-throw-doesnt-bubbles-to-query.graphql", "generate_typescript/fixtures/required-throw-doesnt-bubbles-to-query.expected", input, expected); + let input = + include_str!("generate_typescript/fixtures/required-throw-doesnt-bubbles-to-query.graphql"); + let expected = include_str!( + "generate_typescript/fixtures/required-throw-doesnt-bubbles-to-query.expected" + ); + test_fixture( + transform_fixture, + "required-throw-doesnt-bubbles-to-query.graphql", + "generate_typescript/fixtures/required-throw-doesnt-bubbles-to-query.expected", + input, + expected, + ); } #[test] fn required_throws_nested() { let input = include_str!("generate_typescript/fixtures/required-throws-nested.graphql"); let expected = include_str!("generate_typescript/fixtures/required-throws-nested.expected"); - test_fixture(transform_fixture, "required-throws-nested.graphql", "generate_typescript/fixtures/required-throws-nested.expected", input, expected); + test_fixture( + transform_fixture, + "required-throws-nested.graphql", + "generate_typescript/fixtures/required-throws-nested.expected", + input, + expected, + ); } #[test] fn roots() { let input = include_str!("generate_typescript/fixtures/roots.graphql"); let expected = include_str!("generate_typescript/fixtures/roots.expected"); - test_fixture(transform_fixture, "roots.graphql", "generate_typescript/fixtures/roots.expected", input, expected); + test_fixture( + transform_fixture, + "roots.graphql", + "generate_typescript/fixtures/roots.expected", + input, + expected, + ); } #[test] fn scalar_field() { let input = include_str!("generate_typescript/fixtures/scalar-field.graphql"); let expected = include_str!("generate_typescript/fixtures/scalar-field.expected"); - test_fixture(transform_fixture, "scalar-field.graphql", "generate_typescript/fixtures/scalar-field.expected", input, expected); + test_fixture( + transform_fixture, + "scalar-field.graphql", + "generate_typescript/fixtures/scalar-field.expected", + input, + expected, + ); } #[test] fn simple() { let input = include_str!("generate_typescript/fixtures/simple.graphql"); let expected = include_str!("generate_typescript/fixtures/simple.expected"); - test_fixture(transform_fixture, "simple.graphql", "generate_typescript/fixtures/simple.expected", input, expected); + test_fixture( + transform_fixture, + "simple.graphql", + "generate_typescript/fixtures/simple.expected", + input, + expected, + ); } #[test] fn typename_inside_with_overlapping_fields() { - let input = include_str!("generate_typescript/fixtures/typename-inside-with-overlapping-fields.graphql"); - let expected = include_str!("generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected"); - test_fixture(transform_fixture, "typename-inside-with-overlapping-fields.graphql", "generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected", input, expected); + let input = include_str!( + "generate_typescript/fixtures/typename-inside-with-overlapping-fields.graphql" + ); + let expected = include_str!( + "generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected" + ); + test_fixture( + transform_fixture, + "typename-inside-with-overlapping-fields.graphql", + "generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected", + input, + expected, + ); } #[test] fn typename_on_union() { let input = include_str!("generate_typescript/fixtures/typename-on-union.graphql"); let expected = include_str!("generate_typescript/fixtures/typename-on-union.expected"); - test_fixture(transform_fixture, "typename-on-union.graphql", "generate_typescript/fixtures/typename-on-union.expected", input, expected); + test_fixture( + transform_fixture, + "typename-on-union.graphql", + "generate_typescript/fixtures/typename-on-union.expected", + input, + expected, + ); } #[test] fn unmasked_fragment_spreads() { let input = include_str!("generate_typescript/fixtures/unmasked-fragment-spreads.graphql"); let expected = include_str!("generate_typescript/fixtures/unmasked-fragment-spreads.expected"); - test_fixture(transform_fixture, "unmasked-fragment-spreads.graphql", "generate_typescript/fixtures/unmasked-fragment-spreads.expected", input, expected); + test_fixture( + transform_fixture, + "unmasked-fragment-spreads.graphql", + "generate_typescript/fixtures/unmasked-fragment-spreads.expected", + input, + expected, + ); } From fac60f085d675e17b591200fe771fbea6d28bd98 Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Sat, 17 Oct 2020 19:01:55 +0200 Subject: [PATCH 04/41] Allow opting into `import type` syntax for Typescript through config. --- compiler/crates/relay-typegen/src/config.rs | 6 +++ compiler/crates/relay-typegen/src/lib.rs | 2 +- .../crates/relay-typegen/src/typescript.rs | 39 +++++++++++++++++-- 3 files changed, 42 insertions(+), 5 deletions(-) diff --git a/compiler/crates/relay-typegen/src/config.rs b/compiler/crates/relay-typegen/src/config.rs index 5bfcb5687702b..dd3f3a9f192e7 100644 --- a/compiler/crates/relay-typegen/src/config.rs +++ b/compiler/crates/relay-typegen/src/config.rs @@ -43,6 +43,12 @@ pub struct TypegenConfig { #[serde(default)] pub optional_input_fields: Vec, + /// # For Typescript type generation + /// Whether to use the `import type` syntax introduced in Typescript + /// version 3.8. This will prevent warnings from `importsNotUsedAsValues`. + #[serde(default)] + pub use_import_type_syntax: bool, + /// A map from GraphQL scalar types to a custom JS type, example: /// { "Url": "String" } #[serde(default)] diff --git a/compiler/crates/relay-typegen/src/lib.rs b/compiler/crates/relay-typegen/src/lib.rs index 57483c6661dae..f7459ebbe4325 100644 --- a/compiler/crates/relay-typegen/src/lib.rs +++ b/compiler/crates/relay-typegen/src/lib.rs @@ -128,7 +128,7 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { fn create_writer(typegen_config: &TypegenConfig) -> Box { match &typegen_config.language { TypegenLanguage::Flow => Box::new(FlowPrinter::new()), - TypegenLanguage::TypeScript => Box::new(TypeScriptPrinter::new()), + TypegenLanguage::TypeScript => Box::new(TypeScriptPrinter::new(typegen_config)), } } diff --git a/compiler/crates/relay-typegen/src/typescript.rs b/compiler/crates/relay-typegen/src/typescript.rs index f7f27596a25ff..c6bf9a829b8c5 100644 --- a/compiler/crates/relay-typegen/src/typescript.rs +++ b/compiler/crates/relay-typegen/src/typescript.rs @@ -6,10 +6,12 @@ */ use crate::writer::{Prop, Writer, AST, SPREAD_KEY}; +use crate::TypegenConfig; use interner::{Intern, StringKey}; use std::fmt::{Result, Write}; pub struct TypeScriptPrinter { + use_import_type_syntax: bool, indentation: u32, } @@ -24,8 +26,11 @@ impl Writer for TypeScriptPrinter { } impl TypeScriptPrinter { - pub fn new() -> Self { - Self { indentation: 0 } + pub fn new(config: &TypegenConfig) -> Self { + Self { + indentation: 0, + use_import_type_syntax: config.use_import_type_syntax, + } } fn write(&mut self, writer: &mut dyn Write, ast: &AST) -> Result { @@ -220,7 +225,12 @@ impl TypeScriptPrinter { ) -> Result { write!( writer, - "import {{ {} }} from \"{}\";", + "import {}{{ {} }} from \"{}\";", + if self.use_import_type_syntax { + "type " + } else { + "" + }, types .iter() .map(|t| format!("{}", t)) @@ -271,7 +281,7 @@ mod tests { use interner::Intern; fn print_type(ast: &AST) -> String { - TypeScriptPrinter::new().write_ast(ast) + TypeScriptPrinter::new(&Default::default()).write_ast(ast) } #[test] @@ -510,4 +520,25 @@ mod tests { .to_string() ); } + + #[test] + fn import_type() { + assert_eq!( + print_type(&AST::ImportType( + vec!["A".intern(), "B".intern()], + "module".intern() + )), + "import { A, B } from \"module\";" + ); + + // TypeScriptPrinter::new(TypegenConfig { use_import_type_syntax: true, ..Default::default()}).write_ast() + assert_eq!( + TypeScriptPrinter::new(&TypegenConfig { + use_import_type_syntax: true, + ..Default::default() + }) + .write_ast(&AST::ImportType(vec!["C".intern()], "./foo".intern())), + "import type { C } from \"./foo\";" + ); + } } From 42fd9e2bd9459220b249bb9ae650f57a3b614917 Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Wed, 21 Oct 2020 18:48:01 +0200 Subject: [PATCH 05/41] Bring format of fragment usage, imports & exports in line with current relay-compiler-language-typescript package output. --- compiler/Cargo.lock | 92 +++++--------- compiler/crates/relay-typegen/src/flow.rs | 68 ++++++----- compiler/crates/relay-typegen/src/lib.rs | 46 ++++--- .../crates/relay-typegen/src/typescript.rs | 114 +++++++++--------- compiler/crates/relay-typegen/src/writer.rs | 10 +- .../fixtures/conditional.expected | 16 +-- .../fixtures/fragment-spread.expected | 77 +++++------- .../fixtures/inline-fragment.expected | 45 +++---- .../fixtures/linked-field.expected | 8 +- .../fixtures/match-field-in-query.expected | 20 ++- .../fixtures/match-field.expected | 28 ++--- .../mutation-with-enums-on-fragment.expected | 11 +- .../mutation-with-nested-fragments.expected | 22 ++-- ...with-response-on-inline-fragments.expected | 11 +- .../fixtures/plural-fragment.expected | 8 +- .../fixtures/query-with-match-fields.expected | 31 ++--- .../fixtures/query-with-module-field.expected | 22 ++-- .../query-with-multiple-match-fields.expected | 46 +++---- ...-with-raw-response-on-conditional.expected | 11 +- ...w-response-on-literal-conditional.expected | 11 +- .../fixtures/recursive-fragments.expected | 10 +- .../fixtures/refetchable-fragment.expected | 14 +-- .../fixtures/refetchable.expected | 14 +-- ...ough-inline-fragments-to-fragment.expected | 10 +- .../required-bubbles-to-fragment.expected | 8 +- ...d-bubbles-to-item-in-plural-field.expected | 8 +- ...solates-concrete-inline-fragments.expected | 20 ++- ...-throw-doesnt-bubbles-to-fragment.expected | 8 +- .../fixtures/roots.expected | 8 +- .../fixtures/scalar-field.expected | 8 +- .../fixtures/simple.expected | 8 +- ...me-inside-with-overlapping-fields.expected | 8 +- .../fixtures/typename-on-union.expected | 80 +++++------- .../unmasked-fragment-spreads.expected | 33 ++--- 34 files changed, 394 insertions(+), 540 deletions(-) diff --git a/compiler/Cargo.lock b/compiler/Cargo.lock index 3444822da1581..5b41ba7d25fa0 100644 --- a/compiler/Cargo.lock +++ b/compiler/Cargo.lock @@ -289,16 +289,16 @@ checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" [[package]] name = "criterion" -version = "0.3.3" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70daa7ceec6cf143990669a04c7df13391d55fb27bd4079d252fca774ba244d8" +checksum = "1fc755679c12bda8e5523a71e4d654b6bf2e14bd838dfc48cde6559a05caf7d1" dependencies = [ "atty", "cast", "clap", "criterion-plot", "csv", - "itertools 0.9.0", + "itertools 0.8.2", "lazy_static", "num-traits", "oorandom", @@ -306,7 +306,6 @@ dependencies = [ "rayon", "regex", "serde", - "serde_cbor", "serde_derive", "serde_json", "tinytemplate", @@ -733,31 +732,6 @@ dependencies = [ "test-schema", ] -[[package]] -name = "graphql-transforms" -version = "0.0.0" -dependencies = [ - "common", - "criterion", - "dashmap", - "errors", - "fixture-tests", - "fnv", - "graphql-cli", - "graphql-ir", - "graphql-syntax", - "graphql-test-helpers", - "graphql-text-printer", - "indexmap", - "interner", - "lazy_static", - "parking_lot", - "rayon", - "schema", - "serde", - "test-schema", -] - [[package]] name = "h2" version = "0.2.6" @@ -777,12 +751,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "half" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d36fab90f82edc3c747f9d438e06cf0a491055896f2a279638bb5beed6c40177" - [[package]] name = "hashbrown" version = "0.9.0" @@ -1590,12 +1558,12 @@ dependencies = [ "graphql-ir", "graphql-syntax", "graphql-test-helpers", - "graphql-transforms", "hex", "indexmap", "interner", "lazy_static", "md-5", + "relay-transforms", "schema", "test-schema", ] @@ -1618,7 +1586,6 @@ dependencies = [ "graphql-syntax", "graphql-test-helpers", "graphql-text-printer", - "graphql-transforms", "hex", "interner", "lazy_static", @@ -1628,6 +1595,7 @@ dependencies = [ "rayon", "regex", "relay-codegen", + "relay-transforms", "relay-typegen", "schema", "serde", @@ -1650,12 +1618,12 @@ dependencies = [ "graphql-ir", "graphql-syntax", "graphql-text-printer", - "graphql-transforms", "interner", "neon", "neon-build", "relay-codegen", "relay-compiler", + "relay-transforms", "schema", ] @@ -1690,6 +1658,31 @@ dependencies = [ "tokio", ] +[[package]] +name = "relay-transforms" +version = "0.0.0" +dependencies = [ + "common", + "criterion", + "dashmap", + "errors", + "fixture-tests", + "fnv", + "graphql-cli", + "graphql-ir", + "graphql-syntax", + "graphql-test-helpers", + "graphql-text-printer", + "indexmap", + "interner", + "lazy_static", + "parking_lot", + "rayon", + "schema", + "serde", + "test-schema", +] + [[package]] name = "relay-typegen" version = "0.0.0" @@ -1699,11 +1692,11 @@ dependencies = [ "fnv", "graphql-ir", "graphql-syntax", - "graphql-transforms", "indexmap", "interner", "lazy_static", "relay-compiler", + "relay-transforms", "schema", "serde", "test-schema", @@ -1764,21 +1757,12 @@ version = "0.0.0" dependencies = [ "common", "fixture-tests", + "graphql-syntax", "graphql-test-helpers", "interner", "thiserror", ] -[[package]] -name = "schema-diff" -version = "0.0.0" -dependencies = [ - "fnv", - "interner", - "lazy_static", - "schema", -] - [[package]] name = "schema-print" version = "0.0.0" @@ -1863,16 +1847,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_cbor" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e18acfa2f90e8b735b2836ab8d538de304cbb6729a7360729ea5a895d15a622" -dependencies = [ - "half", - "serde", -] - [[package]] name = "serde_derive" version = "1.0.116" diff --git a/compiler/crates/relay-typegen/src/flow.rs b/compiler/crates/relay-typegen/src/flow.rs index 7b044364f892e..1dac12837f742 100644 --- a/compiler/crates/relay-typegen/src/flow.rs +++ b/compiler/crates/relay-typegen/src/flow.rs @@ -6,11 +6,11 @@ */ use crate::writer::{Prop, Writer, AST, SPREAD_KEY}; -use interner::StringKey; +use interner::{Intern, StringKey}; use std::fmt::{Result, Write}; pub struct FlowPrinter { - indentation: u32, + indentation: usize, } impl Writer for FlowPrinter { @@ -30,41 +30,53 @@ impl FlowPrinter { fn write(&mut self, writer: &mut dyn Write, ast: &AST) -> Result { match ast { - AST::Any => write!(writer, "any")?, - AST::String => write!(writer, "string")?, - AST::StringLiteral(literal) => self.write_string_literal(writer, *literal)?, - AST::OtherEnumValue => self.write_other_string(writer)?, - AST::Number => write!(writer, "number")?, - AST::Boolean => write!(writer, "boolean")?, - AST::Identifier(identifier) => write!(writer, "{}", identifier)?, - AST::RawType(raw) => write!(writer, "{}", raw)?, - AST::Union(members) => self.write_union(writer, members)?, - AST::Intersection(members) => self.write_intersection(writer, members)?, - AST::ReadOnlyArray(of_type) => self.write_read_only_array(writer, of_type)?, - AST::Nullable(of_type) => self.write_nullable(writer, of_type)?, - AST::ExactObject(props) => self.write_object(writer, props, true)?, - AST::InexactObject(props) => self.write_object(writer, props, false)?, + AST::Any => write!(writer, "any"), + AST::String => write!(writer, "string"), + AST::StringLiteral(literal) => self.write_string_literal(writer, *literal), + AST::OtherEnumValue => self.write_other_string(writer), + AST::Number => write!(writer, "number"), + AST::Boolean => write!(writer, "boolean"), + AST::Identifier(identifier) => write!(writer, "{}", identifier), + AST::RawType(raw) => write!(writer, "{}", raw), + AST::Union(members) => self.write_union(writer, members), + AST::Intersection(members) => self.write_intersection(writer, members), + AST::ReadOnlyArray(of_type) => self.write_read_only_array(writer, of_type), + AST::Nullable(of_type) => self.write_nullable(writer, of_type), + AST::ExactObject(props) => self.write_object(writer, props, true), + AST::InexactObject(props) => self.write_object(writer, props, false), AST::Local3DPayload(document_name, selections) => { - self.write_local_3d_payload(writer, *document_name, selections)? + self.write_local_3d_payload(writer, *document_name, selections) } - AST::ImportType(types, from) => self.write_import_type(writer, types, from)?, - AST::DeclareExportOpaqueType(alias, value) => { - self.write_declare_export_opaque_type(writer, alias, value)? + AST::ImportType(types, from) => self.write_import_type(writer, types, from), + AST::DeclareExportFragment(alias, value) => { + let default_value = "FragmentReference".intern(); + self.write_declare_export_opaque_type( + writer, + alias, + match value { + Some(type_name) => type_name, + None => &default_value, + }, + ) } AST::ExportTypeEquals(name, value) => { - self.write_export_type_equals(writer, name, value)? + self.write_export_type_equals(writer, name, value) } - AST::ExportList(names) => self.write_export_list(writer, names)?, + AST::ExportFragmentList(names) => self.write_export_list(writer, names), + AST::ImportFragmentType(types, from) => self.write_import_type(writer, types, from), + AST::FragmentReference(fragments) => self.write_union( + writer, + fragments + .iter() + .map(|fragment| AST::Identifier(format!("{}$ref", fragment).intern())) + .collect::>() + .as_slice(), + ), } - - Ok(()) } fn write_indentation(&mut self, writer: &mut dyn Write) -> Result { - for _ in 0..self.indentation { - write!(writer, " ")?; - } - Ok(()) + writer.write_str(&" ".repeat(self.indentation)) } fn write_string_literal(&mut self, writer: &mut dyn Write, literal: StringKey) -> Result { diff --git a/compiler/crates/relay-typegen/src/lib.rs b/compiler/crates/relay-typegen/src/lib.rs index f7459ebbe4325..5758ede4079df 100644 --- a/compiler/crates/relay-typegen/src/lib.rs +++ b/compiler/crates/relay-typegen/src/lib.rs @@ -45,8 +45,8 @@ lazy_static! { static ref VARIABLES: StringKey = "variables".intern(); static ref RESPONSE: StringKey = "response".intern(); static ref KEY_DATA: StringKey = "$data".intern(); - static ref KEY_REF_TYPE: StringKey = "$refType".intern(); - static ref KEY_FRAGMENT_REFS: StringKey = "$fragmentRefs".intern(); + pub(crate) static ref KEY_REF_TYPE: StringKey = "$refType".intern(); + pub(crate) static ref KEY_FRAGMENT_REFS: StringKey = "$fragmentRefs".intern(); static ref KEY_TYPENAME: StringKey = "__typename".intern(); static ref TYPE_ID: StringKey = "ID".intern(); static ref TYPE_STRING: StringKey = "String".intern(); @@ -58,9 +58,14 @@ lazy_static! { } macro_rules! write_ast { - ($self:ident, $ast:expr) => { - ::std::writeln!($self.result, "{}", $self.writer.write_ast(&$ast)) - }; + ($self:ident, $ast:expr) => {{ + let output = $self.writer.write_ast(&$ast); + if output.is_empty() { + Ok(()) + } else { + ::std::writeln!($self.result, "{}", output) + } + }}; } pub fn generate_fragment_type( @@ -260,13 +265,13 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { read_only: true, value: AST::Identifier(format!("{}$data", node.name.item).intern()), }; - let old_fragment_type_name = format!("{}$ref", node.name.item).intern(); + let old_fragment_type_name = node.name.item; let new_fragment_type_name = format!("{}$fragmentType", node.name.item).intern(); let ref_type_fragment_ref_property = Prop { key: *KEY_FRAGMENT_REFS, optional: false, read_only: true, - value: AST::Identifier(old_fragment_type_name), + value: AST::FragmentReference(vec![old_fragment_type_name]), }; let is_plural_fragment = is_plural(node); let mut ref_type = @@ -306,26 +311,27 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { self.write_runtime_imports()?; let refetchable_metadata = extract_refetch_metadata_from_directive(&node.directives); + let old_fragment_type_name = format!("{}$ref", old_fragment_type_name).intern(); if let Some(refetchable_metadata) = refetchable_metadata { write_ast!( self, - AST::ImportType( + AST::ImportFragmentType( vec![old_fragment_type_name, new_fragment_type_name], format!("{}.graphql", refetchable_metadata.operation_name).intern(), ) )?; write_ast!( self, - AST::ExportList(vec![old_fragment_type_name, new_fragment_type_name,]) + AST::ExportFragmentList(vec![old_fragment_type_name, new_fragment_type_name,]) )?; } else { write_ast!( self, - AST::DeclareExportOpaqueType(old_fragment_type_name, "FragmentReference".intern(),) + AST::DeclareExportFragment(old_fragment_type_name, None) )?; write_ast!( self, - AST::DeclareExportOpaqueType(new_fragment_type_name, old_fragment_type_name,) + AST::DeclareExportFragment(new_fragment_type_name, Some(old_fragment_type_name)) )?; } write_ast!( @@ -738,7 +744,7 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { key: *KEY_REF_TYPE, optional: false, read_only: true, - value: AST::Identifier(fragment_type_name), + value: AST::FragmentReference(vec![fragment_type_name]), }); } if unmasked { @@ -991,7 +997,10 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { } => write_ast!( self, AST::ImportType( - vec!["FragmentReference".intern(), "Local3DPayload".intern()], + vec![ + self.writer.get_runtime_fragment_import(), + "Local3DPayload".intern() + ], "relay-runtime".intern(), ) ), @@ -1007,7 +1016,10 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { fragment_reference: true, } => write_ast!( self, - AST::ImportType(vec!["FragmentReference".intern()], "relay-runtime".intern(),) + AST::ImportType( + vec![self.writer.get_runtime_fragment_import()], + "relay-runtime".intern(), + ) ), RuntimeImports { local_3d_payload: false, @@ -1027,7 +1039,7 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { // // fragments write_ast!( self, - AST::ImportType( + AST::ImportFragmentType( vec![fragment_type_name], format!("./{}.graphql", used_fragment).intern(), ) @@ -1052,11 +1064,11 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { let new_fragment_type_name = format!("{}$fragmentType", refetchable_fragment_name).intern(); write_ast!( self, - AST::DeclareExportOpaqueType(old_fragment_type_name, "FragmentReference".intern(),) + AST::DeclareExportFragment(old_fragment_type_name, None,) )?; write_ast!( self, - AST::DeclareExportOpaqueType(new_fragment_type_name, old_fragment_type_name,) + AST::DeclareExportFragment(new_fragment_type_name, Some(old_fragment_type_name),) )?; Ok(()) } diff --git a/compiler/crates/relay-typegen/src/typescript.rs b/compiler/crates/relay-typegen/src/typescript.rs index c6bf9a829b8c5..6617eac786733 100644 --- a/compiler/crates/relay-typegen/src/typescript.rs +++ b/compiler/crates/relay-typegen/src/typescript.rs @@ -7,15 +7,20 @@ use crate::writer::{Prop, Writer, AST, SPREAD_KEY}; use crate::TypegenConfig; +use crate::{KEY_FRAGMENT_REFS, KEY_REF_TYPE}; use interner::{Intern, StringKey}; use std::fmt::{Result, Write}; pub struct TypeScriptPrinter { use_import_type_syntax: bool, - indentation: u32, + indentation: usize, } impl Writer for TypeScriptPrinter { + fn get_runtime_fragment_import(&self) -> StringKey { + "FragmentRefs".intern() + } + fn write_ast(&mut self, ast: &AST) -> String { let mut writer = String::new(); self.write(&mut writer, ast) @@ -35,41 +40,38 @@ impl TypeScriptPrinter { fn write(&mut self, writer: &mut dyn Write, ast: &AST) -> Result { match ast { - AST::Any => write!(writer, "any")?, - AST::String => write!(writer, "string")?, - AST::StringLiteral(literal) => self.write_string_literal(writer, *literal)?, - AST::OtherEnumValue => self.write_other_string(writer)?, - AST::Number => write!(writer, "number")?, - AST::Boolean => write!(writer, "boolean")?, - AST::Identifier(identifier) => write!(writer, "{}", identifier)?, - AST::RawType(raw) => write!(writer, "{}", raw)?, - AST::Union(members) => self.write_union(writer, members)?, - AST::Intersection(members) => self.write_intersection(writer, members)?, - AST::ReadOnlyArray(of_type) => self.write_read_only_array(writer, of_type)?, - AST::Nullable(of_type) => self.write_nullable(writer, of_type)?, - AST::ExactObject(props) => self.write_object(writer, props, true)?, - AST::InexactObject(props) => self.write_object(writer, props, false)?, + AST::Any => write!(writer, "any"), + AST::String => write!(writer, "string"), + AST::StringLiteral(literal) => self.write_string_literal(writer, *literal), + AST::OtherEnumValue => self.write_other_string(writer), + AST::Number => write!(writer, "number"), + AST::Boolean => write!(writer, "boolean"), + AST::Identifier(identifier) => write!(writer, "{}", identifier), + AST::RawType(raw) => write!(writer, "{}", raw), + AST::Union(members) => self.write_union(writer, members), + AST::Intersection(members) => self.write_intersection(writer, members), + AST::ReadOnlyArray(of_type) => self.write_read_only_array(writer, of_type), + AST::Nullable(of_type) => self.write_nullable(writer, of_type), + AST::ExactObject(props) => self.write_object(writer, props, true), + AST::InexactObject(props) => self.write_object(writer, props, false), AST::Local3DPayload(document_name, selections) => { - self.write_local_3d_payload(writer, *document_name, selections)? - } - AST::ImportType(types, from) => self.write_import_type(writer, types, from)?, - AST::DeclareExportOpaqueType(alias, value) => { - self.write_declare_export_opaque_type(writer, alias, value)? + self.write_local_3d_payload(writer, *document_name, selections) } + AST::ImportType(types, from) => self.write_import_type(writer, types, from), AST::ExportTypeEquals(name, value) => { - self.write_export_type_equals(writer, name, value)? + self.write_export_type_equals(writer, name, value) } - AST::ExportList(names) => self.write_export_list(writer, names)?, - } + AST::FragmentReference(fragments) => self.write_fragment_references(writer, fragments), - Ok(()) + // In Typescript, we don't export & import fragments. We just use the generic FragmentRefs type instead. + AST::ExportFragmentList(_) => Ok(()), + AST::DeclareExportFragment(_, _) => Ok(()), + AST::ImportFragmentType(_, _) => Ok(()), + } } fn write_indentation(&mut self, writer: &mut dyn Write) -> Result { - for _ in 0..self.indentation { - write!(writer, " ")?; - } - Ok(()) + writer.write_str(&" ".repeat(self.indentation)) } fn write_string_literal(&mut self, writer: &mut dyn Write, literal: StringKey) -> Result { @@ -176,7 +178,17 @@ impl TypeScriptPrinter { if prop.read_only { write!(writer, "readonly ")?; } - write!(writer, "{}", prop.key)?; + write!( + writer, + "{}", + if prop.key == *KEY_FRAGMENT_REFS { + format!("\" {}\"", *KEY_FRAGMENT_REFS).intern() + } else if prop.key == *KEY_REF_TYPE { + format!("\" {}\"", *KEY_REF_TYPE).intern() + } else { + prop.key + } + )?; if match &prop.value { AST::Nullable(_) => true, _ => prop.optional, @@ -217,6 +229,24 @@ impl TypeScriptPrinter { Ok(()) } + fn write_fragment_references( + &mut self, + writer: &mut dyn Write, + fragments: &Vec, + ) -> Result { + write!(writer, "FragmentRefs<")?; + self.write( + writer, + &AST::Union( + fragments + .iter() + .map(|key| AST::StringLiteral(*key)) + .collect(), + ), + )?; + write!(writer, ">") + } + fn write_import_type( &mut self, writer: &mut dyn Write, @@ -240,19 +270,6 @@ impl TypeScriptPrinter { ) } - fn write_declare_export_opaque_type( - &mut self, - writer: &mut dyn Write, - alias: &StringKey, - value: &StringKey, - ) -> Result { - write!( - writer, - "export type {} = {} & {{ _: \"{}\" }};", - alias, value, alias - ) - } - fn write_export_type_equals( &mut self, writer: &mut dyn Write, @@ -261,18 +278,6 @@ impl TypeScriptPrinter { ) -> Result { write!(writer, "export type {} = {};", name, self.write_ast(value)) } - - fn write_export_list(&mut self, writer: &mut dyn Write, names: &Vec) -> Result { - write!( - writer, - "export {{ {} }};", - names - .iter() - .map(|t| format!("{}", t)) - .collect::>() - .join(", "), - ) - } } #[cfg(test)] @@ -531,7 +536,6 @@ mod tests { "import { A, B } from \"module\";" ); - // TypeScriptPrinter::new(TypegenConfig { use_import_type_syntax: true, ..Default::default()}).write_ast() assert_eq!( TypeScriptPrinter::new(&TypegenConfig { use_import_type_syntax: true, diff --git a/compiler/crates/relay-typegen/src/writer.rs b/compiler/crates/relay-typegen/src/writer.rs index 70680cb395d2f..93ec133644854 100644 --- a/compiler/crates/relay-typegen/src/writer.rs +++ b/compiler/crates/relay-typegen/src/writer.rs @@ -27,9 +27,11 @@ pub enum AST { Number, Boolean, Any, + FragmentReference(Vec), ImportType(Vec, StringKey), - DeclareExportOpaqueType(StringKey, StringKey), - ExportList(Vec), + ImportFragmentType(Vec, StringKey), + DeclareExportFragment(StringKey, Option), + ExportFragmentList(Vec), ExportTypeEquals(StringKey, Box), } @@ -47,5 +49,9 @@ lazy_static! { } pub trait Writer { + fn get_runtime_fragment_import(&self) -> StringKey { + "FragmentReference".intern() + } + fn write_ast(&mut self, ast: &AST) -> String; } diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/conditional.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/conditional.expected index 66781a28c5d22..47ae18fdb641e 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/conditional.expected @@ -9,28 +9,24 @@ fragment NestedCondition on Node { } } ==================================== OUTPUT =================================== -import { FragmentReference } from "relay-runtime"; -export type ConditionField$ref = FragmentReference & { _: "ConditionField$ref" }; -export type ConditionField$fragmentType = ConditionField$ref & { _: "ConditionField$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type ConditionField = { readonly id?: string, - readonly $refType: ConditionField$ref, + readonly " $refType": FragmentRefs<"ConditionField">, }; export type ConditionField$data = ConditionField; export type ConditionField$key = { readonly $data?: ConditionField$data, - readonly $fragmentRefs: ConditionField$ref, + readonly " $fragmentRefs": FragmentRefs<"ConditionField">, }; ------------------------------------------------------------------------------- -import { FragmentReference } from "relay-runtime"; -export type NestedCondition$ref = FragmentReference & { _: "NestedCondition$ref" }; -export type NestedCondition$fragmentType = NestedCondition$ref & { _: "NestedCondition$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type NestedCondition = { readonly id?: string, - readonly $refType: NestedCondition$ref, + readonly " $refType": FragmentRefs<"NestedCondition">, }; export type NestedCondition$data = NestedCondition; export type NestedCondition$key = { readonly $data?: NestedCondition$data, - readonly $fragmentRefs: NestedCondition$ref, + readonly " $fragmentRefs": FragmentRefs<"NestedCondition">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected index f076c6c0c992f..9e144628794ce 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected @@ -48,15 +48,12 @@ fragment UserFrag2 on User { __typename } ==================================== OUTPUT =================================== -import { PageFragment$ref } from "./PageFragment.graphql"; -import { FragmentReference } from "relay-runtime"; -export type ConcreateTypes$ref = FragmentReference & { _: "ConcreateTypes$ref" }; -export type ConcreateTypes$fragmentType = ConcreateTypes$ref & { _: "ConcreateTypes$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type ConcreateTypes = { readonly actor?: { readonly __typename: "Page", readonly id: string, - readonly $fragmentRefs: PageFragment$ref, + readonly " $fragmentRefs": PageFragment$ref, } | { readonly __typename: "User", readonly name?: string, @@ -65,120 +62,104 @@ export type ConcreateTypes = { // value in case none of the concrete values match. readonly __typename: "%other" }, - readonly $refType: ConcreateTypes$ref, + readonly " $refType": FragmentRefs<"ConcreateTypes">, }; export type ConcreateTypes$data = ConcreateTypes; export type ConcreateTypes$key = { readonly $data?: ConcreateTypes$data, - readonly $fragmentRefs: ConcreateTypes$ref, + readonly " $fragmentRefs": FragmentRefs<"ConcreateTypes">, }; ------------------------------------------------------------------------------- -import { OtherFragment$ref } from "./OtherFragment.graphql"; -import { PictureFragment$ref } from "./PictureFragment.graphql"; -import { UserFrag1$ref } from "./UserFrag1.graphql"; -import { UserFrag2$ref } from "./UserFrag2.graphql"; -import { FragmentReference } from "relay-runtime"; -export type FragmentSpread$ref = FragmentReference & { _: "FragmentSpread$ref" }; -export type FragmentSpread$fragmentType = FragmentSpread$ref & { _: "FragmentSpread$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type FragmentSpread = { readonly id: string, readonly justFrag?: { - readonly $fragmentRefs: PictureFragment$ref + readonly " $fragmentRefs": PictureFragment$ref }, readonly fragAndField?: { readonly uri?: string, - readonly $fragmentRefs: PictureFragment$ref, + readonly " $fragmentRefs": PictureFragment$ref, }, - readonly $fragmentRefs: OtherFragment$ref & UserFrag1$ref & UserFrag2$ref, - readonly $refType: FragmentSpread$ref, + readonly " $fragmentRefs": OtherFragment$ref & UserFrag1$ref & UserFrag2$ref, + readonly " $refType": FragmentRefs<"FragmentSpread">, }; export type FragmentSpread$data = FragmentSpread; export type FragmentSpread$key = { readonly $data?: FragmentSpread$data, - readonly $fragmentRefs: FragmentSpread$ref, + readonly " $fragmentRefs": FragmentRefs<"FragmentSpread">, }; ------------------------------------------------------------------------------- -import { FragmentReference } from "relay-runtime"; -export type OtherFragment$ref = FragmentReference & { _: "OtherFragment$ref" }; -export type OtherFragment$fragmentType = OtherFragment$ref & { _: "OtherFragment$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type OtherFragment = { readonly __typename: string, - readonly $refType: OtherFragment$ref, + readonly " $refType": FragmentRefs<"OtherFragment">, }; export type OtherFragment$data = OtherFragment; export type OtherFragment$key = { readonly $data?: OtherFragment$data, - readonly $fragmentRefs: OtherFragment$ref, + readonly " $fragmentRefs": FragmentRefs<"OtherFragment">, }; ------------------------------------------------------------------------------- -import { FragmentReference } from "relay-runtime"; -export type PageFragment$ref = FragmentReference & { _: "PageFragment$ref" }; -export type PageFragment$fragmentType = PageFragment$ref & { _: "PageFragment$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type PageFragment = { readonly __typename: "Page", - readonly $refType: PageFragment$ref, + readonly " $refType": FragmentRefs<"PageFragment">, } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly __typename: "%other", - readonly $refType: PageFragment$ref, + readonly " $refType": FragmentRefs<"PageFragment">, }; export type PageFragment$data = PageFragment; export type PageFragment$key = { readonly $data?: PageFragment$data, - readonly $fragmentRefs: PageFragment$ref, + readonly " $fragmentRefs": FragmentRefs<"PageFragment">, }; ------------------------------------------------------------------------------- -import { FragmentReference } from "relay-runtime"; -export type PictureFragment$ref = FragmentReference & { _: "PictureFragment$ref" }; -export type PictureFragment$fragmentType = PictureFragment$ref & { _: "PictureFragment$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type PictureFragment = { readonly __typename: "Image", - readonly $refType: PictureFragment$ref, + readonly " $refType": FragmentRefs<"PictureFragment">, } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly __typename: "%other", - readonly $refType: PictureFragment$ref, + readonly " $refType": FragmentRefs<"PictureFragment">, }; export type PictureFragment$data = PictureFragment; export type PictureFragment$key = { readonly $data?: PictureFragment$data, - readonly $fragmentRefs: PictureFragment$ref, + readonly " $fragmentRefs": FragmentRefs<"PictureFragment">, }; ------------------------------------------------------------------------------- -import { FragmentReference } from "relay-runtime"; -export type UserFrag1$ref = FragmentReference & { _: "UserFrag1$ref" }; -export type UserFrag1$fragmentType = UserFrag1$ref & { _: "UserFrag1$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type UserFrag1 = { readonly __typename: "User", - readonly $refType: UserFrag1$ref, + readonly " $refType": FragmentRefs<"UserFrag1">, } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly __typename: "%other", - readonly $refType: UserFrag1$ref, + readonly " $refType": FragmentRefs<"UserFrag1">, }; export type UserFrag1$data = UserFrag1; export type UserFrag1$key = { readonly $data?: UserFrag1$data, - readonly $fragmentRefs: UserFrag1$ref, + readonly " $fragmentRefs": FragmentRefs<"UserFrag1">, }; ------------------------------------------------------------------------------- -import { FragmentReference } from "relay-runtime"; -export type UserFrag2$ref = FragmentReference & { _: "UserFrag2$ref" }; -export type UserFrag2$fragmentType = UserFrag2$ref & { _: "UserFrag2$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type UserFrag2 = { readonly __typename: "User", - readonly $refType: UserFrag2$ref, + readonly " $refType": FragmentRefs<"UserFrag2">, } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly __typename: "%other", - readonly $refType: UserFrag2$ref, + readonly " $refType": FragmentRefs<"UserFrag2">, }; export type UserFrag2$data = UserFrag2; export type UserFrag2$key = { readonly $data?: UserFrag2$data, - readonly $fragmentRefs: UserFrag2$ref, + readonly " $fragmentRefs": FragmentRefs<"UserFrag2">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected index c6ffab4ff8c2f..614839b3565ab 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected @@ -64,41 +64,34 @@ fragment SomeFragment on User { __typename } ==================================== OUTPUT =================================== -import { FragmentReference } from "relay-runtime"; -export type InlineFragment$ref = FragmentReference & { _: "InlineFragment$ref" }; -export type InlineFragment$fragmentType = InlineFragment$ref & { _: "InlineFragment$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type InlineFragment = { readonly id: string, readonly name?: string, readonly message?: { readonly text?: string }, - readonly $refType: InlineFragment$ref, + readonly " $refType": FragmentRefs<"InlineFragment">, }; export type InlineFragment$data = InlineFragment; export type InlineFragment$key = { readonly $data?: InlineFragment$data, - readonly $fragmentRefs: InlineFragment$ref, + readonly " $fragmentRefs": FragmentRefs<"InlineFragment">, }; ------------------------------------------------------------------------------- -import { FragmentReference } from "relay-runtime"; -export type InlineFragmentConditionalID$ref = FragmentReference & { _: "InlineFragmentConditionalID$ref" }; -export type InlineFragmentConditionalID$fragmentType = InlineFragmentConditionalID$ref & { _: "InlineFragmentConditionalID$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type InlineFragmentConditionalID = { readonly id?: string, readonly name?: string, - readonly $refType: InlineFragmentConditionalID$ref, + readonly " $refType": FragmentRefs<"InlineFragmentConditionalID">, }; export type InlineFragmentConditionalID$data = InlineFragmentConditionalID; export type InlineFragmentConditionalID$key = { readonly $data?: InlineFragmentConditionalID$data, - readonly $fragmentRefs: InlineFragmentConditionalID$ref, + readonly " $fragmentRefs": FragmentRefs<"InlineFragmentConditionalID">, }; ------------------------------------------------------------------------------- -import { SomeFragment$ref } from "./SomeFragment.graphql"; -import { FragmentReference } from "relay-runtime"; -export type InlineFragmentKitchenSink$ref = FragmentReference & { _: "InlineFragmentKitchenSink$ref" }; -export type InlineFragmentKitchenSink$fragmentType = InlineFragmentKitchenSink$ref & { _: "InlineFragmentKitchenSink$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type InlineFragmentKitchenSink = { readonly actor?: { readonly id: string, @@ -108,19 +101,17 @@ export type InlineFragmentKitchenSink = { readonly height?: number, }, readonly name?: string, - readonly $fragmentRefs: SomeFragment$ref, + readonly " $fragmentRefs": SomeFragment$ref, }, - readonly $refType: InlineFragmentKitchenSink$ref, + readonly " $refType": FragmentRefs<"InlineFragmentKitchenSink">, }; export type InlineFragmentKitchenSink$data = InlineFragmentKitchenSink; export type InlineFragmentKitchenSink$key = { readonly $data?: InlineFragmentKitchenSink$data, - readonly $fragmentRefs: InlineFragmentKitchenSink$ref, + readonly " $fragmentRefs": FragmentRefs<"InlineFragmentKitchenSink">, }; ------------------------------------------------------------------------------- -import { FragmentReference } from "relay-runtime"; -export type InlineFragmentWithOverlappingFields$ref = FragmentReference & { _: "InlineFragmentWithOverlappingFields$ref" }; -export type InlineFragmentWithOverlappingFields$fragmentType = InlineFragmentWithOverlappingFields$ref & { _: "InlineFragmentWithOverlappingFields$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type InlineFragmentWithOverlappingFields = { readonly hometown?: { readonly id: string, @@ -130,28 +121,26 @@ export type InlineFragmentWithOverlappingFields = { }, }, readonly name?: string, - readonly $refType: InlineFragmentWithOverlappingFields$ref, + readonly " $refType": FragmentRefs<"InlineFragmentWithOverlappingFields">, }; export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; export type InlineFragmentWithOverlappingFields$key = { readonly $data?: InlineFragmentWithOverlappingFields$data, - readonly $fragmentRefs: InlineFragmentWithOverlappingFields$ref, + readonly " $fragmentRefs": FragmentRefs<"InlineFragmentWithOverlappingFields">, }; ------------------------------------------------------------------------------- -import { FragmentReference } from "relay-runtime"; -export type SomeFragment$ref = FragmentReference & { _: "SomeFragment$ref" }; -export type SomeFragment$fragmentType = SomeFragment$ref & { _: "SomeFragment$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type SomeFragment = { readonly __typename: "User", - readonly $refType: SomeFragment$ref, + readonly " $refType": FragmentRefs<"SomeFragment">, } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly __typename: "%other", - readonly $refType: SomeFragment$ref, + readonly " $refType": FragmentRefs<"SomeFragment">, }; export type SomeFragment$data = SomeFragment; export type SomeFragment$key = { readonly $data?: SomeFragment$data, - readonly $fragmentRefs: SomeFragment$ref, + readonly " $fragmentRefs": FragmentRefs<"SomeFragment">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected index 0838629157fba..4d34063e4d14c 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected @@ -43,9 +43,7 @@ export type UnionTypeTest = { response: UnionTypeTestResponse, }; ------------------------------------------------------------------------------- -import { FragmentReference } from "relay-runtime"; -export type LinkedField$ref = FragmentReference & { _: "LinkedField$ref" }; -export type LinkedField$fragmentType = LinkedField$ref & { _: "LinkedField$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type LinkedField = { readonly profilePicture?: { readonly uri?: string, @@ -61,10 +59,10 @@ export type LinkedField = { readonly actor?: { readonly id: string }, - readonly $refType: LinkedField$ref, + readonly " $refType": FragmentRefs<"LinkedField">, }; export type LinkedField$data = LinkedField; export type LinkedField$key = { readonly $data?: LinkedField$data, - readonly $fragmentRefs: LinkedField$ref, + readonly " $fragmentRefs": FragmentRefs<"LinkedField">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected index 8bacb5672c0a0..9029c8cbbc9cd 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected @@ -23,15 +23,13 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { } } ==================================== OUTPUT =================================== -import { MarkdownUserNameRenderer_name$ref } from "./MarkdownUserNameRenderer_name.graphql"; -import { PlainUserNameRenderer_name$ref } from "./PlainUserNameRenderer_name.graphql"; export type NameRendererQueryVariables = {}; export type NameRendererQueryResponse = { readonly me?: { readonly nameRenderer?: { readonly __fragmentPropName?: string, readonly __module_component?: string, - readonly $fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, + readonly " $fragmentRefs": PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, } } }; @@ -40,34 +38,30 @@ export type NameRendererQuery = { response: NameRendererQueryResponse, }; ------------------------------------------------------------------------------- -import { FragmentReference } from "relay-runtime"; -export type MarkdownUserNameRenderer_name$ref = FragmentReference & { _: "MarkdownUserNameRenderer_name$ref" }; -export type MarkdownUserNameRenderer_name$fragmentType = MarkdownUserNameRenderer_name$ref & { _: "MarkdownUserNameRenderer_name$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type MarkdownUserNameRenderer_name = { readonly markdown?: string, readonly data?: { readonly markup?: string }, - readonly $refType: MarkdownUserNameRenderer_name$ref, + readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">, }; export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; export type MarkdownUserNameRenderer_name$key = { readonly $data?: MarkdownUserNameRenderer_name$data, - readonly $fragmentRefs: MarkdownUserNameRenderer_name$ref, + readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">, }; ------------------------------------------------------------------------------- -import { FragmentReference } from "relay-runtime"; -export type PlainUserNameRenderer_name$ref = FragmentReference & { _: "PlainUserNameRenderer_name$ref" }; -export type PlainUserNameRenderer_name$fragmentType = PlainUserNameRenderer_name$ref & { _: "PlainUserNameRenderer_name$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type PlainUserNameRenderer_name = { readonly plaintext?: string, readonly data?: { readonly text?: string }, - readonly $refType: PlainUserNameRenderer_name$ref, + readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">, }; export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; export type PlainUserNameRenderer_name$key = { readonly $data?: PlainUserNameRenderer_name$data, - readonly $fragmentRefs: PlainUserNameRenderer_name$ref, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected index 40719cce79468..a7e7b1c4ed7e4 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected @@ -22,54 +22,46 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { } } ==================================== OUTPUT =================================== -import { FragmentReference } from "relay-runtime"; -export type MarkdownUserNameRenderer_name$ref = FragmentReference & { _: "MarkdownUserNameRenderer_name$ref" }; -export type MarkdownUserNameRenderer_name$fragmentType = MarkdownUserNameRenderer_name$ref & { _: "MarkdownUserNameRenderer_name$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type MarkdownUserNameRenderer_name = { readonly markdown?: string, readonly data?: { readonly markup?: string }, - readonly $refType: MarkdownUserNameRenderer_name$ref, + readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">, }; export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; export type MarkdownUserNameRenderer_name$key = { readonly $data?: MarkdownUserNameRenderer_name$data, - readonly $fragmentRefs: MarkdownUserNameRenderer_name$ref, + readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">, }; ------------------------------------------------------------------------------- -import { MarkdownUserNameRenderer_name$ref } from "./MarkdownUserNameRenderer_name.graphql"; -import { PlainUserNameRenderer_name$ref } from "./PlainUserNameRenderer_name.graphql"; -import { FragmentReference } from "relay-runtime"; -export type NameRendererFragment$ref = FragmentReference & { _: "NameRendererFragment$ref" }; -export type NameRendererFragment$fragmentType = NameRendererFragment$ref & { _: "NameRendererFragment$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type NameRendererFragment = { readonly id: string, readonly nameRenderer?: { readonly __fragmentPropName?: string, readonly __module_component?: string, - readonly $fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, + readonly " $fragmentRefs": PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, }, - readonly $refType: NameRendererFragment$ref, + readonly " $refType": FragmentRefs<"NameRendererFragment">, }; export type NameRendererFragment$data = NameRendererFragment; export type NameRendererFragment$key = { readonly $data?: NameRendererFragment$data, - readonly $fragmentRefs: NameRendererFragment$ref, + readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment">, }; ------------------------------------------------------------------------------- -import { FragmentReference } from "relay-runtime"; -export type PlainUserNameRenderer_name$ref = FragmentReference & { _: "PlainUserNameRenderer_name$ref" }; -export type PlainUserNameRenderer_name$fragmentType = PlainUserNameRenderer_name$ref & { _: "PlainUserNameRenderer_name$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type PlainUserNameRenderer_name = { readonly plaintext?: string, readonly data?: { readonly text?: string }, - readonly $refType: PlainUserNameRenderer_name$ref, + readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">, }; export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; export type PlainUserNameRenderer_name$key = { readonly $data?: PlainUserNameRenderer_name$data, - readonly $fragmentRefs: PlainUserNameRenderer_name$ref, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected index 40490a1c9dcf9..13c47367755d5 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected @@ -27,7 +27,6 @@ fragment FriendFragment on User { } } ==================================== OUTPUT =================================== -import { FriendFragment$ref } from "./FriendFragment.graphql"; export type TestEnums = "mark" | "zuck" | "%future added value"; export type CommentCreateInput = { clientMutationId?: string, @@ -53,7 +52,7 @@ export type CommentCreateMutationResponse = { readonly node?: { readonly id: string, readonly __typename: string, - readonly $fragmentRefs: FriendFragment$ref, + readonly " $fragmentRefs": FriendFragment$ref, } } | null> } @@ -87,19 +86,17 @@ export type CommentCreateMutation = { }; ------------------------------------------------------------------------------- export type TestEnums = "mark" | "zuck" | "%future added value"; -import { FragmentReference } from "relay-runtime"; -export type FriendFragment$ref = FragmentReference & { _: "FriendFragment$ref" }; -export type FriendFragment$fragmentType = FriendFragment$ref & { _: "FriendFragment$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type FriendFragment = { readonly name?: string, readonly lastName?: string, readonly profilePicture2?: { readonly test_enums?: TestEnums }, - readonly $refType: FriendFragment$ref, + readonly " $refType": FragmentRefs<"FriendFragment">, }; export type FriendFragment$data = FriendFragment; export type FriendFragment$key = { readonly $data?: FriendFragment$data, - readonly $fragmentRefs: FriendFragment$ref, + readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected index 4c9fb27e9e20a..58b867b4a26a1 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected @@ -31,7 +31,6 @@ fragment FeedbackFragment on Feedback { name } ==================================== OUTPUT =================================== -import { FriendFragment$ref } from "./FriendFragment.graphql"; export type CommentCreateInput = { clientMutationId?: string, feedbackId?: string, @@ -55,7 +54,7 @@ export type CommentCreateMutationResponse = { readonly edges?: ReadonlyArray<{ readonly node?: { readonly lastName?: string, - readonly $fragmentRefs: FriendFragment$ref, + readonly " $fragmentRefs": FriendFragment$ref, } } | null> } @@ -88,34 +87,29 @@ export type CommentCreateMutation = { rawResponse: CommentCreateMutationRawResponse, }; ------------------------------------------------------------------------------- -import { FragmentReference } from "relay-runtime"; -export type FeedbackFragment$ref = FragmentReference & { _: "FeedbackFragment$ref" }; -export type FeedbackFragment$fragmentType = FeedbackFragment$ref & { _: "FeedbackFragment$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type FeedbackFragment = { readonly id: string, readonly name?: string, - readonly $refType: FeedbackFragment$ref, + readonly " $refType": FragmentRefs<"FeedbackFragment">, }; export type FeedbackFragment$data = FeedbackFragment; export type FeedbackFragment$key = { readonly $data?: FeedbackFragment$data, - readonly $fragmentRefs: FeedbackFragment$ref, + readonly " $fragmentRefs": FragmentRefs<"FeedbackFragment">, }; ------------------------------------------------------------------------------- -import { FeedbackFragment$ref } from "./FeedbackFragment.graphql"; -import { FragmentReference } from "relay-runtime"; -export type FriendFragment$ref = FragmentReference & { _: "FriendFragment$ref" }; -export type FriendFragment$fragmentType = FriendFragment$ref & { _: "FriendFragment$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type FriendFragment = { readonly name?: string, readonly lastName?: string, readonly feedback?: { - readonly $fragmentRefs: FeedbackFragment$ref + readonly " $fragmentRefs": FeedbackFragment$ref }, - readonly $refType: FriendFragment$ref, + readonly " $refType": FragmentRefs<"FriendFragment">, }; export type FriendFragment$data = FriendFragment; export type FriendFragment$key = { readonly $data?: FriendFragment$data, - readonly $fragmentRefs: FriendFragment$ref, + readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected index f194dc1816161..0f6203566e91a 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected @@ -27,7 +27,6 @@ fragment InlineFragmentWithOverlappingFields on Actor { } } ==================================== OUTPUT =================================== -import { InlineFragmentWithOverlappingFields$ref } from "./InlineFragmentWithOverlappingFields.graphql"; export type CommentCreateInput = { clientMutationId?: string, feedbackId?: string, @@ -46,7 +45,7 @@ export type TestMutationResponse = { readonly commentCreate?: { readonly viewer?: { readonly actor?: { - readonly $fragmentRefs: InlineFragmentWithOverlappingFields$ref + readonly " $fragmentRefs": InlineFragmentWithOverlappingFields$ref } } } @@ -87,9 +86,7 @@ export type TestMutation = { rawResponse: TestMutationRawResponse, }; ------------------------------------------------------------------------------- -import { FragmentReference } from "relay-runtime"; -export type InlineFragmentWithOverlappingFields$ref = FragmentReference & { _: "InlineFragmentWithOverlappingFields$ref" }; -export type InlineFragmentWithOverlappingFields$fragmentType = InlineFragmentWithOverlappingFields$ref & { _: "InlineFragmentWithOverlappingFields$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type InlineFragmentWithOverlappingFields = { readonly hometown?: { readonly id: string, @@ -99,10 +96,10 @@ export type InlineFragmentWithOverlappingFields = { }, }, readonly name?: string, - readonly $refType: InlineFragmentWithOverlappingFields$ref, + readonly " $refType": FragmentRefs<"InlineFragmentWithOverlappingFields">, }; export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; export type InlineFragmentWithOverlappingFields$key = { readonly $data?: InlineFragmentWithOverlappingFields$data, - readonly $fragmentRefs: InlineFragmentWithOverlappingFields$ref, + readonly " $fragmentRefs": FragmentRefs<"InlineFragmentWithOverlappingFields">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/plural-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/plural-fragment.expected index 257819cd17055..225755f758e04 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/plural-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/plural-fragment.expected @@ -3,15 +3,13 @@ fragment PluralFragment on Node @relay(plural: true) { id } ==================================== OUTPUT =================================== -import { FragmentReference } from "relay-runtime"; -export type PluralFragment$ref = FragmentReference & { _: "PluralFragment$ref" }; -export type PluralFragment$fragmentType = PluralFragment$ref & { _: "PluralFragment$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type PluralFragment = ReadonlyArray<{ readonly id: string, - readonly $refType: PluralFragment$ref, + readonly " $refType": FragmentRefs<"PluralFragment">, }>; export type PluralFragment$data = PluralFragment; export type PluralFragment$key = ReadonlyArray<{ readonly $data?: PluralFragment$data, - readonly $fragmentRefs: PluralFragment$ref, + readonly " $fragmentRefs": FragmentRefs<"PluralFragment">, }>; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected index 9111f41bbd246..7bbc0a2a18171 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected @@ -29,11 +29,10 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { } ==================================== OUTPUT =================================== import { Local3DPayload } from "relay-runtime"; -import { NameRendererFragment$ref } from "./NameRendererFragment.graphql"; export type TestVariables = {}; export type TestResponse = { readonly node?: { - readonly $fragmentRefs: NameRendererFragment$ref + readonly " $fragmentRefs": NameRendererFragment$ref } }; export type PlainUserNameRenderer_name = { @@ -80,54 +79,46 @@ export type Test = { rawResponse: TestRawResponse, }; ------------------------------------------------------------------------------- -import { FragmentReference } from "relay-runtime"; -export type MarkdownUserNameRenderer_name$ref = FragmentReference & { _: "MarkdownUserNameRenderer_name$ref" }; -export type MarkdownUserNameRenderer_name$fragmentType = MarkdownUserNameRenderer_name$ref & { _: "MarkdownUserNameRenderer_name$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type MarkdownUserNameRenderer_name = { readonly markdown?: string, readonly data?: { readonly markup?: string }, - readonly $refType: MarkdownUserNameRenderer_name$ref, + readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">, }; export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; export type MarkdownUserNameRenderer_name$key = { readonly $data?: MarkdownUserNameRenderer_name$data, - readonly $fragmentRefs: MarkdownUserNameRenderer_name$ref, + readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">, }; ------------------------------------------------------------------------------- -import { MarkdownUserNameRenderer_name$ref } from "./MarkdownUserNameRenderer_name.graphql"; -import { PlainUserNameRenderer_name$ref } from "./PlainUserNameRenderer_name.graphql"; -import { FragmentReference } from "relay-runtime"; -export type NameRendererFragment$ref = FragmentReference & { _: "NameRendererFragment$ref" }; -export type NameRendererFragment$fragmentType = NameRendererFragment$ref & { _: "NameRendererFragment$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type NameRendererFragment = { readonly id: string, readonly nameRenderer?: { readonly __fragmentPropName?: string, readonly __module_component?: string, - readonly $fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, + readonly " $fragmentRefs": PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, }, - readonly $refType: NameRendererFragment$ref, + readonly " $refType": FragmentRefs<"NameRendererFragment">, }; export type NameRendererFragment$data = NameRendererFragment; export type NameRendererFragment$key = { readonly $data?: NameRendererFragment$data, - readonly $fragmentRefs: NameRendererFragment$ref, + readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment">, }; ------------------------------------------------------------------------------- -import { FragmentReference } from "relay-runtime"; -export type PlainUserNameRenderer_name$ref = FragmentReference & { _: "PlainUserNameRenderer_name$ref" }; -export type PlainUserNameRenderer_name$fragmentType = PlainUserNameRenderer_name$ref & { _: "PlainUserNameRenderer_name$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type PlainUserNameRenderer_name = { readonly plaintext?: string, readonly data?: { readonly text?: string }, - readonly $refType: PlainUserNameRenderer_name$ref, + readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">, }; export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; export type PlainUserNameRenderer_name$key = { readonly $data?: PlainUserNameRenderer_name$data, - readonly $fragmentRefs: PlainUserNameRenderer_name$ref, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected index ec9c77cb5ed88..4639299748dde 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected @@ -18,11 +18,10 @@ fragment Test_userRenderer on PlainUserRenderer { } ==================================== OUTPUT =================================== import { Local3DPayload } from "relay-runtime"; -import { Test_user$ref } from "./Test_user.graphql"; export type TestVariables = {}; export type TestResponse = { readonly node?: { - readonly $fragmentRefs: Test_user$ref + readonly " $fragmentRefs": Test_user$ref } }; export type Test_userRenderer = { @@ -50,35 +49,30 @@ export type Test = { rawResponse: TestRawResponse, }; ------------------------------------------------------------------------------- -import { Test_userRenderer$ref } from "./Test_userRenderer.graphql"; -import { FragmentReference } from "relay-runtime"; -export type Test_user$ref = FragmentReference & { _: "Test_user$ref" }; -export type Test_user$fragmentType = Test_user$ref & { _: "Test_user$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type Test_user = { readonly plainUserRenderer?: { readonly __fragmentPropName?: string, readonly __module_component?: string, - readonly $fragmentRefs: Test_userRenderer$ref, + readonly " $fragmentRefs": Test_userRenderer$ref, }, - readonly $refType: Test_user$ref, + readonly " $refType": FragmentRefs<"Test_user">, }; export type Test_user$data = Test_user; export type Test_user$key = { readonly $data?: Test_user$data, - readonly $fragmentRefs: Test_user$ref, + readonly " $fragmentRefs": FragmentRefs<"Test_user">, }; ------------------------------------------------------------------------------- -import { FragmentReference } from "relay-runtime"; -export type Test_userRenderer$ref = FragmentReference & { _: "Test_userRenderer$ref" }; -export type Test_userRenderer$fragmentType = Test_userRenderer$ref & { _: "Test_userRenderer$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type Test_userRenderer = { readonly user?: { readonly username?: string }, - readonly $refType: Test_userRenderer$ref, + readonly " $refType": FragmentRefs<"Test_userRenderer">, }; export type Test_userRenderer$data = Test_userRenderer; export type Test_userRenderer$key = { readonly $data?: Test_userRenderer$data, - readonly $fragmentRefs: Test_userRenderer$ref, + readonly " $fragmentRefs": FragmentRefs<"Test_userRenderer">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected index 3ee5c728751be..8db0f999a4c11 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected @@ -49,18 +49,16 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { } ==================================== OUTPUT =================================== import { Local3DPayload } from "relay-runtime"; -import { AnotherNameRendererFragment$ref } from "./AnotherNameRendererFragment.graphql"; -import { NameRendererFragment$ref } from "./NameRendererFragment.graphql"; export type TestVariables = {}; export type TestResponse = { readonly node?: { readonly username?: string, - readonly $fragmentRefs: NameRendererFragment$ref, + readonly " $fragmentRefs": NameRendererFragment$ref, }, readonly viewer?: { readonly actor?: { readonly name?: string, - readonly $fragmentRefs: AnotherNameRendererFragment$ref, + readonly " $fragmentRefs": AnotherNameRendererFragment$ref, } }, }; @@ -134,74 +132,62 @@ export type Test = { rawResponse: TestRawResponse, }; ------------------------------------------------------------------------------- -import { MarkdownUserNameRenderer_name$ref } from "./MarkdownUserNameRenderer_name.graphql"; -import { PlainUserNameRenderer_name$ref } from "./PlainUserNameRenderer_name.graphql"; -import { FragmentReference } from "relay-runtime"; -export type AnotherNameRendererFragment$ref = FragmentReference & { _: "AnotherNameRendererFragment$ref" }; -export type AnotherNameRendererFragment$fragmentType = AnotherNameRendererFragment$ref & { _: "AnotherNameRendererFragment$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type AnotherNameRendererFragment = { readonly name?: string, readonly nameRenderer?: { readonly __fragmentPropName?: string, readonly __module_component?: string, - readonly $fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, + readonly " $fragmentRefs": PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, }, - readonly $refType: AnotherNameRendererFragment$ref, + readonly " $refType": FragmentRefs<"AnotherNameRendererFragment">, }; export type AnotherNameRendererFragment$data = AnotherNameRendererFragment; export type AnotherNameRendererFragment$key = { readonly $data?: AnotherNameRendererFragment$data, - readonly $fragmentRefs: AnotherNameRendererFragment$ref, + readonly " $fragmentRefs": FragmentRefs<"AnotherNameRendererFragment">, }; ------------------------------------------------------------------------------- -import { FragmentReference } from "relay-runtime"; -export type MarkdownUserNameRenderer_name$ref = FragmentReference & { _: "MarkdownUserNameRenderer_name$ref" }; -export type MarkdownUserNameRenderer_name$fragmentType = MarkdownUserNameRenderer_name$ref & { _: "MarkdownUserNameRenderer_name$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type MarkdownUserNameRenderer_name = { readonly markdown?: string, readonly data?: { readonly markup?: string }, - readonly $refType: MarkdownUserNameRenderer_name$ref, + readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">, }; export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; export type MarkdownUserNameRenderer_name$key = { readonly $data?: MarkdownUserNameRenderer_name$data, - readonly $fragmentRefs: MarkdownUserNameRenderer_name$ref, + readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">, }; ------------------------------------------------------------------------------- -import { MarkdownUserNameRenderer_name$ref } from "./MarkdownUserNameRenderer_name.graphql"; -import { PlainUserNameRenderer_name$ref } from "./PlainUserNameRenderer_name.graphql"; -import { FragmentReference } from "relay-runtime"; -export type NameRendererFragment$ref = FragmentReference & { _: "NameRendererFragment$ref" }; -export type NameRendererFragment$fragmentType = NameRendererFragment$ref & { _: "NameRendererFragment$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type NameRendererFragment = { readonly id: string, readonly nameRenderer?: { readonly __fragmentPropName?: string, readonly __module_component?: string, - readonly $fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, + readonly " $fragmentRefs": PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, }, - readonly $refType: NameRendererFragment$ref, + readonly " $refType": FragmentRefs<"NameRendererFragment">, }; export type NameRendererFragment$data = NameRendererFragment; export type NameRendererFragment$key = { readonly $data?: NameRendererFragment$data, - readonly $fragmentRefs: NameRendererFragment$ref, + readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment">, }; ------------------------------------------------------------------------------- -import { FragmentReference } from "relay-runtime"; -export type PlainUserNameRenderer_name$ref = FragmentReference & { _: "PlainUserNameRenderer_name$ref" }; -export type PlainUserNameRenderer_name$fragmentType = PlainUserNameRenderer_name$ref & { _: "PlainUserNameRenderer_name$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type PlainUserNameRenderer_name = { readonly plaintext?: string, readonly data?: { readonly text?: string }, - readonly $refType: PlainUserNameRenderer_name$ref, + readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">, }; export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; export type PlainUserNameRenderer_name$key = { readonly $data?: PlainUserNameRenderer_name$data, - readonly $fragmentRefs: PlainUserNameRenderer_name$ref, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected index 5540c86d9cedf..7748712b35436 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected @@ -16,14 +16,13 @@ fragment FriendFragment on User { } } ==================================== OUTPUT =================================== -import { FriendFragment$ref } from "./FriendFragment.graphql"; export type ExampleQueryVariables = { id: string, condition: boolean, }; export type ExampleQueryResponse = { readonly node?: { - readonly $fragmentRefs: FriendFragment$ref + readonly " $fragmentRefs": FriendFragment$ref } }; export type ExampleQueryRawResponse = { @@ -47,9 +46,7 @@ export type ExampleQuery = { rawResponse: ExampleQueryRawResponse, }; ------------------------------------------------------------------------------- -import { FragmentReference } from "relay-runtime"; -export type FriendFragment$ref = FragmentReference & { _: "FriendFragment$ref" }; -export type FriendFragment$fragmentType = FriendFragment$ref & { _: "FriendFragment$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type FriendFragment = { readonly name?: string, readonly lastName?: string, @@ -57,10 +54,10 @@ export type FriendFragment = { readonly id: string, readonly name?: string, }, - readonly $refType: FriendFragment$ref, + readonly " $refType": FragmentRefs<"FriendFragment">, }; export type FriendFragment$data = FriendFragment; export type FriendFragment$key = { readonly $data?: FriendFragment$data, - readonly $fragmentRefs: FriendFragment$ref, + readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected index e63a960f33e04..055257df3aa65 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected @@ -22,7 +22,6 @@ fragment FriendFragment on User { } } ==================================== OUTPUT =================================== -import { FriendFragment$ref } from "./FriendFragment.graphql"; export type ExampleQueryVariables = { id: string }; @@ -32,7 +31,7 @@ export type ExampleQueryResponse = { readonly friends?: { readonly count?: number }, - readonly $fragmentRefs: FriendFragment$ref, + readonly " $fragmentRefs": FriendFragment$ref, } }; export type ExampleQueryRawResponse = { @@ -48,9 +47,7 @@ export type ExampleQuery = { rawResponse: ExampleQueryRawResponse, }; ------------------------------------------------------------------------------- -import { FragmentReference } from "relay-runtime"; -export type FriendFragment$ref = FragmentReference & { _: "FriendFragment$ref" }; -export type FriendFragment$fragmentType = FriendFragment$ref & { _: "FriendFragment$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type FriendFragment = { readonly name?: string, readonly lastName?: string, @@ -58,10 +55,10 @@ export type FriendFragment = { readonly id: string, readonly name?: string, }, - readonly $refType: FriendFragment$ref, + readonly " $refType": FragmentRefs<"FriendFragment">, }; export type FriendFragment$data = FriendFragment; export type FriendFragment$key = { readonly $data?: FriendFragment$data, - readonly $fragmentRefs: FriendFragment$ref, + readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/recursive-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/recursive-fragments.expected index adbc2f93ceb3c..1dc733a34cff2 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/recursive-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/recursive-fragments.expected @@ -6,16 +6,14 @@ fragment FragmentSpread on Node { } } ==================================== OUTPUT =================================== -import { FragmentReference } from "relay-runtime"; -export type FragmentSpread$ref = FragmentReference & { _: "FragmentSpread$ref" }; -export type FragmentSpread$fragmentType = FragmentSpread$ref & { _: "FragmentSpread$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type FragmentSpread = { readonly id: string, - readonly $fragmentRefs: FragmentSpread$ref, - readonly $refType: FragmentSpread$ref, + readonly " $fragmentRefs": FragmentSpread$ref, + readonly " $refType": FragmentRefs<"FragmentSpread">, }; export type FragmentSpread$data = FragmentSpread; export type FragmentSpread$key = { readonly $data?: FragmentSpread$data, - readonly $fragmentRefs: FragmentSpread$ref, + readonly " $fragmentRefs": FragmentRefs<"FragmentSpread">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected index a7a90ce64c8ec..368a9ca77301b 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected @@ -7,15 +7,13 @@ fragment RefetchableFragment on Node } } ==================================== OUTPUT =================================== -import { FragmentReference } from "relay-runtime"; -export type RefetchableFragment$ref = FragmentReference & { _: "RefetchableFragment$ref" }; -export type RefetchableFragment$fragmentType = RefetchableFragment$ref & { _: "RefetchableFragment$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type RefetchableFragmentQueryVariables = { id: string }; export type RefetchableFragmentQueryResponse = { readonly node?: { - readonly $fragmentRefs: RefetchableFragment$ref + readonly " $fragmentRefs": RefetchableFragment$ref } }; export type RefetchableFragmentQuery = { @@ -23,18 +21,16 @@ export type RefetchableFragmentQuery = { response: RefetchableFragmentQueryResponse, }; ------------------------------------------------------------------------------- -import { FragmentReference } from "relay-runtime"; -import { RefetchableFragment$ref, RefetchableFragment$fragmentType } from "RefetchableFragmentQuery.graphql"; -export { RefetchableFragment$ref, RefetchableFragment$fragmentType }; +import { FragmentRefs } from "relay-runtime"; export type RefetchableFragment = { readonly id: string, readonly fragAndField?: { readonly uri?: string }, - readonly $refType: RefetchableFragment$ref, + readonly " $refType": FragmentRefs<"RefetchableFragment">, }; export type RefetchableFragment$data = RefetchableFragment; export type RefetchableFragment$key = { readonly $data?: RefetchableFragment$data, - readonly $fragmentRefs: RefetchableFragment$ref, + readonly " $fragmentRefs": FragmentRefs<"RefetchableFragment">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected index 01fd97c4ed44a..f41fd76833956 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected @@ -7,15 +7,13 @@ fragment FlowRefetchableFragment on Node } } ==================================== OUTPUT =================================== -import { FragmentReference } from "relay-runtime"; -export type FlowRefetchableFragment$ref = FragmentReference & { _: "FlowRefetchableFragment$ref" }; -export type FlowRefetchableFragment$fragmentType = FlowRefetchableFragment$ref & { _: "FlowRefetchableFragment$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type FlowRefetchableFragmentQueryVariables = { id: string }; export type FlowRefetchableFragmentQueryResponse = { readonly node?: { - readonly $fragmentRefs: FlowRefetchableFragment$ref + readonly " $fragmentRefs": FlowRefetchableFragment$ref } }; export type FlowRefetchableFragmentQuery = { @@ -23,16 +21,14 @@ export type FlowRefetchableFragmentQuery = { response: FlowRefetchableFragmentQueryResponse, }; ------------------------------------------------------------------------------- -import { FragmentReference } from "relay-runtime"; -import { FlowRefetchableFragment$ref, FlowRefetchableFragment$fragmentType } from "FlowRefetchableFragmentQuery.graphql"; -export { FlowRefetchableFragment$ref, FlowRefetchableFragment$fragmentType }; +import { FragmentRefs } from "relay-runtime"; export type FlowRefetchableFragment = { readonly id: string, readonly name?: string, - readonly $refType: FlowRefetchableFragment$ref, + readonly " $refType": FragmentRefs<"FlowRefetchableFragment">, }; export type FlowRefetchableFragment$data = FlowRefetchableFragment; export type FlowRefetchableFragment$key = { readonly $data?: FlowRefetchableFragment$data, - readonly $fragmentRefs: FlowRefetchableFragment$ref, + readonly " $fragmentRefs": FragmentRefs<"FlowRefetchableFragment">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected index 9014fb862cd06..773595289df6f 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected @@ -8,21 +8,19 @@ fragment Foo on Node { } } ==================================== OUTPUT =================================== -import { FragmentReference } from "relay-runtime"; -export type Foo$ref = FragmentReference & { _: "Foo$ref" }; -export type Foo$fragmentType = Foo$ref & { _: "Foo$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type Foo = { readonly __typename: "User", readonly name: string, - readonly $refType: Foo$ref, + readonly " $refType": FragmentRefs<"Foo">, } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly __typename: "%other", - readonly $refType: Foo$ref, + readonly " $refType": FragmentRefs<"Foo">, } | null; export type Foo$data = Foo; export type Foo$key = { readonly $data?: Foo$data, - readonly $fragmentRefs: Foo$ref, + readonly " $fragmentRefs": FragmentRefs<"Foo">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-fragment.expected index ae418394b6861..53f3808737e06 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-fragment.expected @@ -4,16 +4,14 @@ fragment NonNullFragment on User { lastName @required(action: NONE) } ==================================== OUTPUT =================================== -import { FragmentReference } from "relay-runtime"; -export type NonNullFragment$ref = FragmentReference & { _: "NonNullFragment$ref" }; -export type NonNullFragment$fragmentType = NonNullFragment$ref & { _: "NonNullFragment$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type NonNullFragment = { readonly firstName?: string, readonly lastName: string, - readonly $refType: NonNullFragment$ref, + readonly " $refType": FragmentRefs<"NonNullFragment">, } | null; export type NonNullFragment$data = NonNullFragment; export type NonNullFragment$key = { readonly $data?: NonNullFragment$data, - readonly $fragmentRefs: NonNullFragment$ref, + readonly " $fragmentRefs": FragmentRefs<"NonNullFragment">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected index 1921d176f4f76..d0fd0c1465811 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected @@ -7,19 +7,17 @@ fragment NonNullFragment on User { } } ==================================== OUTPUT =================================== -import { FragmentReference } from "relay-runtime"; -export type NonNullFragment$ref = FragmentReference & { _: "NonNullFragment$ref" }; -export type NonNullFragment$fragmentType = NonNullFragment$ref & { _: "NonNullFragment$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type NonNullFragment = { readonly firstName?: string, readonly screennames?: ReadonlyArray<{ readonly name?: string, readonly service: string, } | null>, - readonly $refType: NonNullFragment$ref, + readonly " $refType": FragmentRefs<"NonNullFragment">, }; export type NonNullFragment$data = NonNullFragment; export type NonNullFragment$key = { readonly $data?: NonNullFragment$data, - readonly $fragmentRefs: NonNullFragment$ref, + readonly " $fragmentRefs": FragmentRefs<"NonNullFragment">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected index 5aa678fac57d5..e3c4a0594ff0e 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected @@ -28,43 +28,39 @@ fragment Foo on Node { } } ==================================== OUTPUT =================================== -import { FragmentReference } from "relay-runtime"; -export type Bar$ref = FragmentReference & { _: "Bar$ref" }; -export type Bar$fragmentType = Bar$ref & { _: "Bar$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type Bar = { readonly name?: string, readonly body?: { readonly text?: string }, - readonly $refType: Bar$ref, + readonly " $refType": FragmentRefs<"Bar">, } | null; export type Bar$data = Bar; export type Bar$key = { readonly $data?: Bar$data, - readonly $fragmentRefs: Bar$ref, + readonly " $fragmentRefs": FragmentRefs<"Bar">, }; ------------------------------------------------------------------------------- -import { FragmentReference } from "relay-runtime"; -export type Foo$ref = FragmentReference & { _: "Foo$ref" }; -export type Foo$fragmentType = Foo$ref & { _: "Foo$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type Foo = { readonly __typename: "User", readonly name: string, - readonly $refType: Foo$ref, + readonly " $refType": FragmentRefs<"Foo">, } | { readonly __typename: "Comment", readonly body?: { readonly text?: string }, - readonly $refType: Foo$ref, + readonly " $refType": FragmentRefs<"Foo">, } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly __typename: "%other", - readonly $refType: Foo$ref, + readonly " $refType": FragmentRefs<"Foo">, } | null; export type Foo$data = Foo; export type Foo$key = { readonly $data?: Foo$data, - readonly $fragmentRefs: Foo$ref, + readonly " $fragmentRefs": FragmentRefs<"Foo">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected index fe959342ffea0..c965d304c987a 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected @@ -4,16 +4,14 @@ fragment NonNullFragment on User { lastName @required(action: THROW) } ==================================== OUTPUT =================================== -import { FragmentReference } from "relay-runtime"; -export type NonNullFragment$ref = FragmentReference & { _: "NonNullFragment$ref" }; -export type NonNullFragment$fragmentType = NonNullFragment$ref & { _: "NonNullFragment$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type NonNullFragment = { readonly firstName?: string, readonly lastName: string, - readonly $refType: NonNullFragment$ref, + readonly " $refType": FragmentRefs<"NonNullFragment">, }; export type NonNullFragment$data = NonNullFragment; export type NonNullFragment$key = { readonly $data?: NonNullFragment$data, - readonly $fragmentRefs: NonNullFragment$ref, + readonly " $fragmentRefs": FragmentRefs<"NonNullFragment">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected index 0cf57d9d10c08..912fd1a6e6303 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected @@ -83,15 +83,13 @@ export type TestSubscription = { response: TestSubscriptionResponse, }; ------------------------------------------------------------------------------- -import { FragmentReference } from "relay-runtime"; -export type ExampleFragment$ref = FragmentReference & { _: "ExampleFragment$ref" }; -export type ExampleFragment$fragmentType = ExampleFragment$ref & { _: "ExampleFragment$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type ExampleFragment = { readonly id: string, - readonly $refType: ExampleFragment$ref, + readonly " $refType": FragmentRefs<"ExampleFragment">, }; export type ExampleFragment$data = ExampleFragment; export type ExampleFragment$key = { readonly $data?: ExampleFragment$data, - readonly $fragmentRefs: ExampleFragment$ref, + readonly " $fragmentRefs": FragmentRefs<"ExampleFragment">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/scalar-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/scalar-field.expected index 0c5859491d7d3..90bc8f606809f 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/scalar-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/scalar-field.expected @@ -14,9 +14,7 @@ fragment ScalarField on User { } ==================================== OUTPUT =================================== export type PersonalityTraits = "CHEERFUL" | "DERISIVE" | "HELPFUL" | "SNARKY" | "%future added value"; -import { FragmentReference } from "relay-runtime"; -export type ScalarField$ref = FragmentReference & { _: "ScalarField$ref" }; -export type ScalarField$fragmentType = ScalarField$ref & { _: "ScalarField$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type ScalarField = { readonly id: string, readonly name?: string, @@ -29,10 +27,10 @@ export type ScalarField = { readonly name?: string, readonly service?: string, } | null>, - readonly $refType: ScalarField$ref, + readonly " $refType": FragmentRefs<"ScalarField">, }; export type ScalarField$data = ScalarField; export type ScalarField$key = { readonly $data?: ScalarField$data, - readonly $fragmentRefs: ScalarField$ref, + readonly " $fragmentRefs": FragmentRefs<"ScalarField">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/simple.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/simple.expected index c0577c4d17e4c..71d0d31b689f3 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/simple.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/simple.expected @@ -8,9 +8,7 @@ fragment LinkedField on User { } } ==================================== OUTPUT =================================== -import { FragmentReference } from "relay-runtime"; -export type LinkedField$ref = FragmentReference & { _: "LinkedField$ref" }; -export type LinkedField$fragmentType = LinkedField$ref & { _: "LinkedField$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type LinkedField = { readonly name?: string, readonly profilePicture?: { @@ -18,10 +16,10 @@ export type LinkedField = { readonly width?: number, readonly height?: number, }, - readonly $refType: LinkedField$ref, + readonly " $refType": FragmentRefs<"LinkedField">, }; export type LinkedField$data = LinkedField; export type LinkedField$key = { readonly $data?: LinkedField$data, - readonly $fragmentRefs: LinkedField$ref, + readonly " $fragmentRefs": FragmentRefs<"LinkedField">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected index 7ae01881ea6ea..81b469b34aa3b 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected @@ -16,9 +16,7 @@ fragment TypenameInsideWithOverlappingFields on Viewer { } } ==================================== OUTPUT =================================== -import { FragmentReference } from "relay-runtime"; -export type TypenameInsideWithOverlappingFields$ref = FragmentReference & { _: "TypenameInsideWithOverlappingFields$ref" }; -export type TypenameInsideWithOverlappingFields$fragmentType = TypenameInsideWithOverlappingFields$ref & { _: "TypenameInsideWithOverlappingFields$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type TypenameInsideWithOverlappingFields = { readonly actor?: { readonly __typename: "Page", @@ -36,10 +34,10 @@ export type TypenameInsideWithOverlappingFields = { // value in case none of the concrete values match. readonly __typename: "%other" }, - readonly $refType: TypenameInsideWithOverlappingFields$ref, + readonly " $refType": FragmentRefs<"TypenameInsideWithOverlappingFields">, }; export type TypenameInsideWithOverlappingFields$data = TypenameInsideWithOverlappingFields; export type TypenameInsideWithOverlappingFields$key = { readonly $data?: TypenameInsideWithOverlappingFields$data, - readonly $fragmentRefs: TypenameInsideWithOverlappingFields$ref, + readonly " $fragmentRefs": FragmentRefs<"TypenameInsideWithOverlappingFields">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected index 3905ab0123b1e..4917cb1fa2fa4 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected @@ -80,42 +80,38 @@ fragment TypenameAliases on Actor { } } ==================================== OUTPUT =================================== -import { FragmentReference } from "relay-runtime"; -export type TypenameAlias$ref = FragmentReference & { _: "TypenameAlias$ref" }; -export type TypenameAlias$fragmentType = TypenameAlias$ref & { _: "TypenameAlias$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type TypenameAlias = { readonly _typeAlias: "User", readonly firstName?: string, - readonly $refType: TypenameAlias$ref, + readonly " $refType": FragmentRefs<"TypenameAlias">, } | { readonly _typeAlias: "Page", readonly username?: string, - readonly $refType: TypenameAlias$ref, + readonly " $refType": FragmentRefs<"TypenameAlias">, } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly _typeAlias: "%other", - readonly $refType: TypenameAlias$ref, + readonly " $refType": FragmentRefs<"TypenameAlias">, }; export type TypenameAlias$data = TypenameAlias; export type TypenameAlias$key = { readonly $data?: TypenameAlias$data, - readonly $fragmentRefs: TypenameAlias$ref, + readonly " $fragmentRefs": FragmentRefs<"TypenameAlias">, }; ------------------------------------------------------------------------------- -import { FragmentReference } from "relay-runtime"; -export type TypenameAliases$ref = FragmentReference & { _: "TypenameAliases$ref" }; -export type TypenameAliases$fragmentType = TypenameAliases$ref & { _: "TypenameAliases$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type TypenameAliases = { readonly _typeAlias1: "User", readonly _typeAlias2: "User", readonly firstName?: string, - readonly $refType: TypenameAliases$ref, + readonly " $refType": FragmentRefs<"TypenameAliases">, } | { readonly _typeAlias1: "Page", readonly _typeAlias2: "Page", readonly username?: string, - readonly $refType: TypenameAliases$ref, + readonly " $refType": FragmentRefs<"TypenameAliases">, } | { // This will never be '%other', but we need some // value in case none of the concrete values match. @@ -123,63 +119,57 @@ export type TypenameAliases = { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly _typeAlias2: "%other", - readonly $refType: TypenameAliases$ref, + readonly " $refType": FragmentRefs<"TypenameAliases">, }; export type TypenameAliases$data = TypenameAliases; export type TypenameAliases$key = { readonly $data?: TypenameAliases$data, - readonly $fragmentRefs: TypenameAliases$ref, + readonly " $fragmentRefs": FragmentRefs<"TypenameAliases">, }; ------------------------------------------------------------------------------- -import { FragmentReference } from "relay-runtime"; -export type TypenameInside$ref = FragmentReference & { _: "TypenameInside$ref" }; -export type TypenameInside$fragmentType = TypenameInside$ref & { _: "TypenameInside$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type TypenameInside = { readonly __typename: "User", readonly firstName?: string, - readonly $refType: TypenameInside$ref, + readonly " $refType": FragmentRefs<"TypenameInside">, } | { readonly __typename: "Page", readonly username?: string, - readonly $refType: TypenameInside$ref, + readonly " $refType": FragmentRefs<"TypenameInside">, } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly __typename: "%other", - readonly $refType: TypenameInside$ref, + readonly " $refType": FragmentRefs<"TypenameInside">, }; export type TypenameInside$data = TypenameInside; export type TypenameInside$key = { readonly $data?: TypenameInside$data, - readonly $fragmentRefs: TypenameInside$ref, + readonly " $fragmentRefs": FragmentRefs<"TypenameInside">, }; ------------------------------------------------------------------------------- -import { FragmentReference } from "relay-runtime"; -export type TypenameOutside$ref = FragmentReference & { _: "TypenameOutside$ref" }; -export type TypenameOutside$fragmentType = TypenameOutside$ref & { _: "TypenameOutside$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type TypenameOutside = { readonly __typename: "User", readonly firstName?: string, - readonly $refType: TypenameOutside$ref, + readonly " $refType": FragmentRefs<"TypenameOutside">, } | { readonly __typename: "Page", readonly username?: string, - readonly $refType: TypenameOutside$ref, + readonly " $refType": FragmentRefs<"TypenameOutside">, } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly __typename: "%other", - readonly $refType: TypenameOutside$ref, + readonly " $refType": FragmentRefs<"TypenameOutside">, }; export type TypenameOutside$data = TypenameOutside; export type TypenameOutside$key = { readonly $data?: TypenameOutside$data, - readonly $fragmentRefs: TypenameOutside$ref, + readonly " $fragmentRefs": FragmentRefs<"TypenameOutside">, }; ------------------------------------------------------------------------------- -import { FragmentReference } from "relay-runtime"; -export type TypenameOutsideWithAbstractType$ref = FragmentReference & { _: "TypenameOutsideWithAbstractType$ref" }; -export type TypenameOutsideWithAbstractType$fragmentType = TypenameOutsideWithAbstractType$ref & { _: "TypenameOutsideWithAbstractType$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type TypenameOutsideWithAbstractType = { readonly __typename: string, readonly username?: string, @@ -189,54 +179,48 @@ export type TypenameOutsideWithAbstractType = { readonly street?: string, }, readonly firstName?: string, - readonly $refType: TypenameOutsideWithAbstractType$ref, + readonly " $refType": FragmentRefs<"TypenameOutsideWithAbstractType">, }; export type TypenameOutsideWithAbstractType$data = TypenameOutsideWithAbstractType; export type TypenameOutsideWithAbstractType$key = { readonly $data?: TypenameOutsideWithAbstractType$data, - readonly $fragmentRefs: TypenameOutsideWithAbstractType$ref, + readonly " $fragmentRefs": FragmentRefs<"TypenameOutsideWithAbstractType">, }; ------------------------------------------------------------------------------- -import { FragmentReference } from "relay-runtime"; -export type TypenameWithCommonSelections$ref = FragmentReference & { _: "TypenameWithCommonSelections$ref" }; -export type TypenameWithCommonSelections$fragmentType = TypenameWithCommonSelections$ref & { _: "TypenameWithCommonSelections$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type TypenameWithCommonSelections = { readonly __typename: string, readonly name?: string, readonly firstName?: string, readonly username?: string, - readonly $refType: TypenameWithCommonSelections$ref, + readonly " $refType": FragmentRefs<"TypenameWithCommonSelections">, }; export type TypenameWithCommonSelections$data = TypenameWithCommonSelections; export type TypenameWithCommonSelections$key = { readonly $data?: TypenameWithCommonSelections$data, - readonly $fragmentRefs: TypenameWithCommonSelections$ref, + readonly " $fragmentRefs": FragmentRefs<"TypenameWithCommonSelections">, }; ------------------------------------------------------------------------------- -import { FragmentReference } from "relay-runtime"; -export type TypenameWithoutSpreads$ref = FragmentReference & { _: "TypenameWithoutSpreads$ref" }; -export type TypenameWithoutSpreads$fragmentType = TypenameWithoutSpreads$ref & { _: "TypenameWithoutSpreads$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type TypenameWithoutSpreads = { readonly firstName?: string, readonly __typename: "User", - readonly $refType: TypenameWithoutSpreads$ref, + readonly " $refType": FragmentRefs<"TypenameWithoutSpreads">, }; export type TypenameWithoutSpreads$data = TypenameWithoutSpreads; export type TypenameWithoutSpreads$key = { readonly $data?: TypenameWithoutSpreads$data, - readonly $fragmentRefs: TypenameWithoutSpreads$ref, + readonly " $fragmentRefs": FragmentRefs<"TypenameWithoutSpreads">, }; ------------------------------------------------------------------------------- -import { FragmentReference } from "relay-runtime"; -export type TypenameWithoutSpreadsAbstractType$ref = FragmentReference & { _: "TypenameWithoutSpreadsAbstractType$ref" }; -export type TypenameWithoutSpreadsAbstractType$fragmentType = TypenameWithoutSpreadsAbstractType$ref & { _: "TypenameWithoutSpreadsAbstractType$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type TypenameWithoutSpreadsAbstractType = { readonly __typename: string, readonly id: string, - readonly $refType: TypenameWithoutSpreadsAbstractType$ref, + readonly " $refType": FragmentRefs<"TypenameWithoutSpreadsAbstractType">, }; export type TypenameWithoutSpreadsAbstractType$data = TypenameWithoutSpreadsAbstractType; export type TypenameWithoutSpreadsAbstractType$key = { readonly $data?: TypenameWithoutSpreadsAbstractType$data, - readonly $fragmentRefs: TypenameWithoutSpreadsAbstractType$ref, + readonly " $fragmentRefs": FragmentRefs<"TypenameWithoutSpreadsAbstractType">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected index fd2c61fbaa192..4110cfe85438a 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected @@ -26,37 +26,31 @@ fragment AnotherRecursiveFragment on Image { height } ==================================== OUTPUT =================================== -import { FragmentReference } from "relay-runtime"; -export type AnotherRecursiveFragment$ref = FragmentReference & { _: "AnotherRecursiveFragment$ref" }; -export type AnotherRecursiveFragment$fragmentType = AnotherRecursiveFragment$ref & { _: "AnotherRecursiveFragment$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type AnotherRecursiveFragment = { readonly uri?: string, readonly height?: number, - readonly $refType: AnotherRecursiveFragment$ref, + readonly " $refType": FragmentRefs<"AnotherRecursiveFragment">, }; export type AnotherRecursiveFragment$data = AnotherRecursiveFragment; export type AnotherRecursiveFragment$key = { readonly $data?: AnotherRecursiveFragment$data, - readonly $fragmentRefs: AnotherRecursiveFragment$ref, + readonly " $fragmentRefs": FragmentRefs<"AnotherRecursiveFragment">, }; ------------------------------------------------------------------------------- -import { FragmentReference } from "relay-runtime"; -export type PhotoFragment$ref = FragmentReference & { _: "PhotoFragment$ref" }; -export type PhotoFragment$fragmentType = PhotoFragment$ref & { _: "PhotoFragment$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type PhotoFragment = { readonly uri?: string, readonly width?: number, - readonly $refType: PhotoFragment$ref, + readonly " $refType": FragmentRefs<"PhotoFragment">, }; export type PhotoFragment$data = PhotoFragment; export type PhotoFragment$key = { readonly $data?: PhotoFragment$data, - readonly $fragmentRefs: PhotoFragment$ref, + readonly " $fragmentRefs": FragmentRefs<"PhotoFragment">, }; ------------------------------------------------------------------------------- -import { FragmentReference } from "relay-runtime"; -export type RecursiveFragment$ref = FragmentReference & { _: "RecursiveFragment$ref" }; -export type RecursiveFragment$fragmentType = RecursiveFragment$ref & { _: "RecursiveFragment$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type RecursiveFragment = { readonly uri?: string, readonly width?: number, @@ -64,24 +58,21 @@ export type RecursiveFragment = { export type RecursiveFragment$data = RecursiveFragment; export type RecursiveFragment$key = { readonly $data?: RecursiveFragment$data, - readonly $fragmentRefs: RecursiveFragment$ref, + readonly " $fragmentRefs": FragmentRefs<"RecursiveFragment">, }; ------------------------------------------------------------------------------- -import { PhotoFragment$ref } from "./PhotoFragment.graphql"; -import { FragmentReference } from "relay-runtime"; -export type UserProfile$ref = FragmentReference & { _: "UserProfile$ref" }; -export type UserProfile$fragmentType = UserProfile$ref & { _: "UserProfile$fragmentType" }; +import { FragmentRefs } from "relay-runtime"; export type UserProfile = { readonly profilePicture?: { readonly uri?: string, readonly width?: number, readonly height?: number, - readonly $fragmentRefs: PhotoFragment$ref, + readonly " $fragmentRefs": PhotoFragment$ref, }, - readonly $refType: UserProfile$ref, + readonly " $refType": FragmentRefs<"UserProfile">, }; export type UserProfile$data = UserProfile; export type UserProfile$key = { readonly $data?: UserProfile$data, - readonly $fragmentRefs: UserProfile$ref, + readonly " $fragmentRefs": FragmentRefs<"UserProfile">, }; From c6150b045282567c041c60acb4b8fae18ec58b8c Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Sat, 24 Oct 2020 14:31:21 +0200 Subject: [PATCH 06/41] For typescript, use the field name " $data" rather than "$data". --- compiler/crates/relay-typegen/src/lib.rs | 2 +- compiler/crates/relay-typegen/src/typescript.rs | 4 +++- .../fixtures/conditional.expected | 4 ++-- .../fixtures/fragment-spread.expected | 14 +++++++------- .../fixtures/inline-fragment.expected | 10 +++++----- .../fixtures/linked-field.expected | 2 +- .../fixtures/match-field-in-query.expected | 4 ++-- .../fixtures/match-field.expected | 6 +++--- .../mutation-with-enums-on-fragment.expected | 2 +- .../mutation-with-nested-fragments.expected | 4 ++-- ...on-with-response-on-inline-fragments.expected | 2 +- .../fixtures/plural-fragment.expected | 2 +- .../fixtures/query-with-match-fields.expected | 6 +++--- .../fixtures/query-with-module-field.expected | 4 ++-- .../query-with-multiple-match-fields.expected | 8 ++++---- ...ery-with-raw-response-on-conditional.expected | 2 +- ...-raw-response-on-literal-conditional.expected | 2 +- .../fixtures/recursive-fragments.expected | 2 +- .../fixtures/refetchable-fragment.expected | 2 +- .../fixtures/refetchable.expected | 2 +- ...through-inline-fragments-to-fragment.expected | 2 +- .../required-bubbles-to-fragment.expected | 2 +- ...ired-bubbles-to-item-in-plural-field.expected | 2 +- ...d-isolates-concrete-inline-fragments.expected | 4 ++-- ...red-throw-doesnt-bubbles-to-fragment.expected | 2 +- .../generate_typescript/fixtures/roots.expected | 2 +- .../fixtures/scalar-field.expected | 2 +- .../generate_typescript/fixtures/simple.expected | 2 +- ...ename-inside-with-overlapping-fields.expected | 2 +- .../fixtures/typename-on-union.expected | 16 ++++++++-------- .../fixtures/unmasked-fragment-spreads.expected | 8 ++++---- 31 files changed, 65 insertions(+), 63 deletions(-) diff --git a/compiler/crates/relay-typegen/src/lib.rs b/compiler/crates/relay-typegen/src/lib.rs index 5758ede4079df..9af0b2976bc6a 100644 --- a/compiler/crates/relay-typegen/src/lib.rs +++ b/compiler/crates/relay-typegen/src/lib.rs @@ -44,7 +44,7 @@ lazy_static! { static ref MODULE_COMPONENT: StringKey = "__module_component".intern(); static ref VARIABLES: StringKey = "variables".intern(); static ref RESPONSE: StringKey = "response".intern(); - static ref KEY_DATA: StringKey = "$data".intern(); + pub(crate) static ref KEY_DATA: StringKey = "$data".intern(); pub(crate) static ref KEY_REF_TYPE: StringKey = "$refType".intern(); pub(crate) static ref KEY_FRAGMENT_REFS: StringKey = "$fragmentRefs".intern(); static ref KEY_TYPENAME: StringKey = "__typename".intern(); diff --git a/compiler/crates/relay-typegen/src/typescript.rs b/compiler/crates/relay-typegen/src/typescript.rs index 6617eac786733..4505a88743192 100644 --- a/compiler/crates/relay-typegen/src/typescript.rs +++ b/compiler/crates/relay-typegen/src/typescript.rs @@ -7,7 +7,7 @@ use crate::writer::{Prop, Writer, AST, SPREAD_KEY}; use crate::TypegenConfig; -use crate::{KEY_FRAGMENT_REFS, KEY_REF_TYPE}; +use crate::{KEY_DATA, KEY_FRAGMENT_REFS, KEY_REF_TYPE}; use interner::{Intern, StringKey}; use std::fmt::{Result, Write}; @@ -185,6 +185,8 @@ impl TypeScriptPrinter { format!("\" {}\"", *KEY_FRAGMENT_REFS).intern() } else if prop.key == *KEY_REF_TYPE { format!("\" {}\"", *KEY_REF_TYPE).intern() + } else if prop.key == *KEY_DATA { + format!("\" {}\"", *KEY_DATA).intern() } else { prop.key } diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/conditional.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/conditional.expected index 47ae18fdb641e..3bf28a089d997 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/conditional.expected @@ -16,7 +16,7 @@ export type ConditionField = { }; export type ConditionField$data = ConditionField; export type ConditionField$key = { - readonly $data?: ConditionField$data, + readonly " $data"?: ConditionField$data, readonly " $fragmentRefs": FragmentRefs<"ConditionField">, }; ------------------------------------------------------------------------------- @@ -27,6 +27,6 @@ export type NestedCondition = { }; export type NestedCondition$data = NestedCondition; export type NestedCondition$key = { - readonly $data?: NestedCondition$data, + readonly " $data"?: NestedCondition$data, readonly " $fragmentRefs": FragmentRefs<"NestedCondition">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected index 9e144628794ce..9e9726231e277 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected @@ -66,7 +66,7 @@ export type ConcreateTypes = { }; export type ConcreateTypes$data = ConcreateTypes; export type ConcreateTypes$key = { - readonly $data?: ConcreateTypes$data, + readonly " $data"?: ConcreateTypes$data, readonly " $fragmentRefs": FragmentRefs<"ConcreateTypes">, }; ------------------------------------------------------------------------------- @@ -85,7 +85,7 @@ export type FragmentSpread = { }; export type FragmentSpread$data = FragmentSpread; export type FragmentSpread$key = { - readonly $data?: FragmentSpread$data, + readonly " $data"?: FragmentSpread$data, readonly " $fragmentRefs": FragmentRefs<"FragmentSpread">, }; ------------------------------------------------------------------------------- @@ -96,7 +96,7 @@ export type OtherFragment = { }; export type OtherFragment$data = OtherFragment; export type OtherFragment$key = { - readonly $data?: OtherFragment$data, + readonly " $data"?: OtherFragment$data, readonly " $fragmentRefs": FragmentRefs<"OtherFragment">, }; ------------------------------------------------------------------------------- @@ -112,7 +112,7 @@ export type PageFragment = { }; export type PageFragment$data = PageFragment; export type PageFragment$key = { - readonly $data?: PageFragment$data, + readonly " $data"?: PageFragment$data, readonly " $fragmentRefs": FragmentRefs<"PageFragment">, }; ------------------------------------------------------------------------------- @@ -128,7 +128,7 @@ export type PictureFragment = { }; export type PictureFragment$data = PictureFragment; export type PictureFragment$key = { - readonly $data?: PictureFragment$data, + readonly " $data"?: PictureFragment$data, readonly " $fragmentRefs": FragmentRefs<"PictureFragment">, }; ------------------------------------------------------------------------------- @@ -144,7 +144,7 @@ export type UserFrag1 = { }; export type UserFrag1$data = UserFrag1; export type UserFrag1$key = { - readonly $data?: UserFrag1$data, + readonly " $data"?: UserFrag1$data, readonly " $fragmentRefs": FragmentRefs<"UserFrag1">, }; ------------------------------------------------------------------------------- @@ -160,6 +160,6 @@ export type UserFrag2 = { }; export type UserFrag2$data = UserFrag2; export type UserFrag2$key = { - readonly $data?: UserFrag2$data, + readonly " $data"?: UserFrag2$data, readonly " $fragmentRefs": FragmentRefs<"UserFrag2">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected index 614839b3565ab..4a94df55f160c 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected @@ -75,7 +75,7 @@ export type InlineFragment = { }; export type InlineFragment$data = InlineFragment; export type InlineFragment$key = { - readonly $data?: InlineFragment$data, + readonly " $data"?: InlineFragment$data, readonly " $fragmentRefs": FragmentRefs<"InlineFragment">, }; ------------------------------------------------------------------------------- @@ -87,7 +87,7 @@ export type InlineFragmentConditionalID = { }; export type InlineFragmentConditionalID$data = InlineFragmentConditionalID; export type InlineFragmentConditionalID$key = { - readonly $data?: InlineFragmentConditionalID$data, + readonly " $data"?: InlineFragmentConditionalID$data, readonly " $fragmentRefs": FragmentRefs<"InlineFragmentConditionalID">, }; ------------------------------------------------------------------------------- @@ -107,7 +107,7 @@ export type InlineFragmentKitchenSink = { }; export type InlineFragmentKitchenSink$data = InlineFragmentKitchenSink; export type InlineFragmentKitchenSink$key = { - readonly $data?: InlineFragmentKitchenSink$data, + readonly " $data"?: InlineFragmentKitchenSink$data, readonly " $fragmentRefs": FragmentRefs<"InlineFragmentKitchenSink">, }; ------------------------------------------------------------------------------- @@ -125,7 +125,7 @@ export type InlineFragmentWithOverlappingFields = { }; export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; export type InlineFragmentWithOverlappingFields$key = { - readonly $data?: InlineFragmentWithOverlappingFields$data, + readonly " $data"?: InlineFragmentWithOverlappingFields$data, readonly " $fragmentRefs": FragmentRefs<"InlineFragmentWithOverlappingFields">, }; ------------------------------------------------------------------------------- @@ -141,6 +141,6 @@ export type SomeFragment = { }; export type SomeFragment$data = SomeFragment; export type SomeFragment$key = { - readonly $data?: SomeFragment$data, + readonly " $data"?: SomeFragment$data, readonly " $fragmentRefs": FragmentRefs<"SomeFragment">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected index 4d34063e4d14c..42c2788a5c9e5 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected @@ -63,6 +63,6 @@ export type LinkedField = { }; export type LinkedField$data = LinkedField; export type LinkedField$key = { - readonly $data?: LinkedField$data, + readonly " $data"?: LinkedField$data, readonly " $fragmentRefs": FragmentRefs<"LinkedField">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected index 9029c8cbbc9cd..c2d476556a00e 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected @@ -48,7 +48,7 @@ export type MarkdownUserNameRenderer_name = { }; export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; export type MarkdownUserNameRenderer_name$key = { - readonly $data?: MarkdownUserNameRenderer_name$data, + readonly " $data"?: MarkdownUserNameRenderer_name$data, readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">, }; ------------------------------------------------------------------------------- @@ -62,6 +62,6 @@ export type PlainUserNameRenderer_name = { }; export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; export type PlainUserNameRenderer_name$key = { - readonly $data?: PlainUserNameRenderer_name$data, + readonly " $data"?: PlainUserNameRenderer_name$data, readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected index a7e7b1c4ed7e4..e215aa75f518b 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected @@ -32,7 +32,7 @@ export type MarkdownUserNameRenderer_name = { }; export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; export type MarkdownUserNameRenderer_name$key = { - readonly $data?: MarkdownUserNameRenderer_name$data, + readonly " $data"?: MarkdownUserNameRenderer_name$data, readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">, }; ------------------------------------------------------------------------------- @@ -48,7 +48,7 @@ export type NameRendererFragment = { }; export type NameRendererFragment$data = NameRendererFragment; export type NameRendererFragment$key = { - readonly $data?: NameRendererFragment$data, + readonly " $data"?: NameRendererFragment$data, readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment">, }; ------------------------------------------------------------------------------- @@ -62,6 +62,6 @@ export type PlainUserNameRenderer_name = { }; export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; export type PlainUserNameRenderer_name$key = { - readonly $data?: PlainUserNameRenderer_name$data, + readonly " $data"?: PlainUserNameRenderer_name$data, readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected index 13c47367755d5..879a3e6cc1213 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected @@ -97,6 +97,6 @@ export type FriendFragment = { }; export type FriendFragment$data = FriendFragment; export type FriendFragment$key = { - readonly $data?: FriendFragment$data, + readonly " $data"?: FriendFragment$data, readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected index 58b867b4a26a1..c494ee307e673 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected @@ -95,7 +95,7 @@ export type FeedbackFragment = { }; export type FeedbackFragment$data = FeedbackFragment; export type FeedbackFragment$key = { - readonly $data?: FeedbackFragment$data, + readonly " $data"?: FeedbackFragment$data, readonly " $fragmentRefs": FragmentRefs<"FeedbackFragment">, }; ------------------------------------------------------------------------------- @@ -110,6 +110,6 @@ export type FriendFragment = { }; export type FriendFragment$data = FriendFragment; export type FriendFragment$key = { - readonly $data?: FriendFragment$data, + readonly " $data"?: FriendFragment$data, readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected index 0f6203566e91a..9d9ee045853c8 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected @@ -100,6 +100,6 @@ export type InlineFragmentWithOverlappingFields = { }; export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; export type InlineFragmentWithOverlappingFields$key = { - readonly $data?: InlineFragmentWithOverlappingFields$data, + readonly " $data"?: InlineFragmentWithOverlappingFields$data, readonly " $fragmentRefs": FragmentRefs<"InlineFragmentWithOverlappingFields">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/plural-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/plural-fragment.expected index 225755f758e04..7a6199b62aac6 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/plural-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/plural-fragment.expected @@ -10,6 +10,6 @@ export type PluralFragment = ReadonlyArray<{ }>; export type PluralFragment$data = PluralFragment; export type PluralFragment$key = ReadonlyArray<{ - readonly $data?: PluralFragment$data, + readonly " $data"?: PluralFragment$data, readonly " $fragmentRefs": FragmentRefs<"PluralFragment">, }>; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected index 7bbc0a2a18171..6fb0d2d84653e 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected @@ -89,7 +89,7 @@ export type MarkdownUserNameRenderer_name = { }; export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; export type MarkdownUserNameRenderer_name$key = { - readonly $data?: MarkdownUserNameRenderer_name$data, + readonly " $data"?: MarkdownUserNameRenderer_name$data, readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">, }; ------------------------------------------------------------------------------- @@ -105,7 +105,7 @@ export type NameRendererFragment = { }; export type NameRendererFragment$data = NameRendererFragment; export type NameRendererFragment$key = { - readonly $data?: NameRendererFragment$data, + readonly " $data"?: NameRendererFragment$data, readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment">, }; ------------------------------------------------------------------------------- @@ -119,6 +119,6 @@ export type PlainUserNameRenderer_name = { }; export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; export type PlainUserNameRenderer_name$key = { - readonly $data?: PlainUserNameRenderer_name$data, + readonly " $data"?: PlainUserNameRenderer_name$data, readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected index 4639299748dde..3ef1a01b7f888 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected @@ -60,7 +60,7 @@ export type Test_user = { }; export type Test_user$data = Test_user; export type Test_user$key = { - readonly $data?: Test_user$data, + readonly " $data"?: Test_user$data, readonly " $fragmentRefs": FragmentRefs<"Test_user">, }; ------------------------------------------------------------------------------- @@ -73,6 +73,6 @@ export type Test_userRenderer = { }; export type Test_userRenderer$data = Test_userRenderer; export type Test_userRenderer$key = { - readonly $data?: Test_userRenderer$data, + readonly " $data"?: Test_userRenderer$data, readonly " $fragmentRefs": FragmentRefs<"Test_userRenderer">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected index 8db0f999a4c11..e51d1061458e9 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected @@ -144,7 +144,7 @@ export type AnotherNameRendererFragment = { }; export type AnotherNameRendererFragment$data = AnotherNameRendererFragment; export type AnotherNameRendererFragment$key = { - readonly $data?: AnotherNameRendererFragment$data, + readonly " $data"?: AnotherNameRendererFragment$data, readonly " $fragmentRefs": FragmentRefs<"AnotherNameRendererFragment">, }; ------------------------------------------------------------------------------- @@ -158,7 +158,7 @@ export type MarkdownUserNameRenderer_name = { }; export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; export type MarkdownUserNameRenderer_name$key = { - readonly $data?: MarkdownUserNameRenderer_name$data, + readonly " $data"?: MarkdownUserNameRenderer_name$data, readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">, }; ------------------------------------------------------------------------------- @@ -174,7 +174,7 @@ export type NameRendererFragment = { }; export type NameRendererFragment$data = NameRendererFragment; export type NameRendererFragment$key = { - readonly $data?: NameRendererFragment$data, + readonly " $data"?: NameRendererFragment$data, readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment">, }; ------------------------------------------------------------------------------- @@ -188,6 +188,6 @@ export type PlainUserNameRenderer_name = { }; export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; export type PlainUserNameRenderer_name$key = { - readonly $data?: PlainUserNameRenderer_name$data, + readonly " $data"?: PlainUserNameRenderer_name$data, readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected index 7748712b35436..6e44f9c7d391e 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected @@ -58,6 +58,6 @@ export type FriendFragment = { }; export type FriendFragment$data = FriendFragment; export type FriendFragment$key = { - readonly $data?: FriendFragment$data, + readonly " $data"?: FriendFragment$data, readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected index 055257df3aa65..6598cc94db037 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected @@ -59,6 +59,6 @@ export type FriendFragment = { }; export type FriendFragment$data = FriendFragment; export type FriendFragment$key = { - readonly $data?: FriendFragment$data, + readonly " $data"?: FriendFragment$data, readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/recursive-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/recursive-fragments.expected index 1dc733a34cff2..7901326376186 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/recursive-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/recursive-fragments.expected @@ -14,6 +14,6 @@ export type FragmentSpread = { }; export type FragmentSpread$data = FragmentSpread; export type FragmentSpread$key = { - readonly $data?: FragmentSpread$data, + readonly " $data"?: FragmentSpread$data, readonly " $fragmentRefs": FragmentRefs<"FragmentSpread">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected index 368a9ca77301b..4a969877b8fb2 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected @@ -31,6 +31,6 @@ export type RefetchableFragment = { }; export type RefetchableFragment$data = RefetchableFragment; export type RefetchableFragment$key = { - readonly $data?: RefetchableFragment$data, + readonly " $data"?: RefetchableFragment$data, readonly " $fragmentRefs": FragmentRefs<"RefetchableFragment">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected index f41fd76833956..5e19af44d8274 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected @@ -29,6 +29,6 @@ export type FlowRefetchableFragment = { }; export type FlowRefetchableFragment$data = FlowRefetchableFragment; export type FlowRefetchableFragment$key = { - readonly $data?: FlowRefetchableFragment$data, + readonly " $data"?: FlowRefetchableFragment$data, readonly " $fragmentRefs": FragmentRefs<"FlowRefetchableFragment">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected index 773595289df6f..841019bfdc650 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected @@ -21,6 +21,6 @@ export type Foo = { } | null; export type Foo$data = Foo; export type Foo$key = { - readonly $data?: Foo$data, + readonly " $data"?: Foo$data, readonly " $fragmentRefs": FragmentRefs<"Foo">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-fragment.expected index 53f3808737e06..01085feffc910 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-fragment.expected @@ -12,6 +12,6 @@ export type NonNullFragment = { } | null; export type NonNullFragment$data = NonNullFragment; export type NonNullFragment$key = { - readonly $data?: NonNullFragment$data, + readonly " $data"?: NonNullFragment$data, readonly " $fragmentRefs": FragmentRefs<"NonNullFragment">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected index d0fd0c1465811..7a221a01c568c 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected @@ -18,6 +18,6 @@ export type NonNullFragment = { }; export type NonNullFragment$data = NonNullFragment; export type NonNullFragment$key = { - readonly $data?: NonNullFragment$data, + readonly " $data"?: NonNullFragment$data, readonly " $fragmentRefs": FragmentRefs<"NonNullFragment">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected index e3c4a0594ff0e..129597e168d00 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected @@ -38,7 +38,7 @@ export type Bar = { } | null; export type Bar$data = Bar; export type Bar$key = { - readonly $data?: Bar$data, + readonly " $data"?: Bar$data, readonly " $fragmentRefs": FragmentRefs<"Bar">, }; ------------------------------------------------------------------------------- @@ -61,6 +61,6 @@ export type Foo = { } | null; export type Foo$data = Foo; export type Foo$key = { - readonly $data?: Foo$data, + readonly " $data"?: Foo$data, readonly " $fragmentRefs": FragmentRefs<"Foo">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected index c965d304c987a..382159403fc18 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected @@ -12,6 +12,6 @@ export type NonNullFragment = { }; export type NonNullFragment$data = NonNullFragment; export type NonNullFragment$key = { - readonly $data?: NonNullFragment$data, + readonly " $data"?: NonNullFragment$data, readonly " $fragmentRefs": FragmentRefs<"NonNullFragment">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected index 912fd1a6e6303..fc95c9861a479 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected @@ -90,6 +90,6 @@ export type ExampleFragment = { }; export type ExampleFragment$data = ExampleFragment; export type ExampleFragment$key = { - readonly $data?: ExampleFragment$data, + readonly " $data"?: ExampleFragment$data, readonly " $fragmentRefs": FragmentRefs<"ExampleFragment">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/scalar-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/scalar-field.expected index 90bc8f606809f..b828e7a745e11 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/scalar-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/scalar-field.expected @@ -31,6 +31,6 @@ export type ScalarField = { }; export type ScalarField$data = ScalarField; export type ScalarField$key = { - readonly $data?: ScalarField$data, + readonly " $data"?: ScalarField$data, readonly " $fragmentRefs": FragmentRefs<"ScalarField">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/simple.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/simple.expected index 71d0d31b689f3..05dff62385416 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/simple.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/simple.expected @@ -20,6 +20,6 @@ export type LinkedField = { }; export type LinkedField$data = LinkedField; export type LinkedField$key = { - readonly $data?: LinkedField$data, + readonly " $data"?: LinkedField$data, readonly " $fragmentRefs": FragmentRefs<"LinkedField">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected index 81b469b34aa3b..fe8e0e296b3c0 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected @@ -38,6 +38,6 @@ export type TypenameInsideWithOverlappingFields = { }; export type TypenameInsideWithOverlappingFields$data = TypenameInsideWithOverlappingFields; export type TypenameInsideWithOverlappingFields$key = { - readonly $data?: TypenameInsideWithOverlappingFields$data, + readonly " $data"?: TypenameInsideWithOverlappingFields$data, readonly " $fragmentRefs": FragmentRefs<"TypenameInsideWithOverlappingFields">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected index 4917cb1fa2fa4..876aa18770c94 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected @@ -97,7 +97,7 @@ export type TypenameAlias = { }; export type TypenameAlias$data = TypenameAlias; export type TypenameAlias$key = { - readonly $data?: TypenameAlias$data, + readonly " $data"?: TypenameAlias$data, readonly " $fragmentRefs": FragmentRefs<"TypenameAlias">, }; ------------------------------------------------------------------------------- @@ -123,7 +123,7 @@ export type TypenameAliases = { }; export type TypenameAliases$data = TypenameAliases; export type TypenameAliases$key = { - readonly $data?: TypenameAliases$data, + readonly " $data"?: TypenameAliases$data, readonly " $fragmentRefs": FragmentRefs<"TypenameAliases">, }; ------------------------------------------------------------------------------- @@ -144,7 +144,7 @@ export type TypenameInside = { }; export type TypenameInside$data = TypenameInside; export type TypenameInside$key = { - readonly $data?: TypenameInside$data, + readonly " $data"?: TypenameInside$data, readonly " $fragmentRefs": FragmentRefs<"TypenameInside">, }; ------------------------------------------------------------------------------- @@ -165,7 +165,7 @@ export type TypenameOutside = { }; export type TypenameOutside$data = TypenameOutside; export type TypenameOutside$key = { - readonly $data?: TypenameOutside$data, + readonly " $data"?: TypenameOutside$data, readonly " $fragmentRefs": FragmentRefs<"TypenameOutside">, }; ------------------------------------------------------------------------------- @@ -183,7 +183,7 @@ export type TypenameOutsideWithAbstractType = { }; export type TypenameOutsideWithAbstractType$data = TypenameOutsideWithAbstractType; export type TypenameOutsideWithAbstractType$key = { - readonly $data?: TypenameOutsideWithAbstractType$data, + readonly " $data"?: TypenameOutsideWithAbstractType$data, readonly " $fragmentRefs": FragmentRefs<"TypenameOutsideWithAbstractType">, }; ------------------------------------------------------------------------------- @@ -197,7 +197,7 @@ export type TypenameWithCommonSelections = { }; export type TypenameWithCommonSelections$data = TypenameWithCommonSelections; export type TypenameWithCommonSelections$key = { - readonly $data?: TypenameWithCommonSelections$data, + readonly " $data"?: TypenameWithCommonSelections$data, readonly " $fragmentRefs": FragmentRefs<"TypenameWithCommonSelections">, }; ------------------------------------------------------------------------------- @@ -209,7 +209,7 @@ export type TypenameWithoutSpreads = { }; export type TypenameWithoutSpreads$data = TypenameWithoutSpreads; export type TypenameWithoutSpreads$key = { - readonly $data?: TypenameWithoutSpreads$data, + readonly " $data"?: TypenameWithoutSpreads$data, readonly " $fragmentRefs": FragmentRefs<"TypenameWithoutSpreads">, }; ------------------------------------------------------------------------------- @@ -221,6 +221,6 @@ export type TypenameWithoutSpreadsAbstractType = { }; export type TypenameWithoutSpreadsAbstractType$data = TypenameWithoutSpreadsAbstractType; export type TypenameWithoutSpreadsAbstractType$key = { - readonly $data?: TypenameWithoutSpreadsAbstractType$data, + readonly " $data"?: TypenameWithoutSpreadsAbstractType$data, readonly " $fragmentRefs": FragmentRefs<"TypenameWithoutSpreadsAbstractType">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected index 4110cfe85438a..3ee0ceb511de3 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected @@ -34,7 +34,7 @@ export type AnotherRecursiveFragment = { }; export type AnotherRecursiveFragment$data = AnotherRecursiveFragment; export type AnotherRecursiveFragment$key = { - readonly $data?: AnotherRecursiveFragment$data, + readonly " $data"?: AnotherRecursiveFragment$data, readonly " $fragmentRefs": FragmentRefs<"AnotherRecursiveFragment">, }; ------------------------------------------------------------------------------- @@ -46,7 +46,7 @@ export type PhotoFragment = { }; export type PhotoFragment$data = PhotoFragment; export type PhotoFragment$key = { - readonly $data?: PhotoFragment$data, + readonly " $data"?: PhotoFragment$data, readonly " $fragmentRefs": FragmentRefs<"PhotoFragment">, }; ------------------------------------------------------------------------------- @@ -57,7 +57,7 @@ export type RecursiveFragment = { }; export type RecursiveFragment$data = RecursiveFragment; export type RecursiveFragment$key = { - readonly $data?: RecursiveFragment$data, + readonly " $data"?: RecursiveFragment$data, readonly " $fragmentRefs": FragmentRefs<"RecursiveFragment">, }; ------------------------------------------------------------------------------- @@ -73,6 +73,6 @@ export type UserProfile = { }; export type UserProfile$data = UserProfile; export type UserProfile$key = { - readonly $data?: UserProfile$data, + readonly " $data"?: UserProfile$data, readonly " $fragmentRefs": FragmentRefs<"UserProfile">, }; From 555ac15ec064d64aa8411e02df06c4a3f048d3bd Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Sat, 24 Oct 2020 18:46:30 +0200 Subject: [PATCH 07/41] Handle Windows-style newlines in GraphQL lexing (\r\n). --- compiler/crates/graphql-syntax/src/lexer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/crates/graphql-syntax/src/lexer.rs b/compiler/crates/graphql-syntax/src/lexer.rs index d789c3d5e74c1..545b74afcbb86 100644 --- a/compiler/crates/graphql-syntax/src/lexer.rs +++ b/compiler/crates/graphql-syntax/src/lexer.rs @@ -20,7 +20,7 @@ pub struct TokenKindExtras { #[derive(Logos, Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] #[logos(extras = TokenKindExtras)] pub enum TokenKind { - #[regex(r"[ \t\n\f,]+|#[^\n\r]*", logos::skip)] + #[regex(r"[ \t\r\n\f,]+|#[^\n\r]*", logos::skip)] #[error] Error, From 213bf9907a0377bd41d2bdca446a0d421b3e3876 Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Sat, 24 Oct 2020 18:52:51 +0200 Subject: [PATCH 08/41] Fix grouped fragment refs. --- compiler/crates/relay-typegen/src/flow.rs | 2 +- compiler/crates/relay-typegen/src/lib.rs | 7 +------ compiler/crates/relay-typegen/src/writer.rs | 1 + .../generate_typescript/fixtures/fragment-spread.expected | 8 ++++---- .../generate_typescript/fixtures/inline-fragment.expected | 2 +- .../fixtures/match-field-in-query.expected | 2 +- .../generate_typescript/fixtures/match-field.expected | 2 +- .../fixtures/mutation-with-enums-on-fragment.expected | 2 +- .../fixtures/mutation-with-nested-fragments.expected | 4 ++-- .../mutation-with-response-on-inline-fragments.expected | 2 +- .../fixtures/query-with-match-fields.expected | 4 ++-- .../fixtures/query-with-module-field.expected | 4 ++-- .../fixtures/query-with-multiple-match-fields.expected | 8 ++++---- .../query-with-raw-response-on-conditional.expected | 2 +- ...uery-with-raw-response-on-literal-conditional.expected | 2 +- .../fixtures/recursive-fragments.expected | 2 +- .../fixtures/refetchable-fragment.expected | 2 +- .../generate_typescript/fixtures/refetchable.expected | 2 +- .../fixtures/unmasked-fragment-spreads.expected | 2 +- 19 files changed, 28 insertions(+), 32 deletions(-) diff --git a/compiler/crates/relay-typegen/src/flow.rs b/compiler/crates/relay-typegen/src/flow.rs index 1dac12837f742..36793e65f80c7 100644 --- a/compiler/crates/relay-typegen/src/flow.rs +++ b/compiler/crates/relay-typegen/src/flow.rs @@ -64,7 +64,7 @@ impl FlowPrinter { } AST::ExportFragmentList(names) => self.write_export_list(writer, names), AST::ImportFragmentType(types, from) => self.write_import_type(writer, types, from), - AST::FragmentReference(fragments) => self.write_union( + AST::FragmentReference(fragments) => self.write_intersection( writer, fragments .iter() diff --git a/compiler/crates/relay-typegen/src/lib.rs b/compiler/crates/relay-typegen/src/lib.rs index 9af0b2976bc6a..e3f56552169f4 100644 --- a/compiler/crates/relay-typegen/src/lib.rs +++ b/compiler/crates/relay-typegen/src/lib.rs @@ -1326,15 +1326,10 @@ fn group_refs(props: Vec) -> Vec { } } if !refs.is_empty() { - let value = AST::Intersection( - refs.into_iter() - .map(|ref_| AST::Identifier(get_old_fragment_type_name(ref_))) - .collect(), - ); result.push(TypeSelection { key: *KEY_FRAGMENT_REFS, conditional: false, - value: Some(value), + value: Some(AST::FragmentReference(refs)), schema_name: None, node_type: None, concrete_type: None, diff --git a/compiler/crates/relay-typegen/src/writer.rs b/compiler/crates/relay-typegen/src/writer.rs index 93ec133644854..5179b5f39f5b2 100644 --- a/compiler/crates/relay-typegen/src/writer.rs +++ b/compiler/crates/relay-typegen/src/writer.rs @@ -11,6 +11,7 @@ use lazy_static::lazy_static; #[derive(Debug, Clone)] pub enum AST { Union(Vec), + #[allow(dead_code)] Intersection(Vec), ReadOnlyArray(Box), Nullable(Box), diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected index 9e9726231e277..9393634555a15 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected @@ -53,7 +53,7 @@ export type ConcreateTypes = { readonly actor?: { readonly __typename: "Page", readonly id: string, - readonly " $fragmentRefs": PageFragment$ref, + readonly " $fragmentRefs": FragmentRefs<"PageFragment">, } | { readonly __typename: "User", readonly name?: string, @@ -74,13 +74,13 @@ import { FragmentRefs } from "relay-runtime"; export type FragmentSpread = { readonly id: string, readonly justFrag?: { - readonly " $fragmentRefs": PictureFragment$ref + readonly " $fragmentRefs": FragmentRefs<"PictureFragment"> }, readonly fragAndField?: { readonly uri?: string, - readonly " $fragmentRefs": PictureFragment$ref, + readonly " $fragmentRefs": FragmentRefs<"PictureFragment">, }, - readonly " $fragmentRefs": OtherFragment$ref & UserFrag1$ref & UserFrag2$ref, + readonly " $fragmentRefs": FragmentRefs<"OtherFragment" | "UserFrag1" | "UserFrag2">, readonly " $refType": FragmentRefs<"FragmentSpread">, }; export type FragmentSpread$data = FragmentSpread; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected index 4a94df55f160c..77cec219e1b21 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected @@ -101,7 +101,7 @@ export type InlineFragmentKitchenSink = { readonly height?: number, }, readonly name?: string, - readonly " $fragmentRefs": SomeFragment$ref, + readonly " $fragmentRefs": FragmentRefs<"SomeFragment">, }, readonly " $refType": FragmentRefs<"InlineFragmentKitchenSink">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected index c2d476556a00e..ac051695fe7c8 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected @@ -29,7 +29,7 @@ export type NameRendererQueryResponse = { readonly nameRenderer?: { readonly __fragmentPropName?: string, readonly __module_component?: string, - readonly " $fragmentRefs": PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, } } }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected index e215aa75f518b..6db6a936416bc 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected @@ -42,7 +42,7 @@ export type NameRendererFragment = { readonly nameRenderer?: { readonly __fragmentPropName?: string, readonly __module_component?: string, - readonly " $fragmentRefs": PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, }, readonly " $refType": FragmentRefs<"NameRendererFragment">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected index 879a3e6cc1213..22dc0c7adae09 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected @@ -52,7 +52,7 @@ export type CommentCreateMutationResponse = { readonly node?: { readonly id: string, readonly __typename: string, - readonly " $fragmentRefs": FriendFragment$ref, + readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, } } | null> } diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected index c494ee307e673..09e4c51a8c71c 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected @@ -54,7 +54,7 @@ export type CommentCreateMutationResponse = { readonly edges?: ReadonlyArray<{ readonly node?: { readonly lastName?: string, - readonly " $fragmentRefs": FriendFragment$ref, + readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, } } | null> } @@ -104,7 +104,7 @@ export type FriendFragment = { readonly name?: string, readonly lastName?: string, readonly feedback?: { - readonly " $fragmentRefs": FeedbackFragment$ref + readonly " $fragmentRefs": FragmentRefs<"FeedbackFragment"> }, readonly " $refType": FragmentRefs<"FriendFragment">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected index 9d9ee045853c8..f8000a8738af8 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected @@ -45,7 +45,7 @@ export type TestMutationResponse = { readonly commentCreate?: { readonly viewer?: { readonly actor?: { - readonly " $fragmentRefs": InlineFragmentWithOverlappingFields$ref + readonly " $fragmentRefs": FragmentRefs<"InlineFragmentWithOverlappingFields"> } } } diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected index 6fb0d2d84653e..aef8edea6a6d5 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected @@ -32,7 +32,7 @@ import { Local3DPayload } from "relay-runtime"; export type TestVariables = {}; export type TestResponse = { readonly node?: { - readonly " $fragmentRefs": NameRendererFragment$ref + readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment"> } }; export type PlainUserNameRenderer_name = { @@ -99,7 +99,7 @@ export type NameRendererFragment = { readonly nameRenderer?: { readonly __fragmentPropName?: string, readonly __module_component?: string, - readonly " $fragmentRefs": PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, }, readonly " $refType": FragmentRefs<"NameRendererFragment">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected index 3ef1a01b7f888..bca7f894c8bbc 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected @@ -21,7 +21,7 @@ import { Local3DPayload } from "relay-runtime"; export type TestVariables = {}; export type TestResponse = { readonly node?: { - readonly " $fragmentRefs": Test_user$ref + readonly " $fragmentRefs": FragmentRefs<"Test_user"> } }; export type Test_userRenderer = { @@ -54,7 +54,7 @@ export type Test_user = { readonly plainUserRenderer?: { readonly __fragmentPropName?: string, readonly __module_component?: string, - readonly " $fragmentRefs": Test_userRenderer$ref, + readonly " $fragmentRefs": FragmentRefs<"Test_userRenderer">, }, readonly " $refType": FragmentRefs<"Test_user">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected index e51d1061458e9..b81cc3920f7e8 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected @@ -53,12 +53,12 @@ export type TestVariables = {}; export type TestResponse = { readonly node?: { readonly username?: string, - readonly " $fragmentRefs": NameRendererFragment$ref, + readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment">, }, readonly viewer?: { readonly actor?: { readonly name?: string, - readonly " $fragmentRefs": AnotherNameRendererFragment$ref, + readonly " $fragmentRefs": FragmentRefs<"AnotherNameRendererFragment">, } }, }; @@ -138,7 +138,7 @@ export type AnotherNameRendererFragment = { readonly nameRenderer?: { readonly __fragmentPropName?: string, readonly __module_component?: string, - readonly " $fragmentRefs": PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, }, readonly " $refType": FragmentRefs<"AnotherNameRendererFragment">, }; @@ -168,7 +168,7 @@ export type NameRendererFragment = { readonly nameRenderer?: { readonly __fragmentPropName?: string, readonly __module_component?: string, - readonly " $fragmentRefs": PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, }, readonly " $refType": FragmentRefs<"NameRendererFragment">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected index 6e44f9c7d391e..ec8570030cf07 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected @@ -22,7 +22,7 @@ export type ExampleQueryVariables = { }; export type ExampleQueryResponse = { readonly node?: { - readonly " $fragmentRefs": FriendFragment$ref + readonly " $fragmentRefs": FragmentRefs<"FriendFragment"> } }; export type ExampleQueryRawResponse = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected index 6598cc94db037..6965ab56cbd15 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected @@ -31,7 +31,7 @@ export type ExampleQueryResponse = { readonly friends?: { readonly count?: number }, - readonly " $fragmentRefs": FriendFragment$ref, + readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, } }; export type ExampleQueryRawResponse = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/recursive-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/recursive-fragments.expected index 7901326376186..6186eb28510ea 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/recursive-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/recursive-fragments.expected @@ -9,7 +9,7 @@ fragment FragmentSpread on Node { import { FragmentRefs } from "relay-runtime"; export type FragmentSpread = { readonly id: string, - readonly " $fragmentRefs": FragmentSpread$ref, + readonly " $fragmentRefs": FragmentRefs<"FragmentSpread">, readonly " $refType": FragmentRefs<"FragmentSpread">, }; export type FragmentSpread$data = FragmentSpread; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected index 4a969877b8fb2..9e3677ea79542 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected @@ -13,7 +13,7 @@ export type RefetchableFragmentQueryVariables = { }; export type RefetchableFragmentQueryResponse = { readonly node?: { - readonly " $fragmentRefs": RefetchableFragment$ref + readonly " $fragmentRefs": FragmentRefs<"RefetchableFragment"> } }; export type RefetchableFragmentQuery = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected index 5e19af44d8274..3cbb82c5651f3 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected @@ -13,7 +13,7 @@ export type FlowRefetchableFragmentQueryVariables = { }; export type FlowRefetchableFragmentQueryResponse = { readonly node?: { - readonly " $fragmentRefs": FlowRefetchableFragment$ref + readonly " $fragmentRefs": FragmentRefs<"FlowRefetchableFragment"> } }; export type FlowRefetchableFragmentQuery = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected index 3ee0ceb511de3..55439cfd18e5c 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected @@ -67,7 +67,7 @@ export type UserProfile = { readonly uri?: string, readonly width?: number, readonly height?: number, - readonly " $fragmentRefs": PhotoFragment$ref, + readonly " $fragmentRefs": FragmentRefs<"PhotoFragment">, }, readonly " $refType": FragmentRefs<"UserProfile">, }; From d6575baedb6cbf6010f65d952580a8aecf93c948 Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Sun, 25 Oct 2020 15:17:20 +0100 Subject: [PATCH 09/41] Type optional and nullable fields the same as relay-compiler-language-typescript. --- .../crates/relay-typegen/src/typescript.rs | 14 +-- .../fixtures/fragment-spread.expected | 16 +-- .../fixtures/inline-fragment.expected | 34 +++--- .../fixtures/linked-field.expected | 28 ++--- .../fixtures/match-field-in-query.expected | 28 ++--- .../fixtures/match-field.expected | 24 ++-- .../mutation-input-has-array.expected | 26 ++--- .../mutation-with-client-extension.expected | 32 ++--- .../mutation-with-enums-on-fragment.expected | 74 ++++++------ .../mutation-with-nested-fragments.expected | 76 ++++++------ ...with-response-on-inline-fragments.expected | 62 +++++----- .../fixtures/mutation.expected | 30 ++--- .../fixtures/query-with-handles.expected | 30 ++--- .../fixtures/query-with-match-fields.expected | 64 +++++----- .../fixtures/query-with-module-field.expected | 36 +++--- .../query-with-multiple-match-fields.expected | 110 +++++++++--------- ...-with-raw-response-on-conditional.expected | 26 ++--- ...w-response-on-literal-conditional.expected | 24 ++-- .../query-with-stream-connection.expected | 56 ++++----- .../fixtures/query-with-stream.expected | 44 +++---- .../fixtures/refetchable-fragment.expected | 10 +- .../fixtures/refetchable.expected | 6 +- .../fixtures/relay-client-id-field.expected | 14 +-- .../required-bubbles-to-fragment.expected | 2 +- ...d-bubbles-to-item-in-plural-field.expected | 8 +- .../required-bubbles-to-query.expected | 2 +- ...d-bubbles-up-to-mutation-response.expected | 10 +- ...solates-concrete-inline-fragments.expected | 10 +- .../required-raw-response-type.expected | 6 +- ...-throw-doesnt-bubbles-to-fragment.expected | 2 +- ...red-throw-doesnt-bubbles-to-query.expected | 4 +- .../fixtures/required-throws-nested.expected | 6 +- .../fixtures/required.expected | 6 +- .../fixtures/roots.expected | 36 +++--- .../fixtures/scalar-field.expected | 20 ++-- .../fixtures/simple.expected | 12 +- ...me-inside-with-overlapping-fields.expected | 14 +-- .../fixtures/typename-on-union.expected | 36 +++--- .../unmasked-fragment-spreads.expected | 22 ++-- 39 files changed, 525 insertions(+), 535 deletions(-) diff --git a/compiler/crates/relay-typegen/src/typescript.rs b/compiler/crates/relay-typegen/src/typescript.rs index 4505a88743192..702e02e1f6bc6 100644 --- a/compiler/crates/relay-typegen/src/typescript.rs +++ b/compiler/crates/relay-typegen/src/typescript.rs @@ -191,21 +191,11 @@ impl TypeScriptPrinter { prop.key } )?; - if match &prop.value { - AST::Nullable(_) => true, - _ => prop.optional, - } { + if prop.optional { write!(writer, "?")?; } write!(writer, ": ")?; - self.write( - writer, - if let AST::Nullable(value) = &prop.value { - value - } else { - &prop.value - }, - )?; + self.write(writer, &prop.value)?; if first && props.len() == 1 && exact { writeln!(writer)?; } else { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected index 9393634555a15..2e76bada805e0 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected @@ -50,18 +50,18 @@ fragment UserFrag2 on User { ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; export type ConcreateTypes = { - readonly actor?: { + readonly actor: { readonly __typename: "Page", readonly id: string, readonly " $fragmentRefs": FragmentRefs<"PageFragment">, } | { readonly __typename: "User", - readonly name?: string, + readonly name: string | null, } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly __typename: "%other" - }, + } | null, readonly " $refType": FragmentRefs<"ConcreateTypes">, }; export type ConcreateTypes$data = ConcreateTypes; @@ -73,13 +73,13 @@ export type ConcreateTypes$key = { import { FragmentRefs } from "relay-runtime"; export type FragmentSpread = { readonly id: string, - readonly justFrag?: { + readonly justFrag: { readonly " $fragmentRefs": FragmentRefs<"PictureFragment"> - }, - readonly fragAndField?: { - readonly uri?: string, + } | null, + readonly fragAndField: { + readonly uri: string | null, readonly " $fragmentRefs": FragmentRefs<"PictureFragment">, - }, + } | null, readonly " $fragmentRefs": FragmentRefs<"OtherFragment" | "UserFrag1" | "UserFrag2">, readonly " $refType": FragmentRefs<"FragmentSpread">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected index 77cec219e1b21..6000ed3d43b2f 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected @@ -67,10 +67,10 @@ fragment SomeFragment on User { import { FragmentRefs } from "relay-runtime"; export type InlineFragment = { readonly id: string, - readonly name?: string, + readonly name?: string | null, readonly message?: { - readonly text?: string - }, + readonly text: string | null + } | null, readonly " $refType": FragmentRefs<"InlineFragment">, }; export type InlineFragment$data = InlineFragment; @@ -82,7 +82,7 @@ export type InlineFragment$key = { import { FragmentRefs } from "relay-runtime"; export type InlineFragmentConditionalID = { readonly id?: string, - readonly name?: string, + readonly name?: string | null, readonly " $refType": FragmentRefs<"InlineFragmentConditionalID">, }; export type InlineFragmentConditionalID$data = InlineFragmentConditionalID; @@ -93,16 +93,16 @@ export type InlineFragmentConditionalID$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type InlineFragmentKitchenSink = { - readonly actor?: { + readonly actor: { readonly id: string, - readonly profilePicture?: { - readonly uri?: string, - readonly width?: number, - readonly height?: number, - }, - readonly name?: string, + readonly profilePicture: { + readonly uri: string | null, + readonly width?: number | null, + readonly height?: number | null, + } | null, + readonly name?: string | null, readonly " $fragmentRefs": FragmentRefs<"SomeFragment">, - }, + } | null, readonly " $refType": FragmentRefs<"InlineFragmentKitchenSink">, }; export type InlineFragmentKitchenSink$data = InlineFragmentKitchenSink; @@ -115,12 +115,12 @@ import { FragmentRefs } from "relay-runtime"; export type InlineFragmentWithOverlappingFields = { readonly hometown?: { readonly id: string, - readonly name?: string, + readonly name: string | null, readonly message?: { - readonly text?: string - }, - }, - readonly name?: string, + readonly text: string | null + } | null, + } | null, + readonly name?: string | null, readonly " $refType": FragmentRefs<"InlineFragmentWithOverlappingFields">, }; export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected index 42c2788a5c9e5..bdeff5e9fa4a7 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected @@ -29,14 +29,14 @@ query UnionTypeTest { ==================================== OUTPUT =================================== export type UnionTypeTestVariables = {}; export type UnionTypeTestResponse = { - readonly neverNode?: { + readonly neverNode: { readonly __typename: "FakeNode", readonly id: string, } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly __typename: "%other" - } + } | null }; export type UnionTypeTest = { variables: UnionTypeTestVariables, @@ -45,20 +45,20 @@ export type UnionTypeTest = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type LinkedField = { - readonly profilePicture?: { - readonly uri?: string, - readonly width?: number, - readonly height?: number, - }, - readonly hometown?: { + readonly profilePicture: { + readonly uri: string | null, + readonly width: number | null, + readonly height: number | null, + } | null, + readonly hometown: { readonly id: string, - readonly profilePicture?: { - readonly uri?: string - }, - }, - readonly actor?: { + readonly profilePicture: { + readonly uri: string | null + } | null, + } | null, + readonly actor: { readonly id: string - }, + } | null, readonly " $refType": FragmentRefs<"LinkedField">, }; export type LinkedField$data = LinkedField; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected index ac051695fe7c8..b47cd4dd41b54 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected @@ -25,13 +25,13 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { ==================================== OUTPUT =================================== export type NameRendererQueryVariables = {}; export type NameRendererQueryResponse = { - readonly me?: { - readonly nameRenderer?: { - readonly __fragmentPropName?: string, - readonly __module_component?: string, + readonly me: { + readonly nameRenderer: { + readonly __fragmentPropName?: string | null, + readonly __module_component?: string | null, readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, - } - } + } | null + } | null }; export type NameRendererQuery = { variables: NameRendererQueryVariables, @@ -40,10 +40,10 @@ export type NameRendererQuery = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type MarkdownUserNameRenderer_name = { - readonly markdown?: string, - readonly data?: { - readonly markup?: string - }, + readonly markdown: string | null, + readonly data: { + readonly markup: string | null + } | null, readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">, }; export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; @@ -54,10 +54,10 @@ export type MarkdownUserNameRenderer_name$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type PlainUserNameRenderer_name = { - readonly plaintext?: string, - readonly data?: { - readonly text?: string - }, + readonly plaintext: string | null, + readonly data: { + readonly text: string | null + } | null, readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">, }; export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected index 6db6a936416bc..d342f3675fb52 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected @@ -24,10 +24,10 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; export type MarkdownUserNameRenderer_name = { - readonly markdown?: string, - readonly data?: { - readonly markup?: string - }, + readonly markdown: string | null, + readonly data: { + readonly markup: string | null + } | null, readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">, }; export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; @@ -39,11 +39,11 @@ export type MarkdownUserNameRenderer_name$key = { import { FragmentRefs } from "relay-runtime"; export type NameRendererFragment = { readonly id: string, - readonly nameRenderer?: { - readonly __fragmentPropName?: string, - readonly __module_component?: string, + readonly nameRenderer: { + readonly __fragmentPropName?: string | null, + readonly __module_component?: string | null, readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, - }, + } | null, readonly " $refType": FragmentRefs<"NameRendererFragment">, }; export type NameRendererFragment$data = NameRendererFragment; @@ -54,10 +54,10 @@ export type NameRendererFragment$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type PlainUserNameRenderer_name = { - readonly plaintext?: string, - readonly data?: { - readonly text?: string - }, + readonly plaintext: string | null, + readonly data: { + readonly text: string | null + } | null, readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">, }; export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-input-has-array.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-input-has-array.expected index f0325bbb92445..402600925e076 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-input-has-array.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-input-has-array.expected @@ -8,26 +8,26 @@ mutation InputHasArray($input: UpdateAllSeenStateInput) @raw_response_type { } ==================================== OUTPUT =================================== export type UpdateAllSeenStateInput = { - clientMutationId?: string, - storyIds?: ReadonlyArray, + clientMutationId?: string | null, + storyIds?: ReadonlyArray | null, }; export type InputHasArrayVariables = { - input?: UpdateAllSeenStateInput + input?: UpdateAllSeenStateInput | null }; export type InputHasArrayResponse = { - readonly viewerNotificationsUpdateAllSeenState?: { - readonly stories?: ReadonlyArray<{ - readonly actorCount?: number - } | null> - } + readonly viewerNotificationsUpdateAllSeenState: { + readonly stories: ReadonlyArray<{ + readonly actorCount: number | null + } | null> | null + } | null }; export type InputHasArrayRawResponse = { - readonly viewerNotificationsUpdateAllSeenState?: { - readonly stories?: ReadonlyArray<{ - readonly actorCount?: number, + readonly viewerNotificationsUpdateAllSeenState: { + readonly stories: ReadonlyArray<{ + readonly actorCount: number | null, readonly id: string, - } | null> - } + } | null> | null + } | null }; export type InputHasArray = { variables: InputHasArrayVariables, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-client-extension.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-client-extension.expected index 4a2ac9ea06ad6..80c474f6a5059 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-client-extension.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-client-extension.expected @@ -20,30 +20,30 @@ type Foo { } ==================================== OUTPUT =================================== export type UpdateAllSeenStateInput = { - clientMutationId?: string, - storyIds?: ReadonlyArray, + clientMutationId?: string | null, + storyIds?: ReadonlyArray | null, }; export type TestVariables = { - input?: UpdateAllSeenStateInput + input?: UpdateAllSeenStateInput | null }; export type TestResponse = { - readonly viewerNotificationsUpdateAllSeenState?: { - readonly stories?: ReadonlyArray<{ - readonly foos?: ReadonlyArray<{ - readonly bar?: string - } | null> - } | null> - } + readonly viewerNotificationsUpdateAllSeenState: { + readonly stories: ReadonlyArray<{ + readonly foos: ReadonlyArray<{ + readonly bar: string | null + } | null> | null + } | null> | null + } | null }; export type TestRawResponse = { - readonly viewerNotificationsUpdateAllSeenState?: { - readonly stories?: ReadonlyArray<{ + readonly viewerNotificationsUpdateAllSeenState: { + readonly stories: ReadonlyArray<{ readonly id: string, readonly foos?: ReadonlyArray<{ - readonly bar?: string - } | null>, - } | null> - } + readonly bar: string | null + } | null> | null, + } | null> | null + } | null }; export type Test = { variables: TestVariables, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected index 22dc0c7adae09..e5f57f07824df 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected @@ -29,55 +29,55 @@ fragment FriendFragment on User { ==================================== OUTPUT =================================== export type TestEnums = "mark" | "zuck" | "%future added value"; export type CommentCreateInput = { - clientMutationId?: string, - feedbackId?: string, - feedback?: CommentfeedbackFeedback, + clientMutationId?: string | null, + feedbackId?: string | null, + feedback?: CommentfeedbackFeedback | null, }; export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment + comment?: FeedbackcommentComment | null }; export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback + feedback?: CommentfeedbackFeedback | null }; export type CommentCreateMutationVariables = { input: CommentCreateInput, - first?: number, - orderBy?: ReadonlyArray, + first?: number | null, + orderBy?: ReadonlyArray | null, }; export type CommentCreateMutationResponse = { - readonly commentCreate?: { - readonly comment?: { - readonly friends?: { - readonly edges?: ReadonlyArray<{ - readonly node?: { + readonly commentCreate: { + readonly comment: { + readonly friends: { + readonly edges: ReadonlyArray<{ + readonly node: { readonly id: string, readonly __typename: string, readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, - } - } | null> - } - } - } + } | null + } | null> | null + } | null + } | null + } | null }; export type CommentCreateMutationRawResponse = { - readonly commentCreate?: { - readonly comment?: { - readonly friends?: { - readonly edges?: ReadonlyArray<{ - readonly node?: { + readonly commentCreate: { + readonly comment: { + readonly friends: { + readonly edges: ReadonlyArray<{ + readonly node: { readonly id: string, readonly __typename: "User", - readonly name?: string, - readonly lastName?: string, - readonly profilePicture2?: { - readonly test_enums?: TestEnums - }, - } - } | null> - }, + readonly name: string | null, + readonly lastName: string | null, + readonly profilePicture2: { + readonly test_enums: TestEnums | null + } | null, + } | null + } | null> | null + } | null, readonly id: string, - } - } + } | null + } | null }; export type CommentCreateMutation = { variables: CommentCreateMutationVariables, @@ -88,11 +88,11 @@ export type CommentCreateMutation = { export type TestEnums = "mark" | "zuck" | "%future added value"; import { FragmentRefs } from "relay-runtime"; export type FriendFragment = { - readonly name?: string, - readonly lastName?: string, - readonly profilePicture2?: { - readonly test_enums?: TestEnums - }, + readonly name: string | null, + readonly lastName: string | null, + readonly profilePicture2: { + readonly test_enums: TestEnums | null + } | null, readonly " $refType": FragmentRefs<"FriendFragment">, }; export type FriendFragment$data = FriendFragment; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected index 09e4c51a8c71c..3af2033897974 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected @@ -32,54 +32,54 @@ fragment FeedbackFragment on Feedback { } ==================================== OUTPUT =================================== export type CommentCreateInput = { - clientMutationId?: string, - feedbackId?: string, - feedback?: CommentfeedbackFeedback, + clientMutationId?: string | null, + feedbackId?: string | null, + feedback?: CommentfeedbackFeedback | null, }; export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment + comment?: FeedbackcommentComment | null }; export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback + feedback?: CommentfeedbackFeedback | null }; export type CommentCreateMutationVariables = { input: CommentCreateInput, - first?: number, - orderBy?: ReadonlyArray, + first?: number | null, + orderBy?: ReadonlyArray | null, }; export type CommentCreateMutationResponse = { - readonly commentCreate?: { - readonly comment?: { - readonly friends?: { - readonly edges?: ReadonlyArray<{ - readonly node?: { - readonly lastName?: string, + readonly commentCreate: { + readonly comment: { + readonly friends: { + readonly edges: ReadonlyArray<{ + readonly node: { + readonly lastName: string | null, readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, - } - } | null> - } - } - } + } | null + } | null> | null + } | null + } | null + } | null }; export type CommentCreateMutationRawResponse = { - readonly commentCreate?: { - readonly comment?: { - readonly friends?: { - readonly edges?: ReadonlyArray<{ - readonly node?: { - readonly lastName?: string, - readonly name?: string, - readonly feedback?: { + readonly commentCreate: { + readonly comment: { + readonly friends: { + readonly edges: ReadonlyArray<{ + readonly node: { + readonly lastName: string | null, + readonly name: string | null, + readonly feedback: { readonly id: string, - readonly name?: string, - }, + readonly name: string | null, + } | null, readonly id: string, - } - } | null> - }, + } | null + } | null> | null + } | null, readonly id: string, - } - } + } | null + } | null }; export type CommentCreateMutation = { variables: CommentCreateMutationVariables, @@ -90,7 +90,7 @@ export type CommentCreateMutation = { import { FragmentRefs } from "relay-runtime"; export type FeedbackFragment = { readonly id: string, - readonly name?: string, + readonly name: string | null, readonly " $refType": FragmentRefs<"FeedbackFragment">, }; export type FeedbackFragment$data = FeedbackFragment; @@ -101,11 +101,11 @@ export type FeedbackFragment$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type FriendFragment = { - readonly name?: string, - readonly lastName?: string, - readonly feedback?: { + readonly name: string | null, + readonly lastName: string | null, + readonly feedback: { readonly " $fragmentRefs": FragmentRefs<"FeedbackFragment"> - }, + } | null, readonly " $refType": FragmentRefs<"FriendFragment">, }; export type FriendFragment$data = FriendFragment; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected index f8000a8738af8..e6a99c5a06228 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected @@ -28,57 +28,57 @@ fragment InlineFragmentWithOverlappingFields on Actor { } ==================================== OUTPUT =================================== export type CommentCreateInput = { - clientMutationId?: string, - feedbackId?: string, - feedback?: CommentfeedbackFeedback, + clientMutationId?: string | null, + feedbackId?: string | null, + feedback?: CommentfeedbackFeedback | null, }; export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment + comment?: FeedbackcommentComment | null }; export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback + feedback?: CommentfeedbackFeedback | null }; export type TestMutationVariables = { input: CommentCreateInput }; export type TestMutationResponse = { - readonly commentCreate?: { - readonly viewer?: { - readonly actor?: { + readonly commentCreate: { + readonly viewer: { + readonly actor: { readonly " $fragmentRefs": FragmentRefs<"InlineFragmentWithOverlappingFields"> - } - } - } + } | null + } | null + } | null }; export type TestMutationRawResponse = { - readonly commentCreate?: { - readonly viewer?: { - readonly actor?: { + readonly commentCreate: { + readonly viewer: { + readonly actor: { readonly __typename: "User", readonly __isActor: "User", readonly id: string, - readonly hometown?: { + readonly hometown: { readonly id: string, - readonly name?: string, - }, + readonly name: string | null, + } | null, } | { readonly __typename: "Page", readonly __isActor: "Page", readonly id: string, - readonly name?: string, - readonly hometown?: { + readonly name: string | null, + readonly hometown: { readonly id: string, - readonly message?: { - readonly text?: string - }, - }, + readonly message: { + readonly text: string | null + } | null, + } | null, } | { readonly __typename: string, readonly __isActor: string, readonly id: string, - } - } - } + } | null + } | null + } | null }; export type TestMutation = { variables: TestMutationVariables, @@ -90,12 +90,12 @@ import { FragmentRefs } from "relay-runtime"; export type InlineFragmentWithOverlappingFields = { readonly hometown?: { readonly id: string, - readonly name?: string, + readonly name: string | null, readonly message?: { - readonly text?: string - }, - }, - readonly name?: string, + readonly text: string | null + } | null, + } | null, + readonly name?: string | null, readonly " $refType": FragmentRefs<"InlineFragmentWithOverlappingFields">, }; export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation.expected index 8550cc110a956..58af9cf555905 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation.expected @@ -16,31 +16,31 @@ mutation CommentCreateMutation( } ==================================== OUTPUT =================================== export type CommentCreateInput = { - clientMutationId?: string, - feedbackId?: string, - feedback?: CommentfeedbackFeedback, + clientMutationId?: string | null, + feedbackId?: string | null, + feedback?: CommentfeedbackFeedback | null, }; export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment + comment?: FeedbackcommentComment | null }; export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback + feedback?: CommentfeedbackFeedback | null }; export type CommentCreateMutationVariables = { input: CommentCreateInput, - first?: number, - orderBy?: ReadonlyArray, + first?: number | null, + orderBy?: ReadonlyArray | null, }; export type CommentCreateMutationResponse = { - readonly commentCreate?: { - readonly comment?: { + readonly commentCreate: { + readonly comment: { readonly id: string, - readonly name?: string, - readonly friends?: { - readonly count?: number - }, - } - } + readonly name: string | null, + readonly friends: { + readonly count: number | null + } | null, + } | null + } | null }; export type CommentCreateMutation = { variables: CommentCreateMutationVariables, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-handles.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-handles.expected index 939cbfb833a25..6fb55a9ec73a2 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-handles.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-handles.expected @@ -21,23 +21,23 @@ export type LinkedHandleFieldVariables = { id: string }; export type LinkedHandleFieldResponse = { - readonly node?: { + readonly node: { readonly friends?: { - readonly count?: number - } - } + readonly count: number | null + } | null + } | null }; export type LinkedHandleFieldRawResponse = { - readonly node?: { + readonly node: { readonly __typename: "User", readonly id: string, - readonly friends?: { - readonly count?: number - }, + readonly friends: { + readonly count: number | null + } | null, } | { readonly __typename: string, readonly id: string, - } + } | null }; export type LinkedHandleField = { variables: LinkedHandleFieldVariables, @@ -49,19 +49,19 @@ export type ScalarHandleFieldVariables = { id: string }; export type ScalarHandleFieldResponse = { - readonly node?: { - readonly name?: string - } + readonly node: { + readonly name?: string | null + } | null }; export type ScalarHandleFieldRawResponse = { - readonly node?: { + readonly node: { readonly __typename: "User", readonly id: string, - readonly name?: string, + readonly name: string | null, } | { readonly __typename: string, readonly id: string, - } + } | null }; export type ScalarHandleField = { variables: ScalarHandleFieldVariables, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected index aef8edea6a6d5..74c6d7c27e022 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected @@ -31,47 +31,47 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { import { Local3DPayload } from "relay-runtime"; export type TestVariables = {}; export type TestResponse = { - readonly node?: { + readonly node: { readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment"> - } + } | null }; export type PlainUserNameRenderer_name = { - readonly plaintext?: string, - readonly data?: { - readonly text?: string, - readonly id?: string, - }, + readonly plaintext: string | null, + readonly data: { + readonly text: string | null, + readonly id: string | null, + } | null, }; export type MarkdownUserNameRenderer_name = { - readonly markdown?: string, - readonly data?: { - readonly markup?: string, - readonly id?: string, - }, + readonly markdown: string | null, + readonly data: { + readonly markup: string | null, + readonly id: string | null, + } | null, }; export type TestRawResponse = { - readonly node?: { + readonly node: { readonly __typename: "User", readonly id: string, - readonly nameRenderer?: { + readonly nameRenderer: { readonly __typename: "PlainUserNameRenderer", - readonly __module_operation_NameRendererFragment?: any, - readonly __module_component_NameRendererFragment?: any, + readonly __module_operation_NameRendererFragment: any | null, + readonly __module_component_NameRendererFragment: any | null, } | Local3DPayload<"NameRendererFragment", { readonly __typename: "PlainUserNameRenderer", }> | { readonly __typename: "MarkdownUserNameRenderer", - readonly __module_operation_NameRendererFragment?: any, - readonly __module_component_NameRendererFragment?: any, + readonly __module_operation_NameRendererFragment: any | null, + readonly __module_component_NameRendererFragment: any | null, } | Local3DPayload<"NameRendererFragment", { readonly __typename: "MarkdownUserNameRenderer", }> | { readonly __typename: string - }, + } | null, } | { readonly __typename: string, readonly id: string, - } + } | null }; export type Test = { variables: TestVariables, @@ -81,10 +81,10 @@ export type Test = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type MarkdownUserNameRenderer_name = { - readonly markdown?: string, - readonly data?: { - readonly markup?: string - }, + readonly markdown: string | null, + readonly data: { + readonly markup: string | null + } | null, readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">, }; export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; @@ -96,11 +96,11 @@ export type MarkdownUserNameRenderer_name$key = { import { FragmentRefs } from "relay-runtime"; export type NameRendererFragment = { readonly id: string, - readonly nameRenderer?: { - readonly __fragmentPropName?: string, - readonly __module_component?: string, + readonly nameRenderer: { + readonly __fragmentPropName?: string | null, + readonly __module_component?: string | null, readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, - }, + } | null, readonly " $refType": FragmentRefs<"NameRendererFragment">, }; export type NameRendererFragment$data = NameRendererFragment; @@ -111,10 +111,10 @@ export type NameRendererFragment$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type PlainUserNameRenderer_name = { - readonly plaintext?: string, - readonly data?: { - readonly text?: string - }, + readonly plaintext: string | null, + readonly data: { + readonly text: string | null + } | null, readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">, }; export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected index bca7f894c8bbc..1efcd9e1b2cc9 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected @@ -20,28 +20,28 @@ fragment Test_userRenderer on PlainUserRenderer { import { Local3DPayload } from "relay-runtime"; export type TestVariables = {}; export type TestResponse = { - readonly node?: { + readonly node: { readonly " $fragmentRefs": FragmentRefs<"Test_user"> - } + } | null }; export type Test_userRenderer = { - readonly user?: { - readonly username?: string, + readonly user: { + readonly username: string | null, readonly id: string, - } + } | null }; export type TestRawResponse = { - readonly node?: { + readonly node: { readonly __typename: "User", readonly id: string, - readonly plainUserRenderer?: { - readonly __module_operation_Test_user?: any, - readonly __module_component_Test_user?: any, - } | Local3DPayload<"Test_user", {}>, + readonly plainUserRenderer: { + readonly __module_operation_Test_user: any | null, + readonly __module_component_Test_user: any | null, + } | Local3DPayload<"Test_user", {}> | null, } | { readonly __typename: string, readonly id: string, - } + } | null }; export type Test = { variables: TestVariables, @@ -51,11 +51,11 @@ export type Test = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type Test_user = { - readonly plainUserRenderer?: { - readonly __fragmentPropName?: string, - readonly __module_component?: string, + readonly plainUserRenderer: { + readonly __fragmentPropName?: string | null, + readonly __module_component?: string | null, readonly " $fragmentRefs": FragmentRefs<"Test_userRenderer">, - }, + } | null, readonly " $refType": FragmentRefs<"Test_user">, }; export type Test_user$data = Test_user; @@ -66,9 +66,9 @@ export type Test_user$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type Test_userRenderer = { - readonly user?: { - readonly username?: string - }, + readonly user: { + readonly username: string | null + } | null, readonly " $refType": FragmentRefs<"Test_userRenderer">, }; export type Test_userRenderer$data = Test_userRenderer; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected index b81cc3920f7e8..3f30ae8c30d19 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected @@ -51,80 +51,80 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { import { Local3DPayload } from "relay-runtime"; export type TestVariables = {}; export type TestResponse = { - readonly node?: { - readonly username?: string, + readonly node: { + readonly username?: string | null, readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment">, - }, - readonly viewer?: { - readonly actor?: { - readonly name?: string, + } | null, + readonly viewer: { + readonly actor: { + readonly name?: string | null, readonly " $fragmentRefs": FragmentRefs<"AnotherNameRendererFragment">, - } - }, + } | null + } | null, }; export type PlainUserNameRenderer_name = { - readonly plaintext?: string, - readonly data?: { - readonly text?: string, - readonly id?: string, - }, + readonly plaintext: string | null, + readonly data: { + readonly text: string | null, + readonly id: string | null, + } | null, }; export type MarkdownUserNameRenderer_name = { - readonly markdown?: string, - readonly data?: { - readonly markup?: string, - readonly id?: string, - }, + readonly markdown: string | null, + readonly data: { + readonly markup: string | null, + readonly id: string | null, + } | null, }; export type TestRawResponse = { - readonly node?: { + readonly node: { readonly __typename: "User", readonly id: string, - readonly username?: string, - readonly nameRenderer?: { + readonly username: string | null, + readonly nameRenderer: { readonly __typename: "PlainUserNameRenderer", - readonly __module_operation_NameRendererFragment?: any, - readonly __module_component_NameRendererFragment?: any, + readonly __module_operation_NameRendererFragment: any | null, + readonly __module_component_NameRendererFragment: any | null, } | Local3DPayload<"NameRendererFragment", { readonly __typename: "PlainUserNameRenderer", }> | { readonly __typename: "MarkdownUserNameRenderer", - readonly __module_operation_NameRendererFragment?: any, - readonly __module_component_NameRendererFragment?: any, + readonly __module_operation_NameRendererFragment: any | null, + readonly __module_component_NameRendererFragment: any | null, } | Local3DPayload<"NameRendererFragment", { readonly __typename: "MarkdownUserNameRenderer", }> | { readonly __typename: string - }, + } | null, } | { readonly __typename: string, readonly id: string, - }, - readonly viewer?: { - readonly actor?: { + } | null, + readonly viewer: { + readonly actor: { readonly __typename: "User", readonly id: string, - readonly name?: string, - readonly nameRenderer?: { + readonly name: string | null, + readonly nameRenderer: { readonly __typename: "PlainUserNameRenderer", - readonly __module_operation_AnotherNameRendererFragment?: any, - readonly __module_component_AnotherNameRendererFragment?: any, + readonly __module_operation_AnotherNameRendererFragment: any | null, + readonly __module_component_AnotherNameRendererFragment: any | null, } | Local3DPayload<"AnotherNameRendererFragment", { readonly __typename: "PlainUserNameRenderer", }> | { readonly __typename: "MarkdownUserNameRenderer", - readonly __module_operation_AnotherNameRendererFragment?: any, - readonly __module_component_AnotherNameRendererFragment?: any, + readonly __module_operation_AnotherNameRendererFragment: any | null, + readonly __module_component_AnotherNameRendererFragment: any | null, } | Local3DPayload<"AnotherNameRendererFragment", { readonly __typename: "MarkdownUserNameRenderer", }> | { readonly __typename: string - }, + } | null, } | { readonly __typename: string, readonly id: string, - } - }, + } | null + } | null, }; export type Test = { variables: TestVariables, @@ -134,12 +134,12 @@ export type Test = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type AnotherNameRendererFragment = { - readonly name?: string, - readonly nameRenderer?: { - readonly __fragmentPropName?: string, - readonly __module_component?: string, + readonly name: string | null, + readonly nameRenderer: { + readonly __fragmentPropName?: string | null, + readonly __module_component?: string | null, readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, - }, + } | null, readonly " $refType": FragmentRefs<"AnotherNameRendererFragment">, }; export type AnotherNameRendererFragment$data = AnotherNameRendererFragment; @@ -150,10 +150,10 @@ export type AnotherNameRendererFragment$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type MarkdownUserNameRenderer_name = { - readonly markdown?: string, - readonly data?: { - readonly markup?: string - }, + readonly markdown: string | null, + readonly data: { + readonly markup: string | null + } | null, readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">, }; export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; @@ -165,11 +165,11 @@ export type MarkdownUserNameRenderer_name$key = { import { FragmentRefs } from "relay-runtime"; export type NameRendererFragment = { readonly id: string, - readonly nameRenderer?: { - readonly __fragmentPropName?: string, - readonly __module_component?: string, + readonly nameRenderer: { + readonly __fragmentPropName?: string | null, + readonly __module_component?: string | null, readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, - }, + } | null, readonly " $refType": FragmentRefs<"NameRendererFragment">, }; export type NameRendererFragment$data = NameRendererFragment; @@ -180,10 +180,10 @@ export type NameRendererFragment$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type PlainUserNameRenderer_name = { - readonly plaintext?: string, - readonly data?: { - readonly text?: string - }, + readonly plaintext: string | null, + readonly data: { + readonly text: string | null + } | null, readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">, }; export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected index ec8570030cf07..ee0bae98d057e 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected @@ -21,24 +21,24 @@ export type ExampleQueryVariables = { condition: boolean, }; export type ExampleQueryResponse = { - readonly node?: { + readonly node: { readonly " $fragmentRefs": FragmentRefs<"FriendFragment"> - } + } | null }; export type ExampleQueryRawResponse = { - readonly node?: { + readonly node: { readonly __typename: "User", readonly id: string, - readonly name?: string, - readonly lastName?: string, - readonly feedback?: { + readonly name: string | null, + readonly lastName: string | null, + readonly feedback: { readonly id: string, - readonly name?: string, - }, + readonly name: string | null, + } | null, } | { readonly __typename: string, readonly id: string, - } + } | null }; export type ExampleQuery = { variables: ExampleQueryVariables, @@ -48,12 +48,12 @@ export type ExampleQuery = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type FriendFragment = { - readonly name?: string, - readonly lastName?: string, + readonly name?: string | null, + readonly lastName?: string | null, readonly feedback?: { readonly id: string, - readonly name?: string, - }, + readonly name: string | null, + } | null, readonly " $refType": FragmentRefs<"FriendFragment">, }; export type FriendFragment$data = FriendFragment; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected index 6965ab56cbd15..50c980ed33975 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected @@ -26,20 +26,20 @@ export type ExampleQueryVariables = { id: string }; export type ExampleQueryResponse = { - readonly node?: { - readonly username?: string, + readonly node: { + readonly username: string | null, readonly friends?: { - readonly count?: number - }, + readonly count: number | null + } | null, readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, - } + } | null }; export type ExampleQueryRawResponse = { - readonly node?: { + readonly node: { readonly __typename: string, - readonly username?: string, + readonly username: string | null, readonly id: string, - } + } | null }; export type ExampleQuery = { variables: ExampleQueryVariables, @@ -49,12 +49,12 @@ export type ExampleQuery = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type FriendFragment = { - readonly name?: string, - readonly lastName?: string, + readonly name?: string | null, + readonly lastName?: string | null, readonly feedback?: { readonly id: string, - readonly name?: string, - }, + readonly name: string | null, + } | null, readonly " $refType": FragmentRefs<"FriendFragment">, }; export type FriendFragment$data = FriendFragment; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream-connection.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream-connection.expected index b2d2ba205483f..82ff2bfe6d861 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream-connection.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream-connection.expected @@ -19,46 +19,46 @@ query TestDefer @raw_response_type { ==================================== OUTPUT =================================== export type TestDeferVariables = {}; export type TestDeferResponse = { - readonly node?: { - readonly name?: string, + readonly node: { + readonly name?: string | null, readonly friends?: { - readonly edges?: ReadonlyArray<{ - readonly node?: { - readonly actor?: { - readonly name?: string - } - } - } | null> - }, - } + readonly edges: ReadonlyArray<{ + readonly node: { + readonly actor: { + readonly name: string | null + } | null + } | null + } | null> | null + } | null, + } | null }; export type TestDeferRawResponse = { - readonly node?: { + readonly node: { readonly __typename: "User", readonly id: string, - readonly name?: string, - readonly friends?: { - readonly edges?: ReadonlyArray<{ - readonly node?: { - readonly actor?: { + readonly name: string | null, + readonly friends: { + readonly edges: ReadonlyArray<{ + readonly node: { + readonly actor: { readonly __typename: string, - readonly name?: string, + readonly name: string | null, readonly id: string, - }, + } | null, readonly id: string, readonly __typename: "User", - }, - readonly cursor?: string, - } | null>, - readonly pageInfo?: { - readonly endCursor?: string, - readonly hasNextPage?: boolean, - }, - }, + } | null, + readonly cursor: string | null, + } | null> | null, + readonly pageInfo: { + readonly endCursor: string | null, + readonly hasNextPage: boolean | null, + } | null, + } | null, } | { readonly __typename: string, readonly id: string, - } + } | null }; export type TestDefer = { variables: TestDeferVariables, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream.expected index cd61ba203e72e..02344516afaf4 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream.expected @@ -20,39 +20,39 @@ query TestStream @raw_response_type { ==================================== OUTPUT =================================== export type TestStreamVariables = {}; export type TestStreamResponse = { - readonly node?: { - readonly name?: string, + readonly node: { + readonly name?: string | null, readonly friends?: { - readonly edges?: ReadonlyArray<{ - readonly node?: { + readonly edges: ReadonlyArray<{ + readonly node: { readonly id: string - } - } | null> - }, - } + } | null + } | null> | null + } | null, + } | null }; export type TestStreamRawResponse = { - readonly node?: { + readonly node: { readonly __typename: "User", readonly id: string, - readonly name?: string, - readonly friends?: { - readonly edges?: ReadonlyArray<{ - readonly node?: { + readonly name: string | null, + readonly friends: { + readonly edges: ReadonlyArray<{ + readonly node: { readonly id: string, readonly __typename: "User", - }, - readonly cursor?: string, - } | null>, - readonly pageInfo?: { - readonly endCursor?: string, - readonly hasNextPage?: boolean, - }, - }, + } | null, + readonly cursor: string | null, + } | null> | null, + readonly pageInfo: { + readonly endCursor: string | null, + readonly hasNextPage: boolean | null, + } | null, + } | null, } | { readonly __typename: string, readonly id: string, - } + } | null }; export type TestStream = { variables: TestStreamVariables, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected index 9e3677ea79542..092edbff12056 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected @@ -12,9 +12,9 @@ export type RefetchableFragmentQueryVariables = { id: string }; export type RefetchableFragmentQueryResponse = { - readonly node?: { + readonly node: { readonly " $fragmentRefs": FragmentRefs<"RefetchableFragment"> - } + } | null }; export type RefetchableFragmentQuery = { variables: RefetchableFragmentQueryVariables, @@ -24,9 +24,9 @@ export type RefetchableFragmentQuery = { import { FragmentRefs } from "relay-runtime"; export type RefetchableFragment = { readonly id: string, - readonly fragAndField?: { - readonly uri?: string - }, + readonly fragAndField: { + readonly uri: string | null + } | null, readonly " $refType": FragmentRefs<"RefetchableFragment">, }; export type RefetchableFragment$data = RefetchableFragment; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected index 3cbb82c5651f3..b128236bbe478 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected @@ -12,9 +12,9 @@ export type FlowRefetchableFragmentQueryVariables = { id: string }; export type FlowRefetchableFragmentQueryResponse = { - readonly node?: { + readonly node: { readonly " $fragmentRefs": FragmentRefs<"FlowRefetchableFragment"> - } + } | null }; export type FlowRefetchableFragmentQuery = { variables: FlowRefetchableFragmentQueryVariables, @@ -24,7 +24,7 @@ export type FlowRefetchableFragmentQuery = { import { FragmentRefs } from "relay-runtime"; export type FlowRefetchableFragment = { readonly id: string, - readonly name?: string, + readonly name?: string | null, readonly " $refType": FragmentRefs<"FlowRefetchableFragment">, }; export type FlowRefetchableFragment$data = FlowRefetchableFragment; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected index 2a1961ecb3719..c227b16247911 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected @@ -32,12 +32,12 @@ export type RelayClientIDFieldQueryVariables = { }; export type RelayClientIDFieldQueryResponse = { readonly __id: string, - readonly me?: { + readonly me: { readonly __id: string, readonly __typename: string, readonly id: string, - }, - readonly node?: { + } | null, + readonly node: { readonly __id: string, readonly __typename: string, readonly id: string, @@ -47,10 +47,10 @@ export type RelayClientIDFieldQueryResponse = { readonly text?: { readonly __id: string, readonly __typename: string, - readonly text?: string, - }, - }, - }, + readonly text: string | null, + } | null, + } | null, + } | null, }; export type RelayClientIDFieldQuery = { variables: RelayClientIDFieldQueryVariables, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-fragment.expected index 01085feffc910..526785ee64ecb 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-fragment.expected @@ -6,7 +6,7 @@ fragment NonNullFragment on User { ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; export type NonNullFragment = { - readonly firstName?: string, + readonly firstName: string | null, readonly lastName: string, readonly " $refType": FragmentRefs<"NonNullFragment">, } | null; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected index 7a221a01c568c..408ec1c6dba57 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected @@ -9,11 +9,11 @@ fragment NonNullFragment on User { ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; export type NonNullFragment = { - readonly firstName?: string, - readonly screennames?: ReadonlyArray<{ - readonly name?: string, + readonly firstName: string | null, + readonly screennames: ReadonlyArray<{ + readonly name: string | null, readonly service: string, - } | null>, + } | null> | null, readonly " $refType": FragmentRefs<"NonNullFragment">, }; export type NonNullFragment$data = NonNullFragment; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-query.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-query.expected index 4941f6846908c..e631795abe1fd 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-query.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-query.expected @@ -9,7 +9,7 @@ query FooQuery { export type FooQueryVariables = {}; export type FooQueryResponse = { readonly me: { - readonly firstName?: string, + readonly firstName: string | null, readonly lastName: string, } } | null; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-up-to-mutation-response.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-up-to-mutation-response.expected index 16d78bc4616fa..b222fb5b789aa 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-up-to-mutation-response.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-up-to-mutation-response.expected @@ -8,15 +8,15 @@ mutation CommentCreateMutation($input: CommentCreateInput!) { } ==================================== OUTPUT =================================== export type CommentCreateInput = { - clientMutationId?: string, - feedbackId?: string, - feedback?: CommentfeedbackFeedback, + clientMutationId?: string | null, + feedbackId?: string | null, + feedback?: CommentfeedbackFeedback | null, }; export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment + comment?: FeedbackcommentComment | null }; export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback + feedback?: CommentfeedbackFeedback | null }; export type CommentCreateMutationVariables = { input: CommentCreateInput diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected index 129597e168d00..8a3058c66ddb5 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected @@ -32,8 +32,8 @@ import { FragmentRefs } from "relay-runtime"; export type Bar = { readonly name?: string, readonly body?: { - readonly text?: string - }, + readonly text: string | null + } | null, readonly " $refType": FragmentRefs<"Bar">, } | null; export type Bar$data = Bar; @@ -49,9 +49,9 @@ export type Foo = { readonly " $refType": FragmentRefs<"Foo">, } | { readonly __typename: "Comment", - readonly body?: { - readonly text?: string - }, + readonly body: { + readonly text: string | null + } | null, readonly " $refType": FragmentRefs<"Foo">, } | { // This will never be '%other', but we need some diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-raw-response-type.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-raw-response-type.expected index faa9095c4b521..7429fe51144c0 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-raw-response-type.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-raw-response-type.expected @@ -14,10 +14,10 @@ export type MyQueryResponse = { } } | null; export type MyQueryRawResponse = { - readonly me?: { + readonly me: { readonly id: string, - readonly name?: string, - } + readonly name: string | null, + } | null }; export type MyQuery = { variables: MyQueryVariables, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected index 382159403fc18..e5d0421c64c03 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected @@ -6,7 +6,7 @@ fragment NonNullFragment on User { ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; export type NonNullFragment = { - readonly firstName?: string, + readonly firstName: string | null, readonly lastName: string, readonly " $refType": FragmentRefs<"NonNullFragment">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-query.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-query.expected index 7614bb7a98d48..60509d2802b1e 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-query.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-query.expected @@ -9,8 +9,8 @@ query FooQuery { export type FooQueryVariables = {}; export type FooQueryResponse = { readonly me: { - readonly firstName?: string, - readonly lastName?: string, + readonly firstName: string | null, + readonly lastName: string | null, } }; export type FooQuery = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throws-nested.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throws-nested.expected index 59d3f5ff9d45f..fc4ab910867c0 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throws-nested.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throws-nested.expected @@ -8,10 +8,10 @@ query FooQuery { ==================================== OUTPUT =================================== export type FooQueryVariables = {}; export type FooQueryResponse = { - readonly me?: { - readonly firstName?: string, + readonly me: { + readonly firstName: string | null, readonly lastName: string, - } + } | null }; export type FooQuery = { variables: FooQueryVariables, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required.expected index 423db27687a04..0167018244b99 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required.expected @@ -8,10 +8,10 @@ query FooQuery { ==================================== OUTPUT =================================== export type FooQueryVariables = {}; export type FooQueryResponse = { - readonly me?: { - readonly firstName?: string, + readonly me: { + readonly firstName: string | null, readonly lastName: string, - } + } | null }; export type FooQuery = { variables: FooQueryVariables, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected index fc95c9861a479..402317637da1c 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected @@ -29,9 +29,9 @@ export type ExampleQueryVariables = { id: string }; export type ExampleQueryResponse = { - readonly node?: { + readonly node: { readonly id: string - } + } | null }; export type ExampleQuery = { variables: ExampleQueryVariables, @@ -39,25 +39,25 @@ export type ExampleQuery = { }; ------------------------------------------------------------------------------- export type CommentCreateInput = { - clientMutationId?: string, - feedbackId?: string, - feedback?: CommentfeedbackFeedback, + clientMutationId?: string | null, + feedbackId?: string | null, + feedback?: CommentfeedbackFeedback | null, }; export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment + comment?: FeedbackcommentComment | null }; export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback + feedback?: CommentfeedbackFeedback | null }; export type TestMutationVariables = { input: CommentCreateInput }; export type TestMutationResponse = { - readonly commentCreate?: { - readonly comment?: { + readonly commentCreate: { + readonly comment: { readonly id: string - } - } + } | null + } | null }; export type TestMutation = { variables: TestMutationVariables, @@ -65,18 +65,18 @@ export type TestMutation = { }; ------------------------------------------------------------------------------- export type FeedbackLikeInput = { - clientMutationId?: string, - feedbackId?: string, + clientMutationId?: string | null, + feedbackId?: string | null, }; export type TestSubscriptionVariables = { - input?: FeedbackLikeInput + input?: FeedbackLikeInput | null }; export type TestSubscriptionResponse = { - readonly feedbackLikeSubscribe?: { - readonly feedback?: { + readonly feedbackLikeSubscribe: { + readonly feedback: { readonly id: string - } - } + } | null + } | null }; export type TestSubscription = { variables: TestSubscriptionVariables, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/scalar-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/scalar-field.expected index b828e7a745e11..601c3b4878f21 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/scalar-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/scalar-field.expected @@ -17,16 +17,16 @@ export type PersonalityTraits = "CHEERFUL" | "DERISIVE" | "HELPFUL" | "SNARKY" | import { FragmentRefs } from "relay-runtime"; export type ScalarField = { readonly id: string, - readonly name?: string, - readonly websites?: ReadonlyArray, - readonly traits?: ReadonlyArray, - readonly aliasedLinkedField?: { - readonly aliasedField?: number - }, - readonly screennames?: ReadonlyArray<{ - readonly name?: string, - readonly service?: string, - } | null>, + readonly name: string | null, + readonly websites: ReadonlyArray | null, + readonly traits: ReadonlyArray | null, + readonly aliasedLinkedField: { + readonly aliasedField: number | null + } | null, + readonly screennames: ReadonlyArray<{ + readonly name: string | null, + readonly service: string | null, + } | null> | null, readonly " $refType": FragmentRefs<"ScalarField">, }; export type ScalarField$data = ScalarField; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/simple.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/simple.expected index 05dff62385416..5153945130434 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/simple.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/simple.expected @@ -10,12 +10,12 @@ fragment LinkedField on User { ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; export type LinkedField = { - readonly name?: string, - readonly profilePicture?: { - readonly uri?: string, - readonly width?: number, - readonly height?: number, - }, + readonly name: string | null, + readonly profilePicture: { + readonly uri: string | null, + readonly width: number | null, + readonly height: number | null, + } | null, readonly " $refType": FragmentRefs<"LinkedField">, }; export type LinkedField$data = LinkedField; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected index fe8e0e296b3c0..29ebfa9a2c8f7 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected @@ -18,22 +18,22 @@ fragment TypenameInsideWithOverlappingFields on Viewer { ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; export type TypenameInsideWithOverlappingFields = { - readonly actor?: { + readonly actor: { readonly __typename: "Page", readonly id: string, - readonly name?: string, + readonly name: string | null, } | { readonly __typename: "User", readonly id: string, - readonly name?: string, - readonly profile_picture?: { - readonly uri?: string - }, + readonly name: string | null, + readonly profile_picture: { + readonly uri: string | null + } | null, } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly __typename: "%other" - }, + } | null, readonly " $refType": FragmentRefs<"TypenameInsideWithOverlappingFields">, }; export type TypenameInsideWithOverlappingFields$data = TypenameInsideWithOverlappingFields; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected index 876aa18770c94..457860be7f29a 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected @@ -83,11 +83,11 @@ fragment TypenameAliases on Actor { import { FragmentRefs } from "relay-runtime"; export type TypenameAlias = { readonly _typeAlias: "User", - readonly firstName?: string, + readonly firstName: string | null, readonly " $refType": FragmentRefs<"TypenameAlias">, } | { readonly _typeAlias: "Page", - readonly username?: string, + readonly username: string | null, readonly " $refType": FragmentRefs<"TypenameAlias">, } | { // This will never be '%other', but we need some @@ -105,12 +105,12 @@ import { FragmentRefs } from "relay-runtime"; export type TypenameAliases = { readonly _typeAlias1: "User", readonly _typeAlias2: "User", - readonly firstName?: string, + readonly firstName: string | null, readonly " $refType": FragmentRefs<"TypenameAliases">, } | { readonly _typeAlias1: "Page", readonly _typeAlias2: "Page", - readonly username?: string, + readonly username: string | null, readonly " $refType": FragmentRefs<"TypenameAliases">, } | { // This will never be '%other', but we need some @@ -130,11 +130,11 @@ export type TypenameAliases$key = { import { FragmentRefs } from "relay-runtime"; export type TypenameInside = { readonly __typename: "User", - readonly firstName?: string, + readonly firstName: string | null, readonly " $refType": FragmentRefs<"TypenameInside">, } | { readonly __typename: "Page", - readonly username?: string, + readonly username: string | null, readonly " $refType": FragmentRefs<"TypenameInside">, } | { // This will never be '%other', but we need some @@ -151,11 +151,11 @@ export type TypenameInside$key = { import { FragmentRefs } from "relay-runtime"; export type TypenameOutside = { readonly __typename: "User", - readonly firstName?: string, + readonly firstName: string | null, readonly " $refType": FragmentRefs<"TypenameOutside">, } | { readonly __typename: "Page", - readonly username?: string, + readonly username: string | null, readonly " $refType": FragmentRefs<"TypenameOutside">, } | { // This will never be '%other', but we need some @@ -172,13 +172,13 @@ export type TypenameOutside$key = { import { FragmentRefs } from "relay-runtime"; export type TypenameOutsideWithAbstractType = { readonly __typename: string, - readonly username?: string, + readonly username?: string | null, readonly address?: { - readonly city?: string, - readonly country?: string, - readonly street?: string, - }, - readonly firstName?: string, + readonly city: string | null, + readonly country: string | null, + readonly street?: string | null, + } | null, + readonly firstName?: string | null, readonly " $refType": FragmentRefs<"TypenameOutsideWithAbstractType">, }; export type TypenameOutsideWithAbstractType$data = TypenameOutsideWithAbstractType; @@ -190,9 +190,9 @@ export type TypenameOutsideWithAbstractType$key = { import { FragmentRefs } from "relay-runtime"; export type TypenameWithCommonSelections = { readonly __typename: string, - readonly name?: string, - readonly firstName?: string, - readonly username?: string, + readonly name: string | null, + readonly firstName?: string | null, + readonly username?: string | null, readonly " $refType": FragmentRefs<"TypenameWithCommonSelections">, }; export type TypenameWithCommonSelections$data = TypenameWithCommonSelections; @@ -203,7 +203,7 @@ export type TypenameWithCommonSelections$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type TypenameWithoutSpreads = { - readonly firstName?: string, + readonly firstName: string | null, readonly __typename: "User", readonly " $refType": FragmentRefs<"TypenameWithoutSpreads">, }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected index 55439cfd18e5c..f6ec1b48338e3 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected @@ -28,8 +28,8 @@ fragment AnotherRecursiveFragment on Image { ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; export type AnotherRecursiveFragment = { - readonly uri?: string, - readonly height?: number, + readonly uri: string | null, + readonly height: number | null, readonly " $refType": FragmentRefs<"AnotherRecursiveFragment">, }; export type AnotherRecursiveFragment$data = AnotherRecursiveFragment; @@ -40,8 +40,8 @@ export type AnotherRecursiveFragment$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type PhotoFragment = { - readonly uri?: string, - readonly width?: number, + readonly uri: string | null, + readonly width: number | null, readonly " $refType": FragmentRefs<"PhotoFragment">, }; export type PhotoFragment$data = PhotoFragment; @@ -52,8 +52,8 @@ export type PhotoFragment$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type RecursiveFragment = { - readonly uri?: string, - readonly width?: number, + readonly uri: string | null, + readonly width: number | null, }; export type RecursiveFragment$data = RecursiveFragment; export type RecursiveFragment$key = { @@ -63,12 +63,12 @@ export type RecursiveFragment$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type UserProfile = { - readonly profilePicture?: { - readonly uri?: string, - readonly width?: number, - readonly height?: number, + readonly profilePicture: { + readonly uri: string | null, + readonly width: number | null, + readonly height: number | null, readonly " $fragmentRefs": FragmentRefs<"PhotoFragment">, - }, + } | null, readonly " $refType": FragmentRefs<"UserProfile">, }; export type UserProfile$data = UserProfile; From 7eaef79104cf6b8882d453786ec5456d4f89eac7 Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Fri, 30 Oct 2020 22:16:09 +0100 Subject: [PATCH 10/41] Rename AST::OtherEnumValue to AST::OtherTypename to reflect usage more accurately. --- compiler/crates/relay-typegen/src/flow.rs | 6 +++--- compiler/crates/relay-typegen/src/lib.rs | 2 +- compiler/crates/relay-typegen/src/typescript.rs | 6 +++--- compiler/crates/relay-typegen/src/writer.rs | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/compiler/crates/relay-typegen/src/flow.rs b/compiler/crates/relay-typegen/src/flow.rs index 36793e65f80c7..fdd6ad7289a23 100644 --- a/compiler/crates/relay-typegen/src/flow.rs +++ b/compiler/crates/relay-typegen/src/flow.rs @@ -33,7 +33,7 @@ impl FlowPrinter { AST::Any => write!(writer, "any"), AST::String => write!(writer, "string"), AST::StringLiteral(literal) => self.write_string_literal(writer, *literal), - AST::OtherEnumValue => self.write_other_string(writer), + AST::OtherTypename => self.write_other_string(writer), AST::Number => write!(writer, "number"), AST::Boolean => write!(writer, "boolean"), AST::Identifier(identifier) => write!(writer, "{}", identifier), @@ -167,7 +167,7 @@ impl FlowPrinter { writeln!(writer, ",")?; continue; } - if let AST::OtherEnumValue = prop.value { + if let AST::OtherTypename = prop.value { writeln!(writer, "// This will never be '%other', but we need some")?; self.write_indentation(writer)?; writeln!( @@ -453,7 +453,7 @@ mod tests { key: "with_comment".intern(), optional: false, read_only: false, - value: AST::OtherEnumValue, + value: AST::OtherTypename, },])), r#"{| // This will never be '%other', but we need some diff --git a/compiler/crates/relay-typegen/src/lib.rs b/compiler/crates/relay-typegen/src/lib.rs index e3f56552169f4..cfa8161c649ce 100644 --- a/compiler/crates/relay-typegen/src/lib.rs +++ b/compiler/crates/relay-typegen/src/lib.rs @@ -693,7 +693,7 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { key: *typename_alias, read_only: true, optional: false, - value: AST::OtherEnumValue, + value: AST::OtherTypename, }) .collect(), ); diff --git a/compiler/crates/relay-typegen/src/typescript.rs b/compiler/crates/relay-typegen/src/typescript.rs index 702e02e1f6bc6..820afb8509efb 100644 --- a/compiler/crates/relay-typegen/src/typescript.rs +++ b/compiler/crates/relay-typegen/src/typescript.rs @@ -43,7 +43,7 @@ impl TypeScriptPrinter { AST::Any => write!(writer, "any"), AST::String => write!(writer, "string"), AST::StringLiteral(literal) => self.write_string_literal(writer, *literal), - AST::OtherEnumValue => self.write_other_string(writer), + AST::OtherTypename => self.write_other_string(writer), AST::Number => write!(writer, "number"), AST::Boolean => write!(writer, "boolean"), AST::Identifier(identifier) => write!(writer, "{}", identifier), @@ -166,7 +166,7 @@ impl TypeScriptPrinter { } self.write_indentation(writer)?; - if let AST::OtherEnumValue = prop.value { + if let AST::OtherTypename = prop.value { writeln!(writer, "// This will never be '%other', but we need some")?; self.write_indentation(writer)?; writeln!( @@ -507,7 +507,7 @@ mod tests { key: "with_comment".intern(), optional: false, read_only: false, - value: AST::OtherEnumValue, + value: AST::OtherTypename, },])), r#"{ // This will never be '%other', but we need some diff --git a/compiler/crates/relay-typegen/src/writer.rs b/compiler/crates/relay-typegen/src/writer.rs index 5179b5f39f5b2..33f839283d1c3 100644 --- a/compiler/crates/relay-typegen/src/writer.rs +++ b/compiler/crates/relay-typegen/src/writer.rs @@ -21,7 +21,7 @@ pub enum AST { String, StringLiteral(StringKey), /// Prints as `"%other" with a comment explaining open enums. - OtherEnumValue, + OtherTypename, Local3DPayload(StringKey, Box), ExactObject(Vec), InexactObject(Vec), From 6483808c9724f82384b0437191e154844f25485f Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Fri, 30 Oct 2020 22:40:10 +0100 Subject: [PATCH 11/41] Create AST for type definition when not using haste. --- compiler/crates/relay-typegen/src/flow.rs | 10 ++++++++++ compiler/crates/relay-typegen/src/lib.rs | 5 ++++- compiler/crates/relay-typegen/src/typescript.rs | 10 ++++++++++ compiler/crates/relay-typegen/src/writer.rs | 1 + 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/compiler/crates/relay-typegen/src/flow.rs b/compiler/crates/relay-typegen/src/flow.rs index fdd6ad7289a23..203dadf178041 100644 --- a/compiler/crates/relay-typegen/src/flow.rs +++ b/compiler/crates/relay-typegen/src/flow.rs @@ -47,6 +47,7 @@ impl FlowPrinter { AST::Local3DPayload(document_name, selections) => { self.write_local_3d_payload(writer, *document_name, selections) } + AST::DefineType(name, value) => self.write_type_definition(writer, name, value), AST::ImportType(types, from) => self.write_import_type(writer, types, from), AST::DeclareExportFragment(alias, value) => { let default_value = "FragmentReference".intern(); @@ -254,6 +255,15 @@ impl FlowPrinter { write!(writer, "export type {} = {};", name, self.write_ast(value)) } + fn write_type_definition( + &mut self, + writer: &mut dyn Write, + name: &StringKey, + value: &Box, + ) -> Result { + write!(writer, "type {} = {};", name, self.write_ast(value)) + } + fn write_export_list(&mut self, writer: &mut dyn Write, names: &Vec) -> Result { write!( writer, diff --git a/compiler/crates/relay-typegen/src/lib.rs b/compiler/crates/relay-typegen/src/lib.rs index f3d0440e45170..e5384587234b0 100644 --- a/compiler/crates/relay-typegen/src/lib.rs +++ b/compiler/crates/relay-typegen/src/lib.rs @@ -1049,7 +1049,10 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { // importTypes([fragmentTypeName], './' + usedFragment + '.graphql'), // ); } else { - writeln!(self.result, "type {} = any;", fragment_type_name)?; + write_ast!( + self, + AST::DefineType(fragment_type_name, Box::new(AST::Any)) + )?; } } } diff --git a/compiler/crates/relay-typegen/src/typescript.rs b/compiler/crates/relay-typegen/src/typescript.rs index 820afb8509efb..fac10637c6423 100644 --- a/compiler/crates/relay-typegen/src/typescript.rs +++ b/compiler/crates/relay-typegen/src/typescript.rs @@ -57,6 +57,7 @@ impl TypeScriptPrinter { AST::Local3DPayload(document_name, selections) => { self.write_local_3d_payload(writer, *document_name, selections) } + AST::DefineType(name, value) => self.write_type_definition(writer, name, value), AST::ImportType(types, from) => self.write_import_type(writer, types, from), AST::ExportTypeEquals(name, value) => { self.write_export_type_equals(writer, name, value) @@ -262,6 +263,15 @@ impl TypeScriptPrinter { ) } + fn write_type_definition( + &mut self, + writer: &mut dyn Write, + name: &StringKey, + value: &Box, + ) -> Result { + write!(writer, "type {} = {};", name, self.write_ast(value)) + } + fn write_export_type_equals( &mut self, writer: &mut dyn Write, diff --git a/compiler/crates/relay-typegen/src/writer.rs b/compiler/crates/relay-typegen/src/writer.rs index 33f839283d1c3..74c595777bedc 100644 --- a/compiler/crates/relay-typegen/src/writer.rs +++ b/compiler/crates/relay-typegen/src/writer.rs @@ -28,6 +28,7 @@ pub enum AST { Number, Boolean, Any, + DefineType(StringKey, Box), FragmentReference(Vec), ImportType(Vec, StringKey), ImportFragmentType(Vec, StringKey), From f0f3ed8460dba5ee9e931ba408a2baaa7e231940 Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Sat, 31 Oct 2020 15:34:02 +0100 Subject: [PATCH 12/41] Don't use relative import path in haste mode. --- compiler/crates/relay-typegen/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/crates/relay-typegen/src/lib.rs b/compiler/crates/relay-typegen/src/lib.rs index e5384587234b0..e0edc8f4be5ab 100644 --- a/compiler/crates/relay-typegen/src/lib.rs +++ b/compiler/crates/relay-typegen/src/lib.rs @@ -1041,7 +1041,7 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { self, AST::ImportFragmentType( vec![fragment_type_name], - format!("./{}.graphql", used_fragment).intern() + format!("{}.graphql", used_fragment).intern() ) )?; // } else if (state.useSingleArtifactDirectory) { From b0c97bf71e3c3c8710865f6479045d760fdc1060 Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Sat, 31 Oct 2020 15:31:35 +0100 Subject: [PATCH 13/41] Allow opting out of future proof enums. --- compiler/crates/relay-typegen/src/config.rs | 25 ++++++++++++++++++++- compiler/crates/relay-typegen/src/lib.rs | 4 +++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/compiler/crates/relay-typegen/src/config.rs b/compiler/crates/relay-typegen/src/config.rs index 1f4d31d758640..5bb7f8f0be50d 100644 --- a/compiler/crates/relay-typegen/src/config.rs +++ b/compiler/crates/relay-typegen/src/config.rs @@ -22,7 +22,7 @@ impl Default for TypegenLanguage { } } -#[derive(Debug, Deserialize, Default)] +#[derive(Debug, Deserialize)] #[serde(deny_unknown_fields, rename_all = "camelCase")] pub struct TypegenConfig { /// The desired output language, "flow" or "typescript". @@ -49,6 +49,10 @@ pub struct TypegenConfig { #[serde(default)] pub use_import_type_syntax: bool, + /// Whether to future proof enums by including "%future added value" as a possible value. + #[serde(default = "default_future_proofness")] + pub future_proof_enums: bool, + /// A map from GraphQL scalar types to a custom JS type, example: /// { "Url": "String" } #[serde(default)] @@ -59,3 +63,22 @@ pub struct TypegenConfig { #[serde(default)] pub haste: bool, } + +// Custom impl for Default to set future proofness to true when using Default::default(). +impl Default for TypegenConfig { + fn default() -> Self { + Self { + language: TypegenLanguage::default(), + enum_module_suffix: None, + optional_input_fields: vec![], + use_import_type_syntax: false, + future_proof_enums: default_future_proofness(), + custom_scalar_types: FnvHashMap::default(), + haste: false, + } + } +} + +fn default_future_proofness() -> bool { + true +} diff --git a/compiler/crates/relay-typegen/src/lib.rs b/compiler/crates/relay-typegen/src/lib.rs index e0edc8f4be5ab..94e0da14d754f 100644 --- a/compiler/crates/relay-typegen/src/lib.rs +++ b/compiler/crates/relay-typegen/src/lib.rs @@ -1095,7 +1095,9 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { .iter() .map(|enum_value| AST::StringLiteral(enum_value.value)) .collect(); - members.push(AST::StringLiteral(*FUTURE_ENUM_VALUE)); + if self.typegen_config.future_proof_enums { + members.push(AST::StringLiteral(*FUTURE_ENUM_VALUE)); + } write_ast!( self, AST::ExportTypeEquals(enum_type.name, Box::from(AST::Union(members))) From 0e04a8683fd39d32266179924aac080ba263354d Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Sun, 1 Nov 2020 16:53:11 +0100 Subject: [PATCH 14/41] Add better support for abstract types (unions and interfaces), using unions and intersections in the output. --- compiler/crates/relay-typegen/src/config.rs | 5 + compiler/crates/relay-typegen/src/lib.rs | 271 +++++++++++++++----- compiler/crates/schema/src/definitions.rs | 20 ++ 3 files changed, 230 insertions(+), 66 deletions(-) diff --git a/compiler/crates/relay-typegen/src/config.rs b/compiler/crates/relay-typegen/src/config.rs index 5bb7f8f0be50d..110bea2d5cb79 100644 --- a/compiler/crates/relay-typegen/src/config.rs +++ b/compiler/crates/relay-typegen/src/config.rs @@ -53,6 +53,10 @@ pub struct TypegenConfig { #[serde(default = "default_future_proofness")] pub future_proof_enums: bool, + /// Whether to future proof union and interface types by including "%other" as a possible type. + #[serde(default = "default_future_proofness")] + pub future_proof_abstract_types: bool, + /// A map from GraphQL scalar types to a custom JS type, example: /// { "Url": "String" } #[serde(default)] @@ -72,6 +76,7 @@ impl Default for TypegenConfig { enum_module_suffix: None, optional_input_fields: vec![], use_import_type_syntax: false, + future_proof_abstract_types: default_future_proofness(), future_proof_enums: default_future_proofness(), custom_scalar_types: FnvHashMap::default(), haste: false, diff --git a/compiler/crates/relay-typegen/src/lib.rs b/compiler/crates/relay-typegen/src/lib.rs index 94e0da14d754f..a87d9430727bc 100644 --- a/compiler/crates/relay-typegen/src/lib.rs +++ b/compiler/crates/relay-typegen/src/lib.rs @@ -32,7 +32,7 @@ use relay_transforms::{ CHILDREN_CAN_BUBBLE_METADATA_KEY, CLIENT_EXTENSION_DIRECTIVE_NAME, MATCH_CONSTANTS, REQUIRED_METADATA_KEY, }; -use schema::{EnumID, ScalarID, Schema, Type, TypeReference}; +use schema::{EnumID, Object, ScalarID, Schema, Type, TypeReference, Union}; use std::fmt::{Result, Write}; use std::hash::Hash; use writer::{Prop, AST, SPREAD_KEY}; @@ -149,7 +149,8 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { let input_variables_type = self.generate_input_variables_type(typegen_operation); let selections = self.visit_selections(&typegen_operation.selections); - let mut response_type = self.selections_to_babel(selections, false, None); + let mut response_type = + self.selections_to_babel(Some(typegen_operation.type_), selections, false, None); response_type = match typegen_operation .directives @@ -286,6 +287,7 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { let unmasked = RelayDirective::is_unmasked_fragment_definition(&node); let base_type = self.selections_to_babel( + Some(node.type_condition), selections, unmasked, if unmasked { @@ -620,19 +622,36 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { fn selections_to_babel( &mut self, + node_type: Option, selections: Vec, unmasked: bool, fragment_type_name: Option, ) -> AST { let mut base_fields: TypeSelectionMap = Default::default(); + let mut base_fragments: IndexMap<_, _> = Default::default(); let mut by_concrete_type: IndexMap> = Default::default(); for selection in selections { - if let Some(concrete_type) = selection.concrete_type { + // If the concrete type matches the node type, we can add this to the base fields + // and fragments instead. + let concrete_type = match (node_type, selection.concrete_type) { + (Some(node_type), Some(concrete_type)) => { + if node_type.eq(&concrete_type) { + None + } else { + Some(concrete_type) + } + } + (None, Some(concrete_type)) => Some(concrete_type), + _ => None, + }; + if let Some(concrete_type) = concrete_type { by_concrete_type .entry(concrete_type) .or_insert_with(Vec::new) .push(selection); + } else if let Some(ref_name) = selection.ref_ { + base_fragments.insert(ref_name, selection); } else { let key = TypeSelectionKey { key: selection.key, @@ -650,26 +669,57 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { } } - let mut types: Vec> = Vec::new(); - #[allow(clippy::ptr_arg)] fn has_typename_selection(selections: &Vec) -> bool { selections.iter().any(TypeSelection::is_typename) } - if !by_concrete_type.is_empty() - && base_fields.values().all(TypeSelection::is_typename) + #[allow(clippy::ptr_arg)] + fn only_selects_fragments(selections: &Vec) -> bool { + selections.iter().all(TypeSelection::is_fragment) + } + + // If there are any concrete types that only select fragments, move those + // fragments to the base fragments instead. + let by_concrete_type = by_concrete_type + .into_iter() + .filter_map(|(concrete_type, selections)| { + if only_selects_fragments(&selections) { + for selection in selections { + // Note that only_selects_fragments ensures that ref_.is_some(). + base_fragments.insert(selection.ref_.unwrap(), selection.clone()); + } + + None + } else { + Some((concrete_type, selections)) + } + }) + .collect::>(); + + let mut concrete_types: Vec<_> = Vec::new(); + let type_fields_present_for_union = !by_concrete_type.is_empty() && (base_fields.values().any(TypeSelection::is_typename) - || by_concrete_type.values().all(has_typename_selection)) - { + || by_concrete_type.values().all(has_typename_selection)); + + if type_fields_present_for_union { let mut typename_aliases = IndexSet::new(); - for (concrete_type, selections) in by_concrete_type { - types.push( + for (concrete_type, selections) in &by_concrete_type { + let selection_names = selections + .iter() + .map(|selection| selection.schema_name) + .collect::>(); + + concrete_types.push( group_refs( base_fields .iter() - .map(|(_, v)| v.clone()) - .chain(selections.into_iter()) + .map(|(_, v)| v) + .filter(|v| { + v.is_typename() && !selection_names.contains(&v.schema_name) + }) + .cloned() + .chain(selections.clone().into_iter()) .collect(), ) .into_iter() @@ -677,28 +727,79 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { if selection.is_typename() { typename_aliases.insert(selection.key); } - self.make_prop(selection, unmasked, Some(concrete_type)) + self.make_prop(selection, unmasked, Some(*concrete_type), None) }) .collect(), ); } - // It might be some other type then the listed concrete types. Ideally, we - // would set the type to diff(string, set of listed concrete types), but - // this doesn't exist in Flow at the time. - types.push( - typename_aliases - .iter() - .map(|typename_alias| Prop { - key: *typename_alias, - read_only: true, - optional: false, - value: AST::OtherTypename, - }) - .collect(), - ); - } else { - let mut selection_map = selections_to_map(hashmap_into_value_vec(base_fields), false); + // It might be some other type then the listed concrete types. We try to + // figure out which types remain here. + let possible_types_left: Option> = if let Some(node_type) = node_type { + if let Some(possible_types) = self.schema.get_possible_types(node_type) { + let types_seen = by_concrete_type + .keys() + .map(|type_| self.schema.get_type_name(*type_)) + .collect::>(); + Some( + possible_types + .into_iter() + .filter(|possible_type| !types_seen.contains(&possible_type.name)) + .collect(), + ) + } else { + None + } + } else { + None + }; + + if self.typegen_config.future_proof_abstract_types + || match &possible_types_left { + Some(types) => !types.is_empty(), + None => true, + } + { + concrete_types.push( + typename_aliases + .iter() + .map(|typename_alias| Prop { + key: *typename_alias, + read_only: true, + optional: false, + value: possible_types_left + .as_ref() + .map(|types| { + AST::Union( + types + .iter() + .map(|type_| AST::StringLiteral(type_.name)) + .chain( + // Would be nicer to chain() with iter::once or iter::empty, but then + // the if and else branch have incompatible return types. + std::iter::repeat(AST::OtherTypename).take( + if self + .typegen_config + .future_proof_abstract_types + { + 1 + } else { + 0 + }, + ), + ) + .collect(), + ) + }) + .unwrap_or(AST::OtherTypename), + }) + .collect(), + ); + } + } + + let mut selection_map = selections_to_map(hashmap_into_value_vec(base_fields), false); + if !type_fields_present_for_union { for concrete_type_selections in by_concrete_type.values() { selection_map = merge_selections( selection_map, @@ -715,46 +816,69 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { true, ) } - let selection_map_values = group_refs(hashmap_into_value_vec(selection_map)) - .into_iter() - .map(|sel| { - if sel.is_typename() && sel.concrete_type.is_some() { - self.make_prop( - TypeSelection { - conditional: false, - ..sel - }, - unmasked, - sel.concrete_type, - ) - } else { - self.make_prop(sel, unmasked, None) - } - }) - .collect(); - types.push(selection_map_values); } - AST::Union( - types - .into_iter() - .map(|mut props: Vec| { - if let Some(fragment_type_name) = fragment_type_name { - props.push(Prop { - key: *KEY_REF_TYPE, - optional: false, - read_only: true, - value: AST::FragmentReference(vec![fragment_type_name]), - }); - } - if unmasked { - AST::InexactObject(props) - } else { - AST::ExactObject(props) - } - }) + let mut base_type_props = group_refs( + base_fragments + .values() + .chain(selection_map.values()) + .filter(|selection| !type_fields_present_for_union || !selection.is_typename()) + .cloned() .collect(), ) + .into_iter() + .map(|selection| { + if selection.is_typename() + && (selection.concrete_type.is_some() + || matches!(node_type, Some(type_) if type_.is_union())) + { + self.make_prop( + TypeSelection { + conditional: false, + ..selection + }, + unmasked, + selection.concrete_type, + match node_type { + Some(Type::Union(union)) => Some(self.schema.union(union)), + _ => None, + }, + ) + } else { + self.make_prop(selection, unmasked, None, None) + } + }) + .collect::>(); + + if let Some(fragment_type_name) = fragment_type_name { + base_type_props.push(Prop { + key: *KEY_REF_TYPE, + optional: false, + read_only: true, + value: AST::FragmentReference(vec![fragment_type_name]), + }); + } + + let props_to_object = |props: Vec| -> AST { + if unmasked { + AST::InexactObject(props) + } else { + AST::ExactObject(props) + } + }; + + let base_type_props_not_empty = !base_type_props.is_empty(); + let base_type = props_to_object(base_type_props); + if concrete_types.is_empty() { + return base_type; + } + + let union_type = AST::Union(concrete_types.into_iter().map(props_to_object).collect()); + if base_type_props_not_empty { + AST::Intersection(vec![union_type, base_type]) + } else { + union_type + } } fn raw_response_selections_to_babel( @@ -843,6 +967,7 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { type_selection: TypeSelection, unmasked: bool, concrete_type: Option, + union_type: Option<&Union>, ) -> Prop { let TypeSelection { key, @@ -855,6 +980,7 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { } = type_selection; let value = if let Some(node_type) = node_type { let object_props = self.selections_to_babel( + Some(node_type.inner()), hashmap_into_value_vec(node_selections.unwrap()), unmasked, None, @@ -863,6 +989,15 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { } else if schema_name == Some(*KEY_TYPENAME) { if let Some(concrete_type) = concrete_type { AST::StringLiteral(self.schema.get_type_name(concrete_type)) + } else if let Some(union_type) = union_type { + AST::Union( + union_type + .members + .iter() + .map(|member| self.schema.object(*member)) + .map(|type_| AST::StringLiteral(type_.name)) + .collect(), + ) } else { value.unwrap() } @@ -1240,6 +1375,10 @@ impl TypeSelection { false } } + + fn is_fragment(&self) -> bool { + self.ref_.is_some() + } } #[derive(Eq, Hash, PartialEq, Clone, Copy, Debug)] diff --git a/compiler/crates/schema/src/definitions.rs b/compiler/crates/schema/src/definitions.rs index 9ab512d5bfade..1a615ba67f648 100644 --- a/compiler/crates/schema/src/definitions.rs +++ b/compiler/crates/schema/src/definitions.rs @@ -190,6 +190,26 @@ impl Schema { type_ == self.string_type.unwrap() } + pub fn get_possible_types(&self, type_: Type) -> Option> { + match type_ { + Type::Union(union) => Some( + self.union(union) + .members + .iter() + .map(|id| self.object(*id)) + .collect(), + ), + Type::Interface(interface) => Some( + self.interface(interface) + .implementing_objects + .iter() + .map(|id| self.object(*id)) + .collect(), + ), + _ => None, + } + } + fn write_type_string(&self, writer: &mut W, type_: &TypeReference) -> FormatResult { match type_ { TypeReference::Named(inner) => { From 7275cf7b17d0369331da414eec31c40bcdaba7ea Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Sun, 1 Nov 2020 16:54:13 +0100 Subject: [PATCH 15/41] Handle %other for unions, to be sure the accompanying comment is included. --- compiler/crates/relay-typegen/src/flow.rs | 2 +- compiler/crates/relay-typegen/src/typescript.rs | 2 +- compiler/crates/relay-typegen/src/writer.rs | 13 +++++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/compiler/crates/relay-typegen/src/flow.rs b/compiler/crates/relay-typegen/src/flow.rs index 203dadf178041..7bf5d438b8320 100644 --- a/compiler/crates/relay-typegen/src/flow.rs +++ b/compiler/crates/relay-typegen/src/flow.rs @@ -168,7 +168,7 @@ impl FlowPrinter { writeln!(writer, ",")?; continue; } - if let AST::OtherTypename = prop.value { + if prop.value.contains_other_typename() { writeln!(writer, "// This will never be '%other', but we need some")?; self.write_indentation(writer)?; writeln!( diff --git a/compiler/crates/relay-typegen/src/typescript.rs b/compiler/crates/relay-typegen/src/typescript.rs index fac10637c6423..12fa5e5a33657 100644 --- a/compiler/crates/relay-typegen/src/typescript.rs +++ b/compiler/crates/relay-typegen/src/typescript.rs @@ -167,7 +167,7 @@ impl TypeScriptPrinter { } self.write_indentation(writer)?; - if let AST::OtherTypename = prop.value { + if prop.value.contains_other_typename() { writeln!(writer, "// This will never be '%other', but we need some")?; self.write_indentation(writer)?; writeln!( diff --git a/compiler/crates/relay-typegen/src/writer.rs b/compiler/crates/relay-typegen/src/writer.rs index 74c595777bedc..44b5151fb0236 100644 --- a/compiler/crates/relay-typegen/src/writer.rs +++ b/compiler/crates/relay-typegen/src/writer.rs @@ -37,6 +37,19 @@ pub enum AST { ExportTypeEquals(StringKey, Box), } +impl AST { + pub fn contains_other_typename(&self) -> bool { + match self { + AST::Union(members) => members + .iter() + .any(|member| member.contains_other_typename()), + AST::Nullable(inner) => inner.contains_other_typename(), + AST::OtherTypename => true, + _ => false, + } + } +} + #[derive(Debug, Clone)] pub struct Prop { pub key: StringKey, From 75a9a266795b49b2804031e45cf1c8c545bfd73e Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Sun, 1 Nov 2020 16:54:26 +0100 Subject: [PATCH 16/41] Some suggestions from Clippy. --- compiler/crates/relay-typegen/src/flow.rs | 6 +++--- compiler/crates/relay-typegen/src/lib.rs | 2 +- compiler/crates/relay-typegen/src/typescript.rs | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/compiler/crates/relay-typegen/src/flow.rs b/compiler/crates/relay-typegen/src/flow.rs index 7bf5d438b8320..82547db2003e8 100644 --- a/compiler/crates/relay-typegen/src/flow.rs +++ b/compiler/crates/relay-typegen/src/flow.rs @@ -222,7 +222,7 @@ impl FlowPrinter { fn write_import_type( &mut self, writer: &mut dyn Write, - types: &Vec, + types: &[StringKey], from: &StringKey, ) -> Result { write!( @@ -259,12 +259,12 @@ impl FlowPrinter { &mut self, writer: &mut dyn Write, name: &StringKey, - value: &Box, + value: &AST, ) -> Result { write!(writer, "type {} = {};", name, self.write_ast(value)) } - fn write_export_list(&mut self, writer: &mut dyn Write, names: &Vec) -> Result { + fn write_export_list(&mut self, writer: &mut dyn Write, names: &[StringKey]) -> Result { write!( writer, "export type {{ {} }};", diff --git a/compiler/crates/relay-typegen/src/lib.rs b/compiler/crates/relay-typegen/src/lib.rs index a87d9430727bc..18ba94f8ea1e0 100644 --- a/compiler/crates/relay-typegen/src/lib.rs +++ b/compiler/crates/relay-typegen/src/lib.rs @@ -1263,7 +1263,7 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { write_ast!( self, AST::ExportTypeEquals( - type_identifier.clone(), + *type_identifier, Box::from(input_object_type.clone()) ) )?; diff --git a/compiler/crates/relay-typegen/src/typescript.rs b/compiler/crates/relay-typegen/src/typescript.rs index 12fa5e5a33657..c19eeee1d48db 100644 --- a/compiler/crates/relay-typegen/src/typescript.rs +++ b/compiler/crates/relay-typegen/src/typescript.rs @@ -225,7 +225,7 @@ impl TypeScriptPrinter { fn write_fragment_references( &mut self, writer: &mut dyn Write, - fragments: &Vec, + fragments: &[StringKey], ) -> Result { write!(writer, "FragmentRefs<")?; self.write( @@ -243,7 +243,7 @@ impl TypeScriptPrinter { fn write_import_type( &mut self, writer: &mut dyn Write, - types: &Vec, + types: &[StringKey], from: &StringKey, ) -> Result { write!( @@ -267,7 +267,7 @@ impl TypeScriptPrinter { &mut self, writer: &mut dyn Write, name: &StringKey, - value: &Box, + value: &AST, ) -> Result { write!(writer, "type {} = {};", name, self.write_ast(value)) } From 20c443a914178f99e8581442459c59604fb10b61 Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Tue, 1 Dec 2020 22:35:52 +0100 Subject: [PATCH 17/41] Update test fixtures including combinations of different values of future proof abstract types and future proof enums. --- .../fixtures/conditional.expected | 104 ++++ .../fixtures/fragment-spread.expected | 406 ++++++++++++- .../fixtures/inline-fragment.expected | 301 +++++++++- .../fixtures/linked-field.expected | 147 ++++- .../fixtures/match-field-in-query.expected | 177 +++++- .../fixtures/match-field.expected | 189 +++++- .../mutation-input-has-array.expected | 104 ++++ .../mutation-with-client-extension.expected | 116 ++++ .../mutation-with-enums-on-fragment.expected | 256 +++++++- .../mutation-with-nested-fragments.expected | 297 ++++++++- ...with-response-on-inline-fragments.expected | 265 ++++++++- .../generate_flow/fixtures/mutation.expected | 116 ++++ .../fixtures/plural-fragment.expected | 62 ++ .../fixtures/query-with-handles.expected | 176 ++++++ .../fixtures/query-with-match-fields.expected | 359 ++++++++++- .../fixtures/query-with-module-field.expected | 234 +++++++- .../query-with-multiple-match-fields.expected | 542 ++++++++++++++++- ...-with-raw-response-on-conditional.expected | 172 +++++- ...w-response-on-literal-conditional.expected | 157 ++++- .../query-with-stream-connection.expected | 167 ++++++ .../fixtures/query-with-stream.expected | 146 +++++ .../fixtures/recursive-fragments.expected | 65 ++ .../fixtures/refetchable-fragment.expected | 119 ++++ .../fixtures/refetchable.expected | 113 ++++ .../fixtures/relay-client-id-field.expected | 152 ++++- ...ough-inline-fragments-to-fragment.expected | 86 ++- .../required-bubbles-to-fragment.expected | 65 ++ ...d-bubbles-to-item-in-plural-field.expected | 74 +++ ...m-in-non-null-plural-linked-field.expected | 68 +++ ...ked-field-through-inline-fragment.expected | 68 +++ ...-bubbles-to-non-null-linked-field.expected | 68 +++ ...s-to-non-null-plural-linked-field.expected | 68 +++ .../required-bubbles-to-query.expected | 56 ++ ...d-bubbles-up-to-mutation-response.expected | 98 +++ ...ked-field-through-inline-fragment.expected | 74 +++ ...solates-concrete-inline-fragments.expected | 153 ++++- .../required-raw-response-type.expected | 77 +++ ...-throw-doesnt-bubbles-to-fragment.expected | 65 ++ ...red-throw-doesnt-bubbles-to-query.expected | 56 ++ .../fixtures/required-throws-nested.expected | 56 ++ ...rows-within-non-null-linked-field.expected | 68 +++ ...thin-non-null-plural-linked-field.expected | 68 +++ .../generate_flow/fixtures/required.expected | 56 ++ .../generate_flow/fixtures/roots.expected | 236 ++++++++ .../fixtures/scalar-field.expected | 95 +++ .../generate_flow/fixtures/simple.expected | 77 +++ ...me-inside-with-overlapping-fields.expected | 99 +++ .../fixtures/typename-on-union.expected | 563 +++++++++++++++++- .../unmasked-fragment-spreads.expected | 217 ++++++- .../relay-typegen/tests/generate_flow/mod.rs | 72 ++- .../fixtures/conditional.expected | 86 +++ .../fixtures/fragment-spread.expected | 318 +++++++++- .../fixtures/inline-fragment.expected | 251 +++++++- .../fixtures/linked-field.expected | 138 ++++- .../fixtures/match-field-in-query.expected | 149 +++++ .../fixtures/match-field.expected | 152 +++++ .../mutation-input-has-array.expected | 104 ++++ .../mutation-with-client-extension.expected | 116 ++++ .../mutation-with-enums-on-fragment.expected | 242 ++++++++ .../mutation-with-nested-fragments.expected | 269 +++++++++ ...with-response-on-inline-fragments.expected | 251 ++++++++ .../fixtures/mutation.expected | 116 ++++ .../fixtures/plural-fragment.expected | 53 ++ .../fixtures/query-with-handles.expected | 176 ++++++ .../fixtures/query-with-match-fields.expected | 305 ++++++++++ .../fixtures/query-with-module-field.expected | 200 +++++++ .../query-with-multiple-match-fields.expected | 452 ++++++++++++++ ...-with-raw-response-on-conditional.expected | 158 +++++ ...w-response-on-literal-conditional.expected | 143 +++++ .../query-with-stream-connection.expected | 167 ++++++ .../fixtures/query-with-stream.expected | 146 +++++ .../fixtures/recursive-fragments.expected | 56 ++ .../fixtures/refetchable-fragment.expected | 104 ++++ .../fixtures/refetchable.expected | 98 +++ .../fixtures/relay-client-id-field.expected | 154 ++++- ...ough-inline-fragments-to-fragment.expected | 75 ++- .../required-bubbles-to-fragment.expected | 56 ++ ...d-bubbles-to-item-in-plural-field.expected | 65 ++ .../required-bubbles-to-query.expected | 56 ++ ...d-bubbles-up-to-mutation-response.expected | 98 +++ ...solates-concrete-inline-fragments.expected | 133 ++++- .../required-raw-response-type.expected | 77 +++ ...-throw-doesnt-bubbles-to-fragment.expected | 56 ++ ...red-throw-doesnt-bubbles-to-query.expected | 56 ++ .../fixtures/required-throws-nested.expected | 56 ++ .../fixtures/required.expected | 56 ++ .../fixtures/roots.expected | 227 +++++++ .../fixtures/scalar-field.expected | 86 +++ .../fixtures/simple.expected | 68 +++ ...me-inside-with-overlapping-fields.expected | 90 +++ .../fixtures/typename-on-union.expected | 503 +++++++++++++++- .../unmasked-fragment-spreads.expected | 173 ++++++ .../tests/generate_typescript/mod.rs | 72 ++- 93 files changed, 13825 insertions(+), 207 deletions(-) diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/conditional.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/conditional.expected index 0ddc4e0be0181..1ec810862bcae 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/conditional.expected @@ -9,6 +9,110 @@ fragment NestedCondition on Node { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type ConditionField$ref: FragmentReference; +declare export opaque type ConditionField$fragmentType: ConditionField$ref; +export type ConditionField = {| + +id?: string, + +$refType: ConditionField$ref, +|}; +export type ConditionField$data = ConditionField; +export type ConditionField$key = { + +$data?: ConditionField$data, + +$fragmentRefs: ConditionField$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type NestedCondition$ref: FragmentReference; +declare export opaque type NestedCondition$fragmentType: NestedCondition$ref; +export type NestedCondition = {| + +id?: string, + +$refType: NestedCondition$ref, +|}; +export type NestedCondition$data = NestedCondition; +export type NestedCondition$key = { + +$data?: NestedCondition$data, + +$fragmentRefs: NestedCondition$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type ConditionField$ref: FragmentReference; +declare export opaque type ConditionField$fragmentType: ConditionField$ref; +export type ConditionField = {| + +id?: string, + +$refType: ConditionField$ref, +|}; +export type ConditionField$data = ConditionField; +export type ConditionField$key = { + +$data?: ConditionField$data, + +$fragmentRefs: ConditionField$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type NestedCondition$ref: FragmentReference; +declare export opaque type NestedCondition$fragmentType: NestedCondition$ref; +export type NestedCondition = {| + +id?: string, + +$refType: NestedCondition$ref, +|}; +export type NestedCondition$data = NestedCondition; +export type NestedCondition$key = { + +$data?: NestedCondition$data, + +$fragmentRefs: NestedCondition$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type ConditionField$ref: FragmentReference; +declare export opaque type ConditionField$fragmentType: ConditionField$ref; +export type ConditionField = {| + +id?: string, + +$refType: ConditionField$ref, +|}; +export type ConditionField$data = ConditionField; +export type ConditionField$key = { + +$data?: ConditionField$data, + +$fragmentRefs: ConditionField$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type NestedCondition$ref: FragmentReference; +declare export opaque type NestedCondition$fragmentType: NestedCondition$ref; +export type NestedCondition = {| + +id?: string, + +$refType: NestedCondition$ref, +|}; +export type NestedCondition$data = NestedCondition; +export type NestedCondition$key = { + +$data?: NestedCondition$data, + +$fragmentRefs: NestedCondition$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import type { FragmentReference } from "relay-runtime"; declare export opaque type ConditionField$ref: FragmentReference; declare export opaque type ConditionField$fragmentType: ConditionField$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/fragment-spread.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/fragment-spread.expected index 94fa31fbf884a..3d1191423bd26 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/fragment-spread.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/fragment-spread.expected @@ -48,7 +48,258 @@ fragment UserFrag2 on User { __typename } ==================================== OUTPUT =================================== -import type { PageFragment$ref } from "./PageFragment.graphql"; +/* + * future proof enums: false + * future proof abstract types: false + */ + +import type { PageFragment$ref } from "PageFragment.graphql"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type ConcreateTypes$ref: FragmentReference; +declare export opaque type ConcreateTypes$fragmentType: ConcreateTypes$ref; +export type ConcreateTypes = {| + +actor: ?({| + +__typename: "Page", + +id: string, + +$fragmentRefs: PageFragment$ref, + |} | {| + +__typename: "User", + +name: ?string, + |}), + +$refType: ConcreateTypes$ref, +|}; +export type ConcreateTypes$data = ConcreateTypes; +export type ConcreateTypes$key = { + +$data?: ConcreateTypes$data, + +$fragmentRefs: ConcreateTypes$ref, + ... +}; +------------------------------------------------------------------------------- +import type { OtherFragment$ref } from "OtherFragment.graphql"; +import type { PictureFragment$ref } from "PictureFragment.graphql"; +import type { UserFrag1$ref } from "UserFrag1.graphql"; +import type { UserFrag2$ref } from "UserFrag2.graphql"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type FragmentSpread$ref: FragmentReference; +declare export opaque type FragmentSpread$fragmentType: FragmentSpread$ref; +export type FragmentSpread = {| + +id: string, + +justFrag: ?{| + +$fragmentRefs: PictureFragment$ref + |}, + +fragAndField: ?{| + +uri: ?string, + +$fragmentRefs: PictureFragment$ref, + |}, + +$fragmentRefs: OtherFragment$ref & UserFrag1$ref & UserFrag2$ref, + +$refType: FragmentSpread$ref, +|}; +export type FragmentSpread$data = FragmentSpread; +export type FragmentSpread$key = { + +$data?: FragmentSpread$data, + +$fragmentRefs: FragmentSpread$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type OtherFragment$ref: FragmentReference; +declare export opaque type OtherFragment$fragmentType: OtherFragment$ref; +export type OtherFragment = {| + +__typename: string, + +$refType: OtherFragment$ref, +|}; +export type OtherFragment$data = OtherFragment; +export type OtherFragment$key = { + +$data?: OtherFragment$data, + +$fragmentRefs: OtherFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type PageFragment$ref: FragmentReference; +declare export opaque type PageFragment$fragmentType: PageFragment$ref; +export type PageFragment = {| + +__typename: "Page", + +$refType: PageFragment$ref, +|}; +export type PageFragment$data = PageFragment; +export type PageFragment$key = { + +$data?: PageFragment$data, + +$fragmentRefs: PageFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type PictureFragment$ref: FragmentReference; +declare export opaque type PictureFragment$fragmentType: PictureFragment$ref; +export type PictureFragment = {| + +__typename: "Image", + +$refType: PictureFragment$ref, +|}; +export type PictureFragment$data = PictureFragment; +export type PictureFragment$key = { + +$data?: PictureFragment$data, + +$fragmentRefs: PictureFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type UserFrag1$ref: FragmentReference; +declare export opaque type UserFrag1$fragmentType: UserFrag1$ref; +export type UserFrag1 = {| + +__typename: "User", + +$refType: UserFrag1$ref, +|}; +export type UserFrag1$data = UserFrag1; +export type UserFrag1$key = { + +$data?: UserFrag1$data, + +$fragmentRefs: UserFrag1$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type UserFrag2$ref: FragmentReference; +declare export opaque type UserFrag2$fragmentType: UserFrag2$ref; +export type UserFrag2 = {| + +__typename: "User", + +$refType: UserFrag2$ref, +|}; +export type UserFrag2$data = UserFrag2; +export type UserFrag2$key = { + +$data?: UserFrag2$data, + +$fragmentRefs: UserFrag2$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import type { PageFragment$ref } from "PageFragment.graphql"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type ConcreateTypes$ref: FragmentReference; +declare export opaque type ConcreateTypes$fragmentType: ConcreateTypes$ref; +export type ConcreateTypes = {| + +actor: ?({| + +__typename: "Page", + +id: string, + +$fragmentRefs: PageFragment$ref, + |} | {| + +__typename: "User", + +name: ?string, + |}), + +$refType: ConcreateTypes$ref, +|}; +export type ConcreateTypes$data = ConcreateTypes; +export type ConcreateTypes$key = { + +$data?: ConcreateTypes$data, + +$fragmentRefs: ConcreateTypes$ref, + ... +}; +------------------------------------------------------------------------------- +import type { OtherFragment$ref } from "OtherFragment.graphql"; +import type { PictureFragment$ref } from "PictureFragment.graphql"; +import type { UserFrag1$ref } from "UserFrag1.graphql"; +import type { UserFrag2$ref } from "UserFrag2.graphql"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type FragmentSpread$ref: FragmentReference; +declare export opaque type FragmentSpread$fragmentType: FragmentSpread$ref; +export type FragmentSpread = {| + +id: string, + +justFrag: ?{| + +$fragmentRefs: PictureFragment$ref + |}, + +fragAndField: ?{| + +uri: ?string, + +$fragmentRefs: PictureFragment$ref, + |}, + +$fragmentRefs: OtherFragment$ref & UserFrag1$ref & UserFrag2$ref, + +$refType: FragmentSpread$ref, +|}; +export type FragmentSpread$data = FragmentSpread; +export type FragmentSpread$key = { + +$data?: FragmentSpread$data, + +$fragmentRefs: FragmentSpread$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type OtherFragment$ref: FragmentReference; +declare export opaque type OtherFragment$fragmentType: OtherFragment$ref; +export type OtherFragment = {| + +__typename: string, + +$refType: OtherFragment$ref, +|}; +export type OtherFragment$data = OtherFragment; +export type OtherFragment$key = { + +$data?: OtherFragment$data, + +$fragmentRefs: OtherFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type PageFragment$ref: FragmentReference; +declare export opaque type PageFragment$fragmentType: PageFragment$ref; +export type PageFragment = {| + +__typename: "Page", + +$refType: PageFragment$ref, +|}; +export type PageFragment$data = PageFragment; +export type PageFragment$key = { + +$data?: PageFragment$data, + +$fragmentRefs: PageFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type PictureFragment$ref: FragmentReference; +declare export opaque type PictureFragment$fragmentType: PictureFragment$ref; +export type PictureFragment = {| + +__typename: "Image", + +$refType: PictureFragment$ref, +|}; +export type PictureFragment$data = PictureFragment; +export type PictureFragment$key = { + +$data?: PictureFragment$data, + +$fragmentRefs: PictureFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type UserFrag1$ref: FragmentReference; +declare export opaque type UserFrag1$fragmentType: UserFrag1$ref; +export type UserFrag1 = {| + +__typename: "User", + +$refType: UserFrag1$ref, +|}; +export type UserFrag1$data = UserFrag1; +export type UserFrag1$key = { + +$data?: UserFrag1$data, + +$fragmentRefs: UserFrag1$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type UserFrag2$ref: FragmentReference; +declare export opaque type UserFrag2$fragmentType: UserFrag2$ref; +export type UserFrag2 = {| + +__typename: "User", + +$refType: UserFrag2$ref, +|}; +export type UserFrag2$data = UserFrag2; +export type UserFrag2$key = { + +$data?: UserFrag2$data, + +$fragmentRefs: UserFrag2$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import type { PageFragment$ref } from "PageFragment.graphql"; import type { FragmentReference } from "relay-runtime"; declare export opaque type ConcreateTypes$ref: FragmentReference; declare export opaque type ConcreateTypes$fragmentType: ConcreateTypes$ref; @@ -74,10 +325,10 @@ export type ConcreateTypes$key = { ... }; ------------------------------------------------------------------------------- -import type { OtherFragment$ref } from "./OtherFragment.graphql"; -import type { PictureFragment$ref } from "./PictureFragment.graphql"; -import type { UserFrag1$ref } from "./UserFrag1.graphql"; -import type { UserFrag2$ref } from "./UserFrag2.graphql"; +import type { OtherFragment$ref } from "OtherFragment.graphql"; +import type { PictureFragment$ref } from "PictureFragment.graphql"; +import type { UserFrag1$ref } from "UserFrag1.graphql"; +import type { UserFrag2$ref } from "UserFrag2.graphql"; import type { FragmentReference } from "relay-runtime"; declare export opaque type FragmentSpread$ref: FragmentReference; declare export opaque type FragmentSpread$fragmentType: FragmentSpread$ref; @@ -120,11 +371,6 @@ declare export opaque type PageFragment$fragmentType: PageFragment$ref; export type PageFragment = {| +__typename: "Page", +$refType: PageFragment$ref, -|} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +__typename: "%other", - +$refType: PageFragment$ref, |}; export type PageFragment$data = PageFragment; export type PageFragment$key = { @@ -139,11 +385,6 @@ declare export opaque type PictureFragment$fragmentType: PictureFragment$ref; export type PictureFragment = {| +__typename: "Image", +$refType: PictureFragment$ref, -|} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +__typename: "%other", - +$refType: PictureFragment$ref, |}; export type PictureFragment$data = PictureFragment; export type PictureFragment$key = { @@ -158,11 +399,6 @@ declare export opaque type UserFrag1$fragmentType: UserFrag1$ref; export type UserFrag1 = {| +__typename: "User", +$refType: UserFrag1$ref, -|} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +__typename: "%other", - +$refType: UserFrag1$ref, |}; export type UserFrag1$data = UserFrag1; export type UserFrag1$key = { @@ -177,10 +413,132 @@ declare export opaque type UserFrag2$fragmentType: UserFrag2$ref; export type UserFrag2 = {| +__typename: "User", +$refType: UserFrag2$ref, -|} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +__typename: "%other", +|}; +export type UserFrag2$data = UserFrag2; +export type UserFrag2$key = { + +$data?: UserFrag2$data, + +$fragmentRefs: UserFrag2$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + +import type { PageFragment$ref } from "PageFragment.graphql"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type ConcreateTypes$ref: FragmentReference; +declare export opaque type ConcreateTypes$fragmentType: ConcreateTypes$ref; +export type ConcreateTypes = {| + +actor: ?({| + +__typename: "Page", + +id: string, + +$fragmentRefs: PageFragment$ref, + |} | {| + +__typename: "User", + +name: ?string, + |} | {| + // This will never be '%other', but we need some + // value in case none of the concrete values match. + +__typename: "%other" + |}), + +$refType: ConcreateTypes$ref, +|}; +export type ConcreateTypes$data = ConcreateTypes; +export type ConcreateTypes$key = { + +$data?: ConcreateTypes$data, + +$fragmentRefs: ConcreateTypes$ref, + ... +}; +------------------------------------------------------------------------------- +import type { OtherFragment$ref } from "OtherFragment.graphql"; +import type { PictureFragment$ref } from "PictureFragment.graphql"; +import type { UserFrag1$ref } from "UserFrag1.graphql"; +import type { UserFrag2$ref } from "UserFrag2.graphql"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type FragmentSpread$ref: FragmentReference; +declare export opaque type FragmentSpread$fragmentType: FragmentSpread$ref; +export type FragmentSpread = {| + +id: string, + +justFrag: ?{| + +$fragmentRefs: PictureFragment$ref + |}, + +fragAndField: ?{| + +uri: ?string, + +$fragmentRefs: PictureFragment$ref, + |}, + +$fragmentRefs: OtherFragment$ref & UserFrag1$ref & UserFrag2$ref, + +$refType: FragmentSpread$ref, +|}; +export type FragmentSpread$data = FragmentSpread; +export type FragmentSpread$key = { + +$data?: FragmentSpread$data, + +$fragmentRefs: FragmentSpread$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type OtherFragment$ref: FragmentReference; +declare export opaque type OtherFragment$fragmentType: OtherFragment$ref; +export type OtherFragment = {| + +__typename: string, + +$refType: OtherFragment$ref, +|}; +export type OtherFragment$data = OtherFragment; +export type OtherFragment$key = { + +$data?: OtherFragment$data, + +$fragmentRefs: OtherFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type PageFragment$ref: FragmentReference; +declare export opaque type PageFragment$fragmentType: PageFragment$ref; +export type PageFragment = {| + +__typename: "Page", + +$refType: PageFragment$ref, +|}; +export type PageFragment$data = PageFragment; +export type PageFragment$key = { + +$data?: PageFragment$data, + +$fragmentRefs: PageFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type PictureFragment$ref: FragmentReference; +declare export opaque type PictureFragment$fragmentType: PictureFragment$ref; +export type PictureFragment = {| + +__typename: "Image", + +$refType: PictureFragment$ref, +|}; +export type PictureFragment$data = PictureFragment; +export type PictureFragment$key = { + +$data?: PictureFragment$data, + +$fragmentRefs: PictureFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type UserFrag1$ref: FragmentReference; +declare export opaque type UserFrag1$fragmentType: UserFrag1$ref; +export type UserFrag1 = {| + +__typename: "User", + +$refType: UserFrag1$ref, +|}; +export type UserFrag1$data = UserFrag1; +export type UserFrag1$key = { + +$data?: UserFrag1$data, + +$fragmentRefs: UserFrag1$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type UserFrag2$ref: FragmentReference; +declare export opaque type UserFrag2$fragmentType: UserFrag2$ref; +export type UserFrag2 = {| + +__typename: "User", +$refType: UserFrag2$ref, |}; export type UserFrag2$data = UserFrag2; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/inline-fragment.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/inline-fragment.expected index 23a11a51f3220..701a2116d7198 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/inline-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/inline-fragment.expected @@ -64,6 +64,205 @@ fragment SomeFragment on User { __typename } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type InlineFragment$ref: FragmentReference; +declare export opaque type InlineFragment$fragmentType: InlineFragment$ref; +export type InlineFragment = {| + +id: string, + +name?: ?string, + +message?: ?{| + +text: ?string + |}, + +$refType: InlineFragment$ref, +|}; +export type InlineFragment$data = InlineFragment; +export type InlineFragment$key = { + +$data?: InlineFragment$data, + +$fragmentRefs: InlineFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type InlineFragmentConditionalID$ref: FragmentReference; +declare export opaque type InlineFragmentConditionalID$fragmentType: InlineFragmentConditionalID$ref; +export type InlineFragmentConditionalID = {| + +id?: string, + +name?: ?string, + +$refType: InlineFragmentConditionalID$ref, +|}; +export type InlineFragmentConditionalID$data = InlineFragmentConditionalID; +export type InlineFragmentConditionalID$key = { + +$data?: InlineFragmentConditionalID$data, + +$fragmentRefs: InlineFragmentConditionalID$ref, + ... +}; +------------------------------------------------------------------------------- +import type { SomeFragment$ref } from "SomeFragment.graphql"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type InlineFragmentKitchenSink$ref: FragmentReference; +declare export opaque type InlineFragmentKitchenSink$fragmentType: InlineFragmentKitchenSink$ref; +export type InlineFragmentKitchenSink = {| + +actor: ?{| + +id: string, + +profilePicture: ?{| + +uri: ?string, + +width?: ?number, + +height?: ?number, + |}, + +name?: ?string, + +$fragmentRefs: SomeFragment$ref, + |}, + +$refType: InlineFragmentKitchenSink$ref, +|}; +export type InlineFragmentKitchenSink$data = InlineFragmentKitchenSink; +export type InlineFragmentKitchenSink$key = { + +$data?: InlineFragmentKitchenSink$data, + +$fragmentRefs: InlineFragmentKitchenSink$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type InlineFragmentWithOverlappingFields$ref: FragmentReference; +declare export opaque type InlineFragmentWithOverlappingFields$fragmentType: InlineFragmentWithOverlappingFields$ref; +export type InlineFragmentWithOverlappingFields = {| + +hometown?: ?{| + +id: string, + +name: ?string, + +message?: ?{| + +text: ?string + |}, + |}, + +name?: ?string, + +$refType: InlineFragmentWithOverlappingFields$ref, +|}; +export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; +export type InlineFragmentWithOverlappingFields$key = { + +$data?: InlineFragmentWithOverlappingFields$data, + +$fragmentRefs: InlineFragmentWithOverlappingFields$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type SomeFragment$ref: FragmentReference; +declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; +export type SomeFragment = {| + +__typename: "User", + +$refType: SomeFragment$ref, +|}; +export type SomeFragment$data = SomeFragment; +export type SomeFragment$key = { + +$data?: SomeFragment$data, + +$fragmentRefs: SomeFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type InlineFragment$ref: FragmentReference; +declare export opaque type InlineFragment$fragmentType: InlineFragment$ref; +export type InlineFragment = {| + +id: string, + +name?: ?string, + +message?: ?{| + +text: ?string + |}, + +$refType: InlineFragment$ref, +|}; +export type InlineFragment$data = InlineFragment; +export type InlineFragment$key = { + +$data?: InlineFragment$data, + +$fragmentRefs: InlineFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type InlineFragmentConditionalID$ref: FragmentReference; +declare export opaque type InlineFragmentConditionalID$fragmentType: InlineFragmentConditionalID$ref; +export type InlineFragmentConditionalID = {| + +id?: string, + +name?: ?string, + +$refType: InlineFragmentConditionalID$ref, +|}; +export type InlineFragmentConditionalID$data = InlineFragmentConditionalID; +export type InlineFragmentConditionalID$key = { + +$data?: InlineFragmentConditionalID$data, + +$fragmentRefs: InlineFragmentConditionalID$ref, + ... +}; +------------------------------------------------------------------------------- +import type { SomeFragment$ref } from "SomeFragment.graphql"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type InlineFragmentKitchenSink$ref: FragmentReference; +declare export opaque type InlineFragmentKitchenSink$fragmentType: InlineFragmentKitchenSink$ref; +export type InlineFragmentKitchenSink = {| + +actor: ?{| + +id: string, + +profilePicture: ?{| + +uri: ?string, + +width?: ?number, + +height?: ?number, + |}, + +name?: ?string, + +$fragmentRefs: SomeFragment$ref, + |}, + +$refType: InlineFragmentKitchenSink$ref, +|}; +export type InlineFragmentKitchenSink$data = InlineFragmentKitchenSink; +export type InlineFragmentKitchenSink$key = { + +$data?: InlineFragmentKitchenSink$data, + +$fragmentRefs: InlineFragmentKitchenSink$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type InlineFragmentWithOverlappingFields$ref: FragmentReference; +declare export opaque type InlineFragmentWithOverlappingFields$fragmentType: InlineFragmentWithOverlappingFields$ref; +export type InlineFragmentWithOverlappingFields = {| + +hometown?: ?{| + +id: string, + +name: ?string, + +message?: ?{| + +text: ?string + |}, + |}, + +name?: ?string, + +$refType: InlineFragmentWithOverlappingFields$ref, +|}; +export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; +export type InlineFragmentWithOverlappingFields$key = { + +$data?: InlineFragmentWithOverlappingFields$data, + +$fragmentRefs: InlineFragmentWithOverlappingFields$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type SomeFragment$ref: FragmentReference; +declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; +export type SomeFragment = {| + +__typename: "User", + +$refType: SomeFragment$ref, +|}; +export type SomeFragment$data = SomeFragment; +export type SomeFragment$key = { + +$data?: SomeFragment$data, + +$fragmentRefs: SomeFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + import type { FragmentReference } from "relay-runtime"; declare export opaque type InlineFragment$ref: FragmentReference; declare export opaque type InlineFragment$fragmentType: InlineFragment$ref; @@ -97,7 +296,7 @@ export type InlineFragmentConditionalID$key = { ... }; ------------------------------------------------------------------------------- -import type { SomeFragment$ref } from "./SomeFragment.graphql"; +import type { SomeFragment$ref } from "SomeFragment.graphql"; import type { FragmentReference } from "relay-runtime"; declare export opaque type InlineFragmentKitchenSink$ref: FragmentReference; declare export opaque type InlineFragmentKitchenSink$fragmentType: InlineFragmentKitchenSink$ref; @@ -148,10 +347,102 @@ declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; export type SomeFragment = {| +__typename: "User", +$refType: SomeFragment$ref, -|} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +__typename: "%other", +|}; +export type SomeFragment$data = SomeFragment; +export type SomeFragment$key = { + +$data?: SomeFragment$data, + +$fragmentRefs: SomeFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type InlineFragment$ref: FragmentReference; +declare export opaque type InlineFragment$fragmentType: InlineFragment$ref; +export type InlineFragment = {| + +id: string, + +name?: ?string, + +message?: ?{| + +text: ?string + |}, + +$refType: InlineFragment$ref, +|}; +export type InlineFragment$data = InlineFragment; +export type InlineFragment$key = { + +$data?: InlineFragment$data, + +$fragmentRefs: InlineFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type InlineFragmentConditionalID$ref: FragmentReference; +declare export opaque type InlineFragmentConditionalID$fragmentType: InlineFragmentConditionalID$ref; +export type InlineFragmentConditionalID = {| + +id?: string, + +name?: ?string, + +$refType: InlineFragmentConditionalID$ref, +|}; +export type InlineFragmentConditionalID$data = InlineFragmentConditionalID; +export type InlineFragmentConditionalID$key = { + +$data?: InlineFragmentConditionalID$data, + +$fragmentRefs: InlineFragmentConditionalID$ref, + ... +}; +------------------------------------------------------------------------------- +import type { SomeFragment$ref } from "SomeFragment.graphql"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type InlineFragmentKitchenSink$ref: FragmentReference; +declare export opaque type InlineFragmentKitchenSink$fragmentType: InlineFragmentKitchenSink$ref; +export type InlineFragmentKitchenSink = {| + +actor: ?{| + +id: string, + +profilePicture: ?{| + +uri: ?string, + +width?: ?number, + +height?: ?number, + |}, + +name?: ?string, + +$fragmentRefs: SomeFragment$ref, + |}, + +$refType: InlineFragmentKitchenSink$ref, +|}; +export type InlineFragmentKitchenSink$data = InlineFragmentKitchenSink; +export type InlineFragmentKitchenSink$key = { + +$data?: InlineFragmentKitchenSink$data, + +$fragmentRefs: InlineFragmentKitchenSink$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type InlineFragmentWithOverlappingFields$ref: FragmentReference; +declare export opaque type InlineFragmentWithOverlappingFields$fragmentType: InlineFragmentWithOverlappingFields$ref; +export type InlineFragmentWithOverlappingFields = {| + +hometown?: ?{| + +id: string, + +name: ?string, + +message?: ?{| + +text: ?string + |}, + |}, + +name?: ?string, + +$refType: InlineFragmentWithOverlappingFields$ref, +|}; +export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; +export type InlineFragmentWithOverlappingFields$key = { + +$data?: InlineFragmentWithOverlappingFields$data, + +$fragmentRefs: InlineFragmentWithOverlappingFields$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type SomeFragment$ref: FragmentReference; +declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; +export type SomeFragment = {| + +__typename: "User", +$refType: SomeFragment$ref, |}; export type SomeFragment$data = SomeFragment; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/linked-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/linked-field.expected index 38bb3583ed53b..76a392cffae41 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/linked-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/linked-field.expected @@ -27,6 +27,151 @@ query UnionTypeTest { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type UnionTypeTestVariables = {||}; +export type UnionTypeTestResponse = {| + +neverNode: ?({| + +__typename: "FakeNode", + +id: string, + |} | {| + +__typename: "NonNode" + |}) +|}; +export type UnionTypeTest = {| + variables: UnionTypeTestVariables, + response: UnionTypeTestResponse, +|}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type LinkedField$ref: FragmentReference; +declare export opaque type LinkedField$fragmentType: LinkedField$ref; +export type LinkedField = {| + +profilePicture: ?{| + +uri: ?string, + +width: ?number, + +height: ?number, + |}, + +hometown: ?{| + +id: string, + +profilePicture: ?{| + +uri: ?string + |}, + |}, + +actor: ?{| + +id: string + |}, + +$refType: LinkedField$ref, +|}; +export type LinkedField$data = LinkedField; +export type LinkedField$key = { + +$data?: LinkedField$data, + +$fragmentRefs: LinkedField$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type UnionTypeTestVariables = {||}; +export type UnionTypeTestResponse = {| + +neverNode: ?({| + +__typename: "FakeNode", + +id: string, + |} | {| + +__typename: "NonNode" + |}) +|}; +export type UnionTypeTest = {| + variables: UnionTypeTestVariables, + response: UnionTypeTestResponse, +|}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type LinkedField$ref: FragmentReference; +declare export opaque type LinkedField$fragmentType: LinkedField$ref; +export type LinkedField = {| + +profilePicture: ?{| + +uri: ?string, + +width: ?number, + +height: ?number, + |}, + +hometown: ?{| + +id: string, + +profilePicture: ?{| + +uri: ?string + |}, + |}, + +actor: ?{| + +id: string + |}, + +$refType: LinkedField$ref, +|}; +export type LinkedField$data = LinkedField; +export type LinkedField$key = { + +$data?: LinkedField$data, + +$fragmentRefs: LinkedField$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type UnionTypeTestVariables = {||}; +export type UnionTypeTestResponse = {| + +neverNode: ?({| + +__typename: "FakeNode", + +id: string, + |} | {| + // This will never be '%other', but we need some + // value in case none of the concrete values match. + +__typename: "NonNode" | "%other" + |}) +|}; +export type UnionTypeTest = {| + variables: UnionTypeTestVariables, + response: UnionTypeTestResponse, +|}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type LinkedField$ref: FragmentReference; +declare export opaque type LinkedField$fragmentType: LinkedField$ref; +export type LinkedField = {| + +profilePicture: ?{| + +uri: ?string, + +width: ?number, + +height: ?number, + |}, + +hometown: ?{| + +id: string, + +profilePicture: ?{| + +uri: ?string + |}, + |}, + +actor: ?{| + +id: string + |}, + +$refType: LinkedField$ref, +|}; +export type LinkedField$data = LinkedField; +export type LinkedField$key = { + +$data?: LinkedField$data, + +$fragmentRefs: LinkedField$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type UnionTypeTestVariables = {||}; export type UnionTypeTestResponse = {| +neverNode: ?({| @@ -35,7 +180,7 @@ export type UnionTypeTestResponse = {| |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +__typename: "%other" + +__typename: "NonNode" | "%other" |}) |}; export type UnionTypeTest = {| diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/match-field-in-query.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/match-field-in-query.expected index 1157563d6ff80..4b6e35f7dba66 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/match-field-in-query.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/match-field-in-query.expected @@ -23,8 +23,181 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { } } ==================================== OUTPUT =================================== -import type { MarkdownUserNameRenderer_name$ref } from "./MarkdownUserNameRenderer_name.graphql"; -import type { PlainUserNameRenderer_name$ref } from "./PlainUserNameRenderer_name.graphql"; +/* + * future proof enums: false + * future proof abstract types: false + */ + +import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; +import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; +export type NameRendererQueryVariables = {||}; +export type NameRendererQueryResponse = {| + +me: ?{| + +nameRenderer: ?{| + +__fragmentPropName?: ?string, + +__module_component?: ?string, + +$fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, + |} + |} +|}; +export type NameRendererQuery = {| + variables: NameRendererQueryVariables, + response: NameRendererQueryResponse, +|}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type MarkdownUserNameRenderer_name$ref: FragmentReference; +declare export opaque type MarkdownUserNameRenderer_name$fragmentType: MarkdownUserNameRenderer_name$ref; +export type MarkdownUserNameRenderer_name = {| + +markdown: ?string, + +data: ?{| + +markup: ?string + |}, + +$refType: MarkdownUserNameRenderer_name$ref, +|}; +export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; +export type MarkdownUserNameRenderer_name$key = { + +$data?: MarkdownUserNameRenderer_name$data, + +$fragmentRefs: MarkdownUserNameRenderer_name$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type PlainUserNameRenderer_name$ref: FragmentReference; +declare export opaque type PlainUserNameRenderer_name$fragmentType: PlainUserNameRenderer_name$ref; +export type PlainUserNameRenderer_name = {| + +plaintext: ?string, + +data: ?{| + +text: ?string + |}, + +$refType: PlainUserNameRenderer_name$ref, +|}; +export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; +export type PlainUserNameRenderer_name$key = { + +$data?: PlainUserNameRenderer_name$data, + +$fragmentRefs: PlainUserNameRenderer_name$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; +import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; +export type NameRendererQueryVariables = {||}; +export type NameRendererQueryResponse = {| + +me: ?{| + +nameRenderer: ?{| + +__fragmentPropName?: ?string, + +__module_component?: ?string, + +$fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, + |} + |} +|}; +export type NameRendererQuery = {| + variables: NameRendererQueryVariables, + response: NameRendererQueryResponse, +|}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type MarkdownUserNameRenderer_name$ref: FragmentReference; +declare export opaque type MarkdownUserNameRenderer_name$fragmentType: MarkdownUserNameRenderer_name$ref; +export type MarkdownUserNameRenderer_name = {| + +markdown: ?string, + +data: ?{| + +markup: ?string + |}, + +$refType: MarkdownUserNameRenderer_name$ref, +|}; +export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; +export type MarkdownUserNameRenderer_name$key = { + +$data?: MarkdownUserNameRenderer_name$data, + +$fragmentRefs: MarkdownUserNameRenderer_name$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type PlainUserNameRenderer_name$ref: FragmentReference; +declare export opaque type PlainUserNameRenderer_name$fragmentType: PlainUserNameRenderer_name$ref; +export type PlainUserNameRenderer_name = {| + +plaintext: ?string, + +data: ?{| + +text: ?string + |}, + +$refType: PlainUserNameRenderer_name$ref, +|}; +export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; +export type PlainUserNameRenderer_name$key = { + +$data?: PlainUserNameRenderer_name$data, + +$fragmentRefs: PlainUserNameRenderer_name$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; +import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; +export type NameRendererQueryVariables = {||}; +export type NameRendererQueryResponse = {| + +me: ?{| + +nameRenderer: ?{| + +__fragmentPropName?: ?string, + +__module_component?: ?string, + +$fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, + |} + |} +|}; +export type NameRendererQuery = {| + variables: NameRendererQueryVariables, + response: NameRendererQueryResponse, +|}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type MarkdownUserNameRenderer_name$ref: FragmentReference; +declare export opaque type MarkdownUserNameRenderer_name$fragmentType: MarkdownUserNameRenderer_name$ref; +export type MarkdownUserNameRenderer_name = {| + +markdown: ?string, + +data: ?{| + +markup: ?string + |}, + +$refType: MarkdownUserNameRenderer_name$ref, +|}; +export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; +export type MarkdownUserNameRenderer_name$key = { + +$data?: MarkdownUserNameRenderer_name$data, + +$fragmentRefs: MarkdownUserNameRenderer_name$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type PlainUserNameRenderer_name$ref: FragmentReference; +declare export opaque type PlainUserNameRenderer_name$fragmentType: PlainUserNameRenderer_name$ref; +export type PlainUserNameRenderer_name = {| + +plaintext: ?string, + +data: ?{| + +text: ?string + |}, + +$refType: PlainUserNameRenderer_name$ref, +|}; +export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; +export type PlainUserNameRenderer_name$key = { + +$data?: PlainUserNameRenderer_name$data, + +$fragmentRefs: PlainUserNameRenderer_name$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + +import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; +import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; export type NameRendererQueryVariables = {||}; export type NameRendererQueryResponse = {| +me: ?{| diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/match-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/match-field.expected index 789f426ca7cea..004ad90cedff7 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/match-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/match-field.expected @@ -22,6 +22,191 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type MarkdownUserNameRenderer_name$ref: FragmentReference; +declare export opaque type MarkdownUserNameRenderer_name$fragmentType: MarkdownUserNameRenderer_name$ref; +export type MarkdownUserNameRenderer_name = {| + +markdown: ?string, + +data: ?{| + +markup: ?string + |}, + +$refType: MarkdownUserNameRenderer_name$ref, +|}; +export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; +export type MarkdownUserNameRenderer_name$key = { + +$data?: MarkdownUserNameRenderer_name$data, + +$fragmentRefs: MarkdownUserNameRenderer_name$ref, + ... +}; +------------------------------------------------------------------------------- +import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; +import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type NameRendererFragment$ref: FragmentReference; +declare export opaque type NameRendererFragment$fragmentType: NameRendererFragment$ref; +export type NameRendererFragment = {| + +id: string, + +nameRenderer: ?{| + +__fragmentPropName?: ?string, + +__module_component?: ?string, + +$fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, + |}, + +$refType: NameRendererFragment$ref, +|}; +export type NameRendererFragment$data = NameRendererFragment; +export type NameRendererFragment$key = { + +$data?: NameRendererFragment$data, + +$fragmentRefs: NameRendererFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type PlainUserNameRenderer_name$ref: FragmentReference; +declare export opaque type PlainUserNameRenderer_name$fragmentType: PlainUserNameRenderer_name$ref; +export type PlainUserNameRenderer_name = {| + +plaintext: ?string, + +data: ?{| + +text: ?string + |}, + +$refType: PlainUserNameRenderer_name$ref, +|}; +export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; +export type PlainUserNameRenderer_name$key = { + +$data?: PlainUserNameRenderer_name$data, + +$fragmentRefs: PlainUserNameRenderer_name$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type MarkdownUserNameRenderer_name$ref: FragmentReference; +declare export opaque type MarkdownUserNameRenderer_name$fragmentType: MarkdownUserNameRenderer_name$ref; +export type MarkdownUserNameRenderer_name = {| + +markdown: ?string, + +data: ?{| + +markup: ?string + |}, + +$refType: MarkdownUserNameRenderer_name$ref, +|}; +export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; +export type MarkdownUserNameRenderer_name$key = { + +$data?: MarkdownUserNameRenderer_name$data, + +$fragmentRefs: MarkdownUserNameRenderer_name$ref, + ... +}; +------------------------------------------------------------------------------- +import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; +import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type NameRendererFragment$ref: FragmentReference; +declare export opaque type NameRendererFragment$fragmentType: NameRendererFragment$ref; +export type NameRendererFragment = {| + +id: string, + +nameRenderer: ?{| + +__fragmentPropName?: ?string, + +__module_component?: ?string, + +$fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, + |}, + +$refType: NameRendererFragment$ref, +|}; +export type NameRendererFragment$data = NameRendererFragment; +export type NameRendererFragment$key = { + +$data?: NameRendererFragment$data, + +$fragmentRefs: NameRendererFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type PlainUserNameRenderer_name$ref: FragmentReference; +declare export opaque type PlainUserNameRenderer_name$fragmentType: PlainUserNameRenderer_name$ref; +export type PlainUserNameRenderer_name = {| + +plaintext: ?string, + +data: ?{| + +text: ?string + |}, + +$refType: PlainUserNameRenderer_name$ref, +|}; +export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; +export type PlainUserNameRenderer_name$key = { + +$data?: PlainUserNameRenderer_name$data, + +$fragmentRefs: PlainUserNameRenderer_name$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type MarkdownUserNameRenderer_name$ref: FragmentReference; +declare export opaque type MarkdownUserNameRenderer_name$fragmentType: MarkdownUserNameRenderer_name$ref; +export type MarkdownUserNameRenderer_name = {| + +markdown: ?string, + +data: ?{| + +markup: ?string + |}, + +$refType: MarkdownUserNameRenderer_name$ref, +|}; +export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; +export type MarkdownUserNameRenderer_name$key = { + +$data?: MarkdownUserNameRenderer_name$data, + +$fragmentRefs: MarkdownUserNameRenderer_name$ref, + ... +}; +------------------------------------------------------------------------------- +import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; +import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type NameRendererFragment$ref: FragmentReference; +declare export opaque type NameRendererFragment$fragmentType: NameRendererFragment$ref; +export type NameRendererFragment = {| + +id: string, + +nameRenderer: ?{| + +__fragmentPropName?: ?string, + +__module_component?: ?string, + +$fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, + |}, + +$refType: NameRendererFragment$ref, +|}; +export type NameRendererFragment$data = NameRendererFragment; +export type NameRendererFragment$key = { + +$data?: NameRendererFragment$data, + +$fragmentRefs: NameRendererFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type PlainUserNameRenderer_name$ref: FragmentReference; +declare export opaque type PlainUserNameRenderer_name$fragmentType: PlainUserNameRenderer_name$ref; +export type PlainUserNameRenderer_name = {| + +plaintext: ?string, + +data: ?{| + +text: ?string + |}, + +$refType: PlainUserNameRenderer_name$ref, +|}; +export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; +export type PlainUserNameRenderer_name$key = { + +$data?: PlainUserNameRenderer_name$data, + +$fragmentRefs: PlainUserNameRenderer_name$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import type { FragmentReference } from "relay-runtime"; declare export opaque type MarkdownUserNameRenderer_name$ref: FragmentReference; declare export opaque type MarkdownUserNameRenderer_name$fragmentType: MarkdownUserNameRenderer_name$ref; @@ -39,8 +224,8 @@ export type MarkdownUserNameRenderer_name$key = { ... }; ------------------------------------------------------------------------------- -import type { MarkdownUserNameRenderer_name$ref } from "./MarkdownUserNameRenderer_name.graphql"; -import type { PlainUserNameRenderer_name$ref } from "./PlainUserNameRenderer_name.graphql"; +import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; +import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; import type { FragmentReference } from "relay-runtime"; declare export opaque type NameRendererFragment$ref: FragmentReference; declare export opaque type NameRendererFragment$fragmentType: NameRendererFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-input-has-array.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-input-has-array.expected index 6a3454c07951e..09fe473a92923 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-input-has-array.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-input-has-array.expected @@ -7,6 +7,110 @@ mutation InputHasArray($input: UpdateAllSeenStateInput) @raw_response_type { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type UpdateAllSeenStateInput = {| + clientMutationId?: ?string, + storyIds?: ?$ReadOnlyArray, +|}; +export type InputHasArrayVariables = {| + input?: ?UpdateAllSeenStateInput +|}; +export type InputHasArrayResponse = {| + +viewerNotificationsUpdateAllSeenState: ?{| + +stories: ?$ReadOnlyArray + |} +|}; +export type InputHasArrayRawResponse = {| + +viewerNotificationsUpdateAllSeenState: ?{| + +stories: ?$ReadOnlyArray + |} +|}; +export type InputHasArray = {| + variables: InputHasArrayVariables, + response: InputHasArrayResponse, + rawResponse: InputHasArrayRawResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type UpdateAllSeenStateInput = {| + clientMutationId?: ?string, + storyIds?: ?$ReadOnlyArray, +|}; +export type InputHasArrayVariables = {| + input?: ?UpdateAllSeenStateInput +|}; +export type InputHasArrayResponse = {| + +viewerNotificationsUpdateAllSeenState: ?{| + +stories: ?$ReadOnlyArray + |} +|}; +export type InputHasArrayRawResponse = {| + +viewerNotificationsUpdateAllSeenState: ?{| + +stories: ?$ReadOnlyArray + |} +|}; +export type InputHasArray = {| + variables: InputHasArrayVariables, + response: InputHasArrayResponse, + rawResponse: InputHasArrayRawResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type UpdateAllSeenStateInput = {| + clientMutationId?: ?string, + storyIds?: ?$ReadOnlyArray, +|}; +export type InputHasArrayVariables = {| + input?: ?UpdateAllSeenStateInput +|}; +export type InputHasArrayResponse = {| + +viewerNotificationsUpdateAllSeenState: ?{| + +stories: ?$ReadOnlyArray + |} +|}; +export type InputHasArrayRawResponse = {| + +viewerNotificationsUpdateAllSeenState: ?{| + +stories: ?$ReadOnlyArray + |} +|}; +export type InputHasArray = {| + variables: InputHasArrayVariables, + response: InputHasArrayResponse, + rawResponse: InputHasArrayRawResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type UpdateAllSeenStateInput = {| clientMutationId?: ?string, storyIds?: ?$ReadOnlyArray, diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-client-extension.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-client-extension.expected index 19a6626bbbe1c..e7ddf22d15ab8 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-client-extension.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-client-extension.expected @@ -19,6 +19,122 @@ type Foo { bar: String } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type UpdateAllSeenStateInput = {| + clientMutationId?: ?string, + storyIds?: ?$ReadOnlyArray, +|}; +export type TestVariables = {| + input?: ?UpdateAllSeenStateInput +|}; +export type TestResponse = {| + +viewerNotificationsUpdateAllSeenState: ?{| + +stories: ?$ReadOnlyArray + |}> + |} +|}; +export type TestRawResponse = {| + +viewerNotificationsUpdateAllSeenState: ?{| + +stories: ?$ReadOnlyArray, + |}> + |} +|}; +export type Test = {| + variables: TestVariables, + response: TestResponse, + rawResponse: TestRawResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type UpdateAllSeenStateInput = {| + clientMutationId?: ?string, + storyIds?: ?$ReadOnlyArray, +|}; +export type TestVariables = {| + input?: ?UpdateAllSeenStateInput +|}; +export type TestResponse = {| + +viewerNotificationsUpdateAllSeenState: ?{| + +stories: ?$ReadOnlyArray + |}> + |} +|}; +export type TestRawResponse = {| + +viewerNotificationsUpdateAllSeenState: ?{| + +stories: ?$ReadOnlyArray, + |}> + |} +|}; +export type Test = {| + variables: TestVariables, + response: TestResponse, + rawResponse: TestRawResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type UpdateAllSeenStateInput = {| + clientMutationId?: ?string, + storyIds?: ?$ReadOnlyArray, +|}; +export type TestVariables = {| + input?: ?UpdateAllSeenStateInput +|}; +export type TestResponse = {| + +viewerNotificationsUpdateAllSeenState: ?{| + +stories: ?$ReadOnlyArray + |}> + |} +|}; +export type TestRawResponse = {| + +viewerNotificationsUpdateAllSeenState: ?{| + +stories: ?$ReadOnlyArray, + |}> + |} +|}; +export type Test = {| + variables: TestVariables, + response: TestResponse, + rawResponse: TestRawResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type UpdateAllSeenStateInput = {| clientMutationId?: ?string, storyIds?: ?$ReadOnlyArray, diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-enums-on-fragment.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-enums-on-fragment.expected index 01835bbdc26a8..7ae582ac1e81a 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-enums-on-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-enums-on-fragment.expected @@ -27,7 +27,261 @@ fragment FriendFragment on User { } } ==================================== OUTPUT =================================== -import type { FriendFragment$ref } from "./FriendFragment.graphql"; +/* + * future proof enums: false + * future proof abstract types: false + */ + +import type { FriendFragment$ref } from "FriendFragment.graphql"; +export type TestEnums = "mark" | "zuck"; +export type CommentCreateInput = {| + clientMutationId?: ?string, + feedbackId?: ?string, + feedback?: ?CommentfeedbackFeedback, +|}; +export type CommentfeedbackFeedback = {| + comment?: ?FeedbackcommentComment +|}; +export type FeedbackcommentComment = {| + feedback?: ?CommentfeedbackFeedback +|}; +export type CommentCreateMutationVariables = {| + input: CommentCreateInput, + first?: ?number, + orderBy?: ?$ReadOnlyArray, +|}; +export type CommentCreateMutationResponse = {| + +commentCreate: ?{| + +comment: ?{| + +friends: ?{| + +edges: ?$ReadOnlyArray + |} + |} + |} +|}; +export type CommentCreateMutationRawResponse = {| + +commentCreate: ?{| + +comment: ?{| + +friends: ?{| + +edges: ?$ReadOnlyArray + |}, + +id: string, + |} + |} +|}; +export type CommentCreateMutation = {| + variables: CommentCreateMutationVariables, + response: CommentCreateMutationResponse, + rawResponse: CommentCreateMutationRawResponse, +|}; +------------------------------------------------------------------------------- +export type TestEnums = "mark" | "zuck"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type FriendFragment$ref: FragmentReference; +declare export opaque type FriendFragment$fragmentType: FriendFragment$ref; +export type FriendFragment = {| + +name: ?string, + +lastName: ?string, + +profilePicture2: ?{| + +test_enums: ?TestEnums + |}, + +$refType: FriendFragment$ref, +|}; +export type FriendFragment$data = FriendFragment; +export type FriendFragment$key = { + +$data?: FriendFragment$data, + +$fragmentRefs: FriendFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import type { FriendFragment$ref } from "FriendFragment.graphql"; +export type TestEnums = "mark" | "zuck" | "%future added value"; +export type CommentCreateInput = {| + clientMutationId?: ?string, + feedbackId?: ?string, + feedback?: ?CommentfeedbackFeedback, +|}; +export type CommentfeedbackFeedback = {| + comment?: ?FeedbackcommentComment +|}; +export type FeedbackcommentComment = {| + feedback?: ?CommentfeedbackFeedback +|}; +export type CommentCreateMutationVariables = {| + input: CommentCreateInput, + first?: ?number, + orderBy?: ?$ReadOnlyArray, +|}; +export type CommentCreateMutationResponse = {| + +commentCreate: ?{| + +comment: ?{| + +friends: ?{| + +edges: ?$ReadOnlyArray + |} + |} + |} +|}; +export type CommentCreateMutationRawResponse = {| + +commentCreate: ?{| + +comment: ?{| + +friends: ?{| + +edges: ?$ReadOnlyArray + |}, + +id: string, + |} + |} +|}; +export type CommentCreateMutation = {| + variables: CommentCreateMutationVariables, + response: CommentCreateMutationResponse, + rawResponse: CommentCreateMutationRawResponse, +|}; +------------------------------------------------------------------------------- +export type TestEnums = "mark" | "zuck" | "%future added value"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type FriendFragment$ref: FragmentReference; +declare export opaque type FriendFragment$fragmentType: FriendFragment$ref; +export type FriendFragment = {| + +name: ?string, + +lastName: ?string, + +profilePicture2: ?{| + +test_enums: ?TestEnums + |}, + +$refType: FriendFragment$ref, +|}; +export type FriendFragment$data = FriendFragment; +export type FriendFragment$key = { + +$data?: FriendFragment$data, + +$fragmentRefs: FriendFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import type { FriendFragment$ref } from "FriendFragment.graphql"; +export type TestEnums = "mark" | "zuck"; +export type CommentCreateInput = {| + clientMutationId?: ?string, + feedbackId?: ?string, + feedback?: ?CommentfeedbackFeedback, +|}; +export type CommentfeedbackFeedback = {| + comment?: ?FeedbackcommentComment +|}; +export type FeedbackcommentComment = {| + feedback?: ?CommentfeedbackFeedback +|}; +export type CommentCreateMutationVariables = {| + input: CommentCreateInput, + first?: ?number, + orderBy?: ?$ReadOnlyArray, +|}; +export type CommentCreateMutationResponse = {| + +commentCreate: ?{| + +comment: ?{| + +friends: ?{| + +edges: ?$ReadOnlyArray + |} + |} + |} +|}; +export type CommentCreateMutationRawResponse = {| + +commentCreate: ?{| + +comment: ?{| + +friends: ?{| + +edges: ?$ReadOnlyArray + |}, + +id: string, + |} + |} +|}; +export type CommentCreateMutation = {| + variables: CommentCreateMutationVariables, + response: CommentCreateMutationResponse, + rawResponse: CommentCreateMutationRawResponse, +|}; +------------------------------------------------------------------------------- +export type TestEnums = "mark" | "zuck"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type FriendFragment$ref: FragmentReference; +declare export opaque type FriendFragment$fragmentType: FriendFragment$ref; +export type FriendFragment = {| + +name: ?string, + +lastName: ?string, + +profilePicture2: ?{| + +test_enums: ?TestEnums + |}, + +$refType: FriendFragment$ref, +|}; +export type FriendFragment$data = FriendFragment; +export type FriendFragment$key = { + +$data?: FriendFragment$data, + +$fragmentRefs: FriendFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + +import type { FriendFragment$ref } from "FriendFragment.graphql"; export type TestEnums = "mark" | "zuck" | "%future added value"; export type CommentCreateInput = {| clientMutationId?: ?string, diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-nested-fragments.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-nested-fragments.expected index 35975ec793652..4bad28674aaca 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-nested-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-nested-fragments.expected @@ -31,7 +31,300 @@ fragment FeedbackFragment on Feedback { name } ==================================== OUTPUT =================================== -import type { FriendFragment$ref } from "./FriendFragment.graphql"; +/* + * future proof enums: false + * future proof abstract types: false + */ + +import type { FriendFragment$ref } from "FriendFragment.graphql"; +export type CommentCreateInput = {| + clientMutationId?: ?string, + feedbackId?: ?string, + feedback?: ?CommentfeedbackFeedback, +|}; +export type CommentfeedbackFeedback = {| + comment?: ?FeedbackcommentComment +|}; +export type FeedbackcommentComment = {| + feedback?: ?CommentfeedbackFeedback +|}; +export type CommentCreateMutationVariables = {| + input: CommentCreateInput, + first?: ?number, + orderBy?: ?$ReadOnlyArray, +|}; +export type CommentCreateMutationResponse = {| + +commentCreate: ?{| + +comment: ?{| + +friends: ?{| + +edges: ?$ReadOnlyArray + |} + |} + |} +|}; +export type CommentCreateMutationRawResponse = {| + +commentCreate: ?{| + +comment: ?{| + +friends: ?{| + +edges: ?$ReadOnlyArray + |}, + +id: string, + |} + |} +|}; +export type CommentCreateMutation = {| + variables: CommentCreateMutationVariables, + response: CommentCreateMutationResponse, + rawResponse: CommentCreateMutationRawResponse, +|}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type FeedbackFragment$ref: FragmentReference; +declare export opaque type FeedbackFragment$fragmentType: FeedbackFragment$ref; +export type FeedbackFragment = {| + +id: string, + +name: ?string, + +$refType: FeedbackFragment$ref, +|}; +export type FeedbackFragment$data = FeedbackFragment; +export type FeedbackFragment$key = { + +$data?: FeedbackFragment$data, + +$fragmentRefs: FeedbackFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FeedbackFragment$ref } from "FeedbackFragment.graphql"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type FriendFragment$ref: FragmentReference; +declare export opaque type FriendFragment$fragmentType: FriendFragment$ref; +export type FriendFragment = {| + +name: ?string, + +lastName: ?string, + +feedback: ?{| + +$fragmentRefs: FeedbackFragment$ref + |}, + +$refType: FriendFragment$ref, +|}; +export type FriendFragment$data = FriendFragment; +export type FriendFragment$key = { + +$data?: FriendFragment$data, + +$fragmentRefs: FriendFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import type { FriendFragment$ref } from "FriendFragment.graphql"; +export type CommentCreateInput = {| + clientMutationId?: ?string, + feedbackId?: ?string, + feedback?: ?CommentfeedbackFeedback, +|}; +export type CommentfeedbackFeedback = {| + comment?: ?FeedbackcommentComment +|}; +export type FeedbackcommentComment = {| + feedback?: ?CommentfeedbackFeedback +|}; +export type CommentCreateMutationVariables = {| + input: CommentCreateInput, + first?: ?number, + orderBy?: ?$ReadOnlyArray, +|}; +export type CommentCreateMutationResponse = {| + +commentCreate: ?{| + +comment: ?{| + +friends: ?{| + +edges: ?$ReadOnlyArray + |} + |} + |} +|}; +export type CommentCreateMutationRawResponse = {| + +commentCreate: ?{| + +comment: ?{| + +friends: ?{| + +edges: ?$ReadOnlyArray + |}, + +id: string, + |} + |} +|}; +export type CommentCreateMutation = {| + variables: CommentCreateMutationVariables, + response: CommentCreateMutationResponse, + rawResponse: CommentCreateMutationRawResponse, +|}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type FeedbackFragment$ref: FragmentReference; +declare export opaque type FeedbackFragment$fragmentType: FeedbackFragment$ref; +export type FeedbackFragment = {| + +id: string, + +name: ?string, + +$refType: FeedbackFragment$ref, +|}; +export type FeedbackFragment$data = FeedbackFragment; +export type FeedbackFragment$key = { + +$data?: FeedbackFragment$data, + +$fragmentRefs: FeedbackFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FeedbackFragment$ref } from "FeedbackFragment.graphql"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type FriendFragment$ref: FragmentReference; +declare export opaque type FriendFragment$fragmentType: FriendFragment$ref; +export type FriendFragment = {| + +name: ?string, + +lastName: ?string, + +feedback: ?{| + +$fragmentRefs: FeedbackFragment$ref + |}, + +$refType: FriendFragment$ref, +|}; +export type FriendFragment$data = FriendFragment; +export type FriendFragment$key = { + +$data?: FriendFragment$data, + +$fragmentRefs: FriendFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import type { FriendFragment$ref } from "FriendFragment.graphql"; +export type CommentCreateInput = {| + clientMutationId?: ?string, + feedbackId?: ?string, + feedback?: ?CommentfeedbackFeedback, +|}; +export type CommentfeedbackFeedback = {| + comment?: ?FeedbackcommentComment +|}; +export type FeedbackcommentComment = {| + feedback?: ?CommentfeedbackFeedback +|}; +export type CommentCreateMutationVariables = {| + input: CommentCreateInput, + first?: ?number, + orderBy?: ?$ReadOnlyArray, +|}; +export type CommentCreateMutationResponse = {| + +commentCreate: ?{| + +comment: ?{| + +friends: ?{| + +edges: ?$ReadOnlyArray + |} + |} + |} +|}; +export type CommentCreateMutationRawResponse = {| + +commentCreate: ?{| + +comment: ?{| + +friends: ?{| + +edges: ?$ReadOnlyArray + |}, + +id: string, + |} + |} +|}; +export type CommentCreateMutation = {| + variables: CommentCreateMutationVariables, + response: CommentCreateMutationResponse, + rawResponse: CommentCreateMutationRawResponse, +|}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type FeedbackFragment$ref: FragmentReference; +declare export opaque type FeedbackFragment$fragmentType: FeedbackFragment$ref; +export type FeedbackFragment = {| + +id: string, + +name: ?string, + +$refType: FeedbackFragment$ref, +|}; +export type FeedbackFragment$data = FeedbackFragment; +export type FeedbackFragment$key = { + +$data?: FeedbackFragment$data, + +$fragmentRefs: FeedbackFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FeedbackFragment$ref } from "FeedbackFragment.graphql"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type FriendFragment$ref: FragmentReference; +declare export opaque type FriendFragment$fragmentType: FriendFragment$ref; +export type FriendFragment = {| + +name: ?string, + +lastName: ?string, + +feedback: ?{| + +$fragmentRefs: FeedbackFragment$ref + |}, + +$refType: FriendFragment$ref, +|}; +export type FriendFragment$data = FriendFragment; +export type FriendFragment$key = { + +$data?: FriendFragment$data, + +$fragmentRefs: FriendFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + +import type { FriendFragment$ref } from "FriendFragment.graphql"; export type CommentCreateInput = {| clientMutationId?: ?string, feedbackId?: ?string, @@ -103,7 +396,7 @@ export type FeedbackFragment$key = { ... }; ------------------------------------------------------------------------------- -import type { FeedbackFragment$ref } from "./FeedbackFragment.graphql"; +import type { FeedbackFragment$ref } from "FeedbackFragment.graphql"; import type { FragmentReference } from "relay-runtime"; declare export opaque type FriendFragment$ref: FragmentReference; declare export opaque type FriendFragment$fragmentType: FriendFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-response-on-inline-fragments.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-response-on-inline-fragments.expected index eb34ae90c06f7..f9f2eb2c36465 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-response-on-inline-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-response-on-inline-fragments.expected @@ -27,7 +27,270 @@ fragment InlineFragmentWithOverlappingFields on Actor { } } ==================================== OUTPUT =================================== -import type { InlineFragmentWithOverlappingFields$ref } from "./InlineFragmentWithOverlappingFields.graphql"; +/* + * future proof enums: false + * future proof abstract types: false + */ + +import type { InlineFragmentWithOverlappingFields$ref } from "InlineFragmentWithOverlappingFields.graphql"; +export type CommentCreateInput = {| + clientMutationId?: ?string, + feedbackId?: ?string, + feedback?: ?CommentfeedbackFeedback, +|}; +export type CommentfeedbackFeedback = {| + comment?: ?FeedbackcommentComment +|}; +export type FeedbackcommentComment = {| + feedback?: ?CommentfeedbackFeedback +|}; +export type TestMutationVariables = {| + input: CommentCreateInput +|}; +export type TestMutationResponse = {| + +commentCreate: ?{| + +viewer: ?{| + +actor: ?{| + +$fragmentRefs: InlineFragmentWithOverlappingFields$ref + |} + |} + |} +|}; +export type TestMutationRawResponse = {| + +commentCreate: ?{| + +viewer: ?{| + +actor: ?({| + +__typename: "User", + +__isActor: "User", + +id: string, + +hometown: ?{| + +id: string, + +name: ?string, + |}, + |} | {| + +__typename: "Page", + +__isActor: "Page", + +id: string, + +name: ?string, + +hometown: ?{| + +id: string, + +message: ?{| + +text: ?string + |}, + |}, + |} | {| + +__typename: string, + +__isActor: string, + +id: string, + |}) + |} + |} +|}; +export type TestMutation = {| + variables: TestMutationVariables, + response: TestMutationResponse, + rawResponse: TestMutationRawResponse, +|}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type InlineFragmentWithOverlappingFields$ref: FragmentReference; +declare export opaque type InlineFragmentWithOverlappingFields$fragmentType: InlineFragmentWithOverlappingFields$ref; +export type InlineFragmentWithOverlappingFields = {| + +hometown?: ?{| + +id: string, + +name: ?string, + +message?: ?{| + +text: ?string + |}, + |}, + +name?: ?string, + +$refType: InlineFragmentWithOverlappingFields$ref, +|}; +export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; +export type InlineFragmentWithOverlappingFields$key = { + +$data?: InlineFragmentWithOverlappingFields$data, + +$fragmentRefs: InlineFragmentWithOverlappingFields$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import type { InlineFragmentWithOverlappingFields$ref } from "InlineFragmentWithOverlappingFields.graphql"; +export type CommentCreateInput = {| + clientMutationId?: ?string, + feedbackId?: ?string, + feedback?: ?CommentfeedbackFeedback, +|}; +export type CommentfeedbackFeedback = {| + comment?: ?FeedbackcommentComment +|}; +export type FeedbackcommentComment = {| + feedback?: ?CommentfeedbackFeedback +|}; +export type TestMutationVariables = {| + input: CommentCreateInput +|}; +export type TestMutationResponse = {| + +commentCreate: ?{| + +viewer: ?{| + +actor: ?{| + +$fragmentRefs: InlineFragmentWithOverlappingFields$ref + |} + |} + |} +|}; +export type TestMutationRawResponse = {| + +commentCreate: ?{| + +viewer: ?{| + +actor: ?({| + +__typename: "User", + +__isActor: "User", + +id: string, + +hometown: ?{| + +id: string, + +name: ?string, + |}, + |} | {| + +__typename: "Page", + +__isActor: "Page", + +id: string, + +name: ?string, + +hometown: ?{| + +id: string, + +message: ?{| + +text: ?string + |}, + |}, + |} | {| + +__typename: string, + +__isActor: string, + +id: string, + |}) + |} + |} +|}; +export type TestMutation = {| + variables: TestMutationVariables, + response: TestMutationResponse, + rawResponse: TestMutationRawResponse, +|}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type InlineFragmentWithOverlappingFields$ref: FragmentReference; +declare export opaque type InlineFragmentWithOverlappingFields$fragmentType: InlineFragmentWithOverlappingFields$ref; +export type InlineFragmentWithOverlappingFields = {| + +hometown?: ?{| + +id: string, + +name: ?string, + +message?: ?{| + +text: ?string + |}, + |}, + +name?: ?string, + +$refType: InlineFragmentWithOverlappingFields$ref, +|}; +export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; +export type InlineFragmentWithOverlappingFields$key = { + +$data?: InlineFragmentWithOverlappingFields$data, + +$fragmentRefs: InlineFragmentWithOverlappingFields$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import type { InlineFragmentWithOverlappingFields$ref } from "InlineFragmentWithOverlappingFields.graphql"; +export type CommentCreateInput = {| + clientMutationId?: ?string, + feedbackId?: ?string, + feedback?: ?CommentfeedbackFeedback, +|}; +export type CommentfeedbackFeedback = {| + comment?: ?FeedbackcommentComment +|}; +export type FeedbackcommentComment = {| + feedback?: ?CommentfeedbackFeedback +|}; +export type TestMutationVariables = {| + input: CommentCreateInput +|}; +export type TestMutationResponse = {| + +commentCreate: ?{| + +viewer: ?{| + +actor: ?{| + +$fragmentRefs: InlineFragmentWithOverlappingFields$ref + |} + |} + |} +|}; +export type TestMutationRawResponse = {| + +commentCreate: ?{| + +viewer: ?{| + +actor: ?({| + +__typename: "User", + +__isActor: "User", + +id: string, + +hometown: ?{| + +id: string, + +name: ?string, + |}, + |} | {| + +__typename: "Page", + +__isActor: "Page", + +id: string, + +name: ?string, + +hometown: ?{| + +id: string, + +message: ?{| + +text: ?string + |}, + |}, + |} | {| + +__typename: string, + +__isActor: string, + +id: string, + |}) + |} + |} +|}; +export type TestMutation = {| + variables: TestMutationVariables, + response: TestMutationResponse, + rawResponse: TestMutationRawResponse, +|}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type InlineFragmentWithOverlappingFields$ref: FragmentReference; +declare export opaque type InlineFragmentWithOverlappingFields$fragmentType: InlineFragmentWithOverlappingFields$ref; +export type InlineFragmentWithOverlappingFields = {| + +hometown?: ?{| + +id: string, + +name: ?string, + +message?: ?{| + +text: ?string + |}, + |}, + +name?: ?string, + +$refType: InlineFragmentWithOverlappingFields$ref, +|}; +export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; +export type InlineFragmentWithOverlappingFields$key = { + +$data?: InlineFragmentWithOverlappingFields$data, + +$fragmentRefs: InlineFragmentWithOverlappingFields$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + +import type { InlineFragmentWithOverlappingFields$ref } from "InlineFragmentWithOverlappingFields.graphql"; export type CommentCreateInput = {| clientMutationId?: ?string, feedbackId?: ?string, diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation.expected index 73dfff5c2df67..eb5043a8a1a7b 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation.expected @@ -15,6 +15,122 @@ mutation CommentCreateMutation( } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type CommentCreateInput = {| + clientMutationId?: ?string, + feedbackId?: ?string, + feedback?: ?CommentfeedbackFeedback, +|}; +export type CommentfeedbackFeedback = {| + comment?: ?FeedbackcommentComment +|}; +export type FeedbackcommentComment = {| + feedback?: ?CommentfeedbackFeedback +|}; +export type CommentCreateMutationVariables = {| + input: CommentCreateInput, + first?: ?number, + orderBy?: ?$ReadOnlyArray, +|}; +export type CommentCreateMutationResponse = {| + +commentCreate: ?{| + +comment: ?{| + +id: string, + +name: ?string, + +friends: ?{| + +count: ?number + |}, + |} + |} +|}; +export type CommentCreateMutation = {| + variables: CommentCreateMutationVariables, + response: CommentCreateMutationResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type CommentCreateInput = {| + clientMutationId?: ?string, + feedbackId?: ?string, + feedback?: ?CommentfeedbackFeedback, +|}; +export type CommentfeedbackFeedback = {| + comment?: ?FeedbackcommentComment +|}; +export type FeedbackcommentComment = {| + feedback?: ?CommentfeedbackFeedback +|}; +export type CommentCreateMutationVariables = {| + input: CommentCreateInput, + first?: ?number, + orderBy?: ?$ReadOnlyArray, +|}; +export type CommentCreateMutationResponse = {| + +commentCreate: ?{| + +comment: ?{| + +id: string, + +name: ?string, + +friends: ?{| + +count: ?number + |}, + |} + |} +|}; +export type CommentCreateMutation = {| + variables: CommentCreateMutationVariables, + response: CommentCreateMutationResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type CommentCreateInput = {| + clientMutationId?: ?string, + feedbackId?: ?string, + feedback?: ?CommentfeedbackFeedback, +|}; +export type CommentfeedbackFeedback = {| + comment?: ?FeedbackcommentComment +|}; +export type FeedbackcommentComment = {| + feedback?: ?CommentfeedbackFeedback +|}; +export type CommentCreateMutationVariables = {| + input: CommentCreateInput, + first?: ?number, + orderBy?: ?$ReadOnlyArray, +|}; +export type CommentCreateMutationResponse = {| + +commentCreate: ?{| + +comment: ?{| + +id: string, + +name: ?string, + +friends: ?{| + +count: ?number + |}, + |} + |} +|}; +export type CommentCreateMutation = {| + variables: CommentCreateMutationVariables, + response: CommentCreateMutationResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type CommentCreateInput = {| clientMutationId?: ?string, feedbackId?: ?string, diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/plural-fragment.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/plural-fragment.expected index fdae8055b13dd..f1d8853d4f1fc 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/plural-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/plural-fragment.expected @@ -3,6 +3,68 @@ fragment PluralFragment on Node @relay(plural: true) { id } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type PluralFragment$ref: FragmentReference; +declare export opaque type PluralFragment$fragmentType: PluralFragment$ref; +export type PluralFragment = $ReadOnlyArray<{| + +id: string, + +$refType: PluralFragment$ref, +|}>; +export type PluralFragment$data = PluralFragment; +export type PluralFragment$key = $ReadOnlyArray<{ + +$data?: PluralFragment$data, + +$fragmentRefs: PluralFragment$ref, + ... +}>; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type PluralFragment$ref: FragmentReference; +declare export opaque type PluralFragment$fragmentType: PluralFragment$ref; +export type PluralFragment = $ReadOnlyArray<{| + +id: string, + +$refType: PluralFragment$ref, +|}>; +export type PluralFragment$data = PluralFragment; +export type PluralFragment$key = $ReadOnlyArray<{ + +$data?: PluralFragment$data, + +$fragmentRefs: PluralFragment$ref, + ... +}>; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type PluralFragment$ref: FragmentReference; +declare export opaque type PluralFragment$fragmentType: PluralFragment$ref; +export type PluralFragment = $ReadOnlyArray<{| + +id: string, + +$refType: PluralFragment$ref, +|}>; +export type PluralFragment$data = PluralFragment; +export type PluralFragment$key = $ReadOnlyArray<{ + +$data?: PluralFragment$data, + +$fragmentRefs: PluralFragment$ref, + ... +}>; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import type { FragmentReference } from "relay-runtime"; declare export opaque type PluralFragment$ref: FragmentReference; declare export opaque type PluralFragment$fragmentType: PluralFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-handles.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-handles.expected index 54fdc48eb8006..b66e2cf7b64a8 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-handles.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-handles.expected @@ -17,6 +17,182 @@ query ScalarHandleField($id: ID!) @raw_response_type { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type LinkedHandleFieldVariables = {| + id: string +|}; +export type LinkedHandleFieldResponse = {| + +node: ?{| + +friends?: ?{| + +count: ?number + |} + |} +|}; +export type LinkedHandleFieldRawResponse = {| + +node: ?({| + +__typename: "User", + +id: string, + +friends: ?{| + +count: ?number + |}, + |} | {| + +__typename: string, + +id: string, + |}) +|}; +export type LinkedHandleField = {| + variables: LinkedHandleFieldVariables, + response: LinkedHandleFieldResponse, + rawResponse: LinkedHandleFieldRawResponse, +|}; +------------------------------------------------------------------------------- +export type ScalarHandleFieldVariables = {| + id: string +|}; +export type ScalarHandleFieldResponse = {| + +node: ?{| + +name?: ?string + |} +|}; +export type ScalarHandleFieldRawResponse = {| + +node: ?({| + +__typename: "User", + +id: string, + +name: ?string, + |} | {| + +__typename: string, + +id: string, + |}) +|}; +export type ScalarHandleField = {| + variables: ScalarHandleFieldVariables, + response: ScalarHandleFieldResponse, + rawResponse: ScalarHandleFieldRawResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type LinkedHandleFieldVariables = {| + id: string +|}; +export type LinkedHandleFieldResponse = {| + +node: ?{| + +friends?: ?{| + +count: ?number + |} + |} +|}; +export type LinkedHandleFieldRawResponse = {| + +node: ?({| + +__typename: "User", + +id: string, + +friends: ?{| + +count: ?number + |}, + |} | {| + +__typename: string, + +id: string, + |}) +|}; +export type LinkedHandleField = {| + variables: LinkedHandleFieldVariables, + response: LinkedHandleFieldResponse, + rawResponse: LinkedHandleFieldRawResponse, +|}; +------------------------------------------------------------------------------- +export type ScalarHandleFieldVariables = {| + id: string +|}; +export type ScalarHandleFieldResponse = {| + +node: ?{| + +name?: ?string + |} +|}; +export type ScalarHandleFieldRawResponse = {| + +node: ?({| + +__typename: "User", + +id: string, + +name: ?string, + |} | {| + +__typename: string, + +id: string, + |}) +|}; +export type ScalarHandleField = {| + variables: ScalarHandleFieldVariables, + response: ScalarHandleFieldResponse, + rawResponse: ScalarHandleFieldRawResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type LinkedHandleFieldVariables = {| + id: string +|}; +export type LinkedHandleFieldResponse = {| + +node: ?{| + +friends?: ?{| + +count: ?number + |} + |} +|}; +export type LinkedHandleFieldRawResponse = {| + +node: ?({| + +__typename: "User", + +id: string, + +friends: ?{| + +count: ?number + |}, + |} | {| + +__typename: string, + +id: string, + |}) +|}; +export type LinkedHandleField = {| + variables: LinkedHandleFieldVariables, + response: LinkedHandleFieldResponse, + rawResponse: LinkedHandleFieldRawResponse, +|}; +------------------------------------------------------------------------------- +export type ScalarHandleFieldVariables = {| + id: string +|}; +export type ScalarHandleFieldResponse = {| + +node: ?{| + +name?: ?string + |} +|}; +export type ScalarHandleFieldRawResponse = {| + +node: ?({| + +__typename: "User", + +id: string, + +name: ?string, + |} | {| + +__typename: string, + +id: string, + |}) +|}; +export type ScalarHandleField = {| + variables: ScalarHandleFieldVariables, + response: ScalarHandleFieldResponse, + rawResponse: ScalarHandleFieldRawResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type LinkedHandleFieldVariables = {| id: string |}; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-match-fields.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-match-fields.expected index 5c6f8ac1b4f35..75a8f30e484a9 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-match-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-match-fields.expected @@ -28,8 +28,361 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import type { Local3DPayload } from "relay-runtime"; +import type { NameRendererFragment$ref } from "NameRendererFragment.graphql"; +export type TestVariables = {||}; +export type TestResponse = {| + +node: ?{| + +$fragmentRefs: NameRendererFragment$ref + |} +|}; +export type PlainUserNameRenderer_name = {| + +plaintext: ?string, + +data: ?{| + +text: ?string, + +id: ?string, + |}, +|}; +export type MarkdownUserNameRenderer_name = {| + +markdown: ?string, + +data: ?{| + +markup: ?string, + +id: ?string, + |}, +|}; +export type TestRawResponse = {| + +node: ?({| + +__typename: "User", + +id: string, + +nameRenderer: ?({| + +__typename: "PlainUserNameRenderer", + +__module_operation_NameRendererFragment: ?any, + +__module_component_NameRendererFragment: ?any, + ...PlainUserNameRenderer_name, + |} | Local3DPayload<"NameRendererFragment", {| + +__typename: "PlainUserNameRenderer", + ...PlainUserNameRenderer_name, + |}> | {| + +__typename: "MarkdownUserNameRenderer", + +__module_operation_NameRendererFragment: ?any, + +__module_component_NameRendererFragment: ?any, + ...MarkdownUserNameRenderer_name, + |} | Local3DPayload<"NameRendererFragment", {| + +__typename: "MarkdownUserNameRenderer", + ...MarkdownUserNameRenderer_name, + |}> | {| + +__typename: string + |}), + |} | {| + +__typename: string, + +id: string, + |}) +|}; +export type Test = {| + variables: TestVariables, + response: TestResponse, + rawResponse: TestRawResponse, +|}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type MarkdownUserNameRenderer_name$ref: FragmentReference; +declare export opaque type MarkdownUserNameRenderer_name$fragmentType: MarkdownUserNameRenderer_name$ref; +export type MarkdownUserNameRenderer_name = {| + +markdown: ?string, + +data: ?{| + +markup: ?string + |}, + +$refType: MarkdownUserNameRenderer_name$ref, +|}; +export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; +export type MarkdownUserNameRenderer_name$key = { + +$data?: MarkdownUserNameRenderer_name$data, + +$fragmentRefs: MarkdownUserNameRenderer_name$ref, + ... +}; +------------------------------------------------------------------------------- +import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; +import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type NameRendererFragment$ref: FragmentReference; +declare export opaque type NameRendererFragment$fragmentType: NameRendererFragment$ref; +export type NameRendererFragment = {| + +id: string, + +nameRenderer: ?{| + +__fragmentPropName?: ?string, + +__module_component?: ?string, + +$fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, + |}, + +$refType: NameRendererFragment$ref, +|}; +export type NameRendererFragment$data = NameRendererFragment; +export type NameRendererFragment$key = { + +$data?: NameRendererFragment$data, + +$fragmentRefs: NameRendererFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type PlainUserNameRenderer_name$ref: FragmentReference; +declare export opaque type PlainUserNameRenderer_name$fragmentType: PlainUserNameRenderer_name$ref; +export type PlainUserNameRenderer_name = {| + +plaintext: ?string, + +data: ?{| + +text: ?string + |}, + +$refType: PlainUserNameRenderer_name$ref, +|}; +export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; +export type PlainUserNameRenderer_name$key = { + +$data?: PlainUserNameRenderer_name$data, + +$fragmentRefs: PlainUserNameRenderer_name$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import type { Local3DPayload } from "relay-runtime"; +import type { NameRendererFragment$ref } from "NameRendererFragment.graphql"; +export type TestVariables = {||}; +export type TestResponse = {| + +node: ?{| + +$fragmentRefs: NameRendererFragment$ref + |} +|}; +export type PlainUserNameRenderer_name = {| + +plaintext: ?string, + +data: ?{| + +text: ?string, + +id: ?string, + |}, +|}; +export type MarkdownUserNameRenderer_name = {| + +markdown: ?string, + +data: ?{| + +markup: ?string, + +id: ?string, + |}, +|}; +export type TestRawResponse = {| + +node: ?({| + +__typename: "User", + +id: string, + +nameRenderer: ?({| + +__typename: "PlainUserNameRenderer", + +__module_operation_NameRendererFragment: ?any, + +__module_component_NameRendererFragment: ?any, + ...PlainUserNameRenderer_name, + |} | Local3DPayload<"NameRendererFragment", {| + +__typename: "PlainUserNameRenderer", + ...PlainUserNameRenderer_name, + |}> | {| + +__typename: "MarkdownUserNameRenderer", + +__module_operation_NameRendererFragment: ?any, + +__module_component_NameRendererFragment: ?any, + ...MarkdownUserNameRenderer_name, + |} | Local3DPayload<"NameRendererFragment", {| + +__typename: "MarkdownUserNameRenderer", + ...MarkdownUserNameRenderer_name, + |}> | {| + +__typename: string + |}), + |} | {| + +__typename: string, + +id: string, + |}) +|}; +export type Test = {| + variables: TestVariables, + response: TestResponse, + rawResponse: TestRawResponse, +|}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type MarkdownUserNameRenderer_name$ref: FragmentReference; +declare export opaque type MarkdownUserNameRenderer_name$fragmentType: MarkdownUserNameRenderer_name$ref; +export type MarkdownUserNameRenderer_name = {| + +markdown: ?string, + +data: ?{| + +markup: ?string + |}, + +$refType: MarkdownUserNameRenderer_name$ref, +|}; +export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; +export type MarkdownUserNameRenderer_name$key = { + +$data?: MarkdownUserNameRenderer_name$data, + +$fragmentRefs: MarkdownUserNameRenderer_name$ref, + ... +}; +------------------------------------------------------------------------------- +import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; +import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type NameRendererFragment$ref: FragmentReference; +declare export opaque type NameRendererFragment$fragmentType: NameRendererFragment$ref; +export type NameRendererFragment = {| + +id: string, + +nameRenderer: ?{| + +__fragmentPropName?: ?string, + +__module_component?: ?string, + +$fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, + |}, + +$refType: NameRendererFragment$ref, +|}; +export type NameRendererFragment$data = NameRendererFragment; +export type NameRendererFragment$key = { + +$data?: NameRendererFragment$data, + +$fragmentRefs: NameRendererFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type PlainUserNameRenderer_name$ref: FragmentReference; +declare export opaque type PlainUserNameRenderer_name$fragmentType: PlainUserNameRenderer_name$ref; +export type PlainUserNameRenderer_name = {| + +plaintext: ?string, + +data: ?{| + +text: ?string + |}, + +$refType: PlainUserNameRenderer_name$ref, +|}; +export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; +export type PlainUserNameRenderer_name$key = { + +$data?: PlainUserNameRenderer_name$data, + +$fragmentRefs: PlainUserNameRenderer_name$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import type { Local3DPayload } from "relay-runtime"; +import type { NameRendererFragment$ref } from "NameRendererFragment.graphql"; +export type TestVariables = {||}; +export type TestResponse = {| + +node: ?{| + +$fragmentRefs: NameRendererFragment$ref + |} +|}; +export type PlainUserNameRenderer_name = {| + +plaintext: ?string, + +data: ?{| + +text: ?string, + +id: ?string, + |}, +|}; +export type MarkdownUserNameRenderer_name = {| + +markdown: ?string, + +data: ?{| + +markup: ?string, + +id: ?string, + |}, +|}; +export type TestRawResponse = {| + +node: ?({| + +__typename: "User", + +id: string, + +nameRenderer: ?({| + +__typename: "PlainUserNameRenderer", + +__module_operation_NameRendererFragment: ?any, + +__module_component_NameRendererFragment: ?any, + ...PlainUserNameRenderer_name, + |} | Local3DPayload<"NameRendererFragment", {| + +__typename: "PlainUserNameRenderer", + ...PlainUserNameRenderer_name, + |}> | {| + +__typename: "MarkdownUserNameRenderer", + +__module_operation_NameRendererFragment: ?any, + +__module_component_NameRendererFragment: ?any, + ...MarkdownUserNameRenderer_name, + |} | Local3DPayload<"NameRendererFragment", {| + +__typename: "MarkdownUserNameRenderer", + ...MarkdownUserNameRenderer_name, + |}> | {| + +__typename: string + |}), + |} | {| + +__typename: string, + +id: string, + |}) +|}; +export type Test = {| + variables: TestVariables, + response: TestResponse, + rawResponse: TestRawResponse, +|}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type MarkdownUserNameRenderer_name$ref: FragmentReference; +declare export opaque type MarkdownUserNameRenderer_name$fragmentType: MarkdownUserNameRenderer_name$ref; +export type MarkdownUserNameRenderer_name = {| + +markdown: ?string, + +data: ?{| + +markup: ?string + |}, + +$refType: MarkdownUserNameRenderer_name$ref, +|}; +export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; +export type MarkdownUserNameRenderer_name$key = { + +$data?: MarkdownUserNameRenderer_name$data, + +$fragmentRefs: MarkdownUserNameRenderer_name$ref, + ... +}; +------------------------------------------------------------------------------- +import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; +import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type NameRendererFragment$ref: FragmentReference; +declare export opaque type NameRendererFragment$fragmentType: NameRendererFragment$ref; +export type NameRendererFragment = {| + +id: string, + +nameRenderer: ?{| + +__fragmentPropName?: ?string, + +__module_component?: ?string, + +$fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, + |}, + +$refType: NameRendererFragment$ref, +|}; +export type NameRendererFragment$data = NameRendererFragment; +export type NameRendererFragment$key = { + +$data?: NameRendererFragment$data, + +$fragmentRefs: NameRendererFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type PlainUserNameRenderer_name$ref: FragmentReference; +declare export opaque type PlainUserNameRenderer_name$fragmentType: PlainUserNameRenderer_name$ref; +export type PlainUserNameRenderer_name = {| + +plaintext: ?string, + +data: ?{| + +text: ?string + |}, + +$refType: PlainUserNameRenderer_name$ref, +|}; +export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; +export type PlainUserNameRenderer_name$key = { + +$data?: PlainUserNameRenderer_name$data, + +$fragmentRefs: PlainUserNameRenderer_name$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import type { Local3DPayload } from "relay-runtime"; -import type { NameRendererFragment$ref } from "./NameRendererFragment.graphql"; +import type { NameRendererFragment$ref } from "NameRendererFragment.graphql"; export type TestVariables = {||}; export type TestResponse = {| +node: ?{| @@ -101,8 +454,8 @@ export type MarkdownUserNameRenderer_name$key = { ... }; ------------------------------------------------------------------------------- -import type { MarkdownUserNameRenderer_name$ref } from "./MarkdownUserNameRenderer_name.graphql"; -import type { PlainUserNameRenderer_name$ref } from "./PlainUserNameRenderer_name.graphql"; +import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; +import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; import type { FragmentReference } from "relay-runtime"; declare export opaque type NameRendererFragment$ref: FragmentReference; declare export opaque type NameRendererFragment$fragmentType: NameRendererFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-module-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-module-field.expected index 553928e498d9b..8e763eab0bfb2 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-module-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-module-field.expected @@ -17,8 +17,238 @@ fragment Test_userRenderer on PlainUserRenderer { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import type { Local3DPayload } from "relay-runtime"; +import type { Test_user$ref } from "Test_user.graphql"; +export type TestVariables = {||}; +export type TestResponse = {| + +node: ?{| + +$fragmentRefs: Test_user$ref + |} +|}; +export type Test_userRenderer = {| + +user: ?{| + +username: ?string, + +id: string, + |} +|}; +export type TestRawResponse = {| + +node: ?({| + +__typename: "User", + +id: string, + +plainUserRenderer: ?({| + +__module_operation_Test_user: ?any, + +__module_component_Test_user: ?any, + ...Test_userRenderer, + |} | Local3DPayload<"Test_user", {| ...Test_userRenderer + |}>), + |} | {| + +__typename: string, + +id: string, + |}) +|}; +export type Test = {| + variables: TestVariables, + response: TestResponse, + rawResponse: TestRawResponse, +|}; +------------------------------------------------------------------------------- +import type { Test_userRenderer$ref } from "Test_userRenderer.graphql"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type Test_user$ref: FragmentReference; +declare export opaque type Test_user$fragmentType: Test_user$ref; +export type Test_user = {| + +plainUserRenderer: ?{| + +__fragmentPropName?: ?string, + +__module_component?: ?string, + +$fragmentRefs: Test_userRenderer$ref, + |}, + +$refType: Test_user$ref, +|}; +export type Test_user$data = Test_user; +export type Test_user$key = { + +$data?: Test_user$data, + +$fragmentRefs: Test_user$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type Test_userRenderer$ref: FragmentReference; +declare export opaque type Test_userRenderer$fragmentType: Test_userRenderer$ref; +export type Test_userRenderer = {| + +user: ?{| + +username: ?string + |}, + +$refType: Test_userRenderer$ref, +|}; +export type Test_userRenderer$data = Test_userRenderer; +export type Test_userRenderer$key = { + +$data?: Test_userRenderer$data, + +$fragmentRefs: Test_userRenderer$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import type { Local3DPayload } from "relay-runtime"; +import type { Test_user$ref } from "Test_user.graphql"; +export type TestVariables = {||}; +export type TestResponse = {| + +node: ?{| + +$fragmentRefs: Test_user$ref + |} +|}; +export type Test_userRenderer = {| + +user: ?{| + +username: ?string, + +id: string, + |} +|}; +export type TestRawResponse = {| + +node: ?({| + +__typename: "User", + +id: string, + +plainUserRenderer: ?({| + +__module_operation_Test_user: ?any, + +__module_component_Test_user: ?any, + ...Test_userRenderer, + |} | Local3DPayload<"Test_user", {| ...Test_userRenderer + |}>), + |} | {| + +__typename: string, + +id: string, + |}) +|}; +export type Test = {| + variables: TestVariables, + response: TestResponse, + rawResponse: TestRawResponse, +|}; +------------------------------------------------------------------------------- +import type { Test_userRenderer$ref } from "Test_userRenderer.graphql"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type Test_user$ref: FragmentReference; +declare export opaque type Test_user$fragmentType: Test_user$ref; +export type Test_user = {| + +plainUserRenderer: ?{| + +__fragmentPropName?: ?string, + +__module_component?: ?string, + +$fragmentRefs: Test_userRenderer$ref, + |}, + +$refType: Test_user$ref, +|}; +export type Test_user$data = Test_user; +export type Test_user$key = { + +$data?: Test_user$data, + +$fragmentRefs: Test_user$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type Test_userRenderer$ref: FragmentReference; +declare export opaque type Test_userRenderer$fragmentType: Test_userRenderer$ref; +export type Test_userRenderer = {| + +user: ?{| + +username: ?string + |}, + +$refType: Test_userRenderer$ref, +|}; +export type Test_userRenderer$data = Test_userRenderer; +export type Test_userRenderer$key = { + +$data?: Test_userRenderer$data, + +$fragmentRefs: Test_userRenderer$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import type { Local3DPayload } from "relay-runtime"; +import type { Test_user$ref } from "Test_user.graphql"; +export type TestVariables = {||}; +export type TestResponse = {| + +node: ?{| + +$fragmentRefs: Test_user$ref + |} +|}; +export type Test_userRenderer = {| + +user: ?{| + +username: ?string, + +id: string, + |} +|}; +export type TestRawResponse = {| + +node: ?({| + +__typename: "User", + +id: string, + +plainUserRenderer: ?({| + +__module_operation_Test_user: ?any, + +__module_component_Test_user: ?any, + ...Test_userRenderer, + |} | Local3DPayload<"Test_user", {| ...Test_userRenderer + |}>), + |} | {| + +__typename: string, + +id: string, + |}) +|}; +export type Test = {| + variables: TestVariables, + response: TestResponse, + rawResponse: TestRawResponse, +|}; +------------------------------------------------------------------------------- +import type { Test_userRenderer$ref } from "Test_userRenderer.graphql"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type Test_user$ref: FragmentReference; +declare export opaque type Test_user$fragmentType: Test_user$ref; +export type Test_user = {| + +plainUserRenderer: ?{| + +__fragmentPropName?: ?string, + +__module_component?: ?string, + +$fragmentRefs: Test_userRenderer$ref, + |}, + +$refType: Test_user$ref, +|}; +export type Test_user$data = Test_user; +export type Test_user$key = { + +$data?: Test_user$data, + +$fragmentRefs: Test_user$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type Test_userRenderer$ref: FragmentReference; +declare export opaque type Test_userRenderer$fragmentType: Test_userRenderer$ref; +export type Test_userRenderer = {| + +user: ?{| + +username: ?string + |}, + +$refType: Test_userRenderer$ref, +|}; +export type Test_userRenderer$data = Test_userRenderer; +export type Test_userRenderer$key = { + +$data?: Test_userRenderer$data, + +$fragmentRefs: Test_userRenderer$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import type { Local3DPayload } from "relay-runtime"; -import type { Test_user$ref } from "./Test_user.graphql"; +import type { Test_user$ref } from "Test_user.graphql"; export type TestVariables = {||}; export type TestResponse = {| +node: ?{| @@ -52,7 +282,7 @@ export type Test = {| rawResponse: TestRawResponse, |}; ------------------------------------------------------------------------------- -import type { Test_userRenderer$ref } from "./Test_userRenderer.graphql"; +import type { Test_userRenderer$ref } from "Test_userRenderer.graphql"; import type { FragmentReference } from "relay-runtime"; declare export opaque type Test_user$ref: FragmentReference; declare export opaque type Test_user$fragmentType: Test_user$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-multiple-match-fields.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-multiple-match-fields.expected index 13b2b37eeac73..1b03f162c9733 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-multiple-match-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-multiple-match-fields.expected @@ -48,9 +48,539 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import type { Local3DPayload } from "relay-runtime"; +import type { AnotherNameRendererFragment$ref } from "AnotherNameRendererFragment.graphql"; +import type { NameRendererFragment$ref } from "NameRendererFragment.graphql"; +export type TestVariables = {||}; +export type TestResponse = {| + +node: ?{| + +username?: ?string, + +$fragmentRefs: NameRendererFragment$ref, + |}, + +viewer: ?{| + +actor: ?{| + +name?: ?string, + +$fragmentRefs: AnotherNameRendererFragment$ref, + |} + |}, +|}; +export type PlainUserNameRenderer_name = {| + +plaintext: ?string, + +data: ?{| + +text: ?string, + +id: ?string, + |}, +|}; +export type MarkdownUserNameRenderer_name = {| + +markdown: ?string, + +data: ?{| + +markup: ?string, + +id: ?string, + |}, +|}; +export type TestRawResponse = {| + +node: ?({| + +__typename: "User", + +id: string, + +username: ?string, + +nameRenderer: ?({| + +__typename: "PlainUserNameRenderer", + +__module_operation_NameRendererFragment: ?any, + +__module_component_NameRendererFragment: ?any, + ...PlainUserNameRenderer_name, + |} | Local3DPayload<"NameRendererFragment", {| + +__typename: "PlainUserNameRenderer", + ...PlainUserNameRenderer_name, + |}> | {| + +__typename: "MarkdownUserNameRenderer", + +__module_operation_NameRendererFragment: ?any, + +__module_component_NameRendererFragment: ?any, + ...MarkdownUserNameRenderer_name, + |} | Local3DPayload<"NameRendererFragment", {| + +__typename: "MarkdownUserNameRenderer", + ...MarkdownUserNameRenderer_name, + |}> | {| + +__typename: string + |}), + |} | {| + +__typename: string, + +id: string, + |}), + +viewer: ?{| + +actor: ?({| + +__typename: "User", + +id: string, + +name: ?string, + +nameRenderer: ?({| + +__typename: "PlainUserNameRenderer", + +__module_operation_AnotherNameRendererFragment: ?any, + +__module_component_AnotherNameRendererFragment: ?any, + ...PlainUserNameRenderer_name, + |} | Local3DPayload<"AnotherNameRendererFragment", {| + +__typename: "PlainUserNameRenderer", + ...PlainUserNameRenderer_name, + |}> | {| + +__typename: "MarkdownUserNameRenderer", + +__module_operation_AnotherNameRendererFragment: ?any, + +__module_component_AnotherNameRendererFragment: ?any, + ...MarkdownUserNameRenderer_name, + |} | Local3DPayload<"AnotherNameRendererFragment", {| + +__typename: "MarkdownUserNameRenderer", + ...MarkdownUserNameRenderer_name, + |}> | {| + +__typename: string + |}), + |} | {| + +__typename: string, + +id: string, + |}) + |}, +|}; +export type Test = {| + variables: TestVariables, + response: TestResponse, + rawResponse: TestRawResponse, +|}; +------------------------------------------------------------------------------- +import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; +import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type AnotherNameRendererFragment$ref: FragmentReference; +declare export opaque type AnotherNameRendererFragment$fragmentType: AnotherNameRendererFragment$ref; +export type AnotherNameRendererFragment = {| + +name: ?string, + +nameRenderer: ?{| + +__fragmentPropName?: ?string, + +__module_component?: ?string, + +$fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, + |}, + +$refType: AnotherNameRendererFragment$ref, +|}; +export type AnotherNameRendererFragment$data = AnotherNameRendererFragment; +export type AnotherNameRendererFragment$key = { + +$data?: AnotherNameRendererFragment$data, + +$fragmentRefs: AnotherNameRendererFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type MarkdownUserNameRenderer_name$ref: FragmentReference; +declare export opaque type MarkdownUserNameRenderer_name$fragmentType: MarkdownUserNameRenderer_name$ref; +export type MarkdownUserNameRenderer_name = {| + +markdown: ?string, + +data: ?{| + +markup: ?string + |}, + +$refType: MarkdownUserNameRenderer_name$ref, +|}; +export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; +export type MarkdownUserNameRenderer_name$key = { + +$data?: MarkdownUserNameRenderer_name$data, + +$fragmentRefs: MarkdownUserNameRenderer_name$ref, + ... +}; +------------------------------------------------------------------------------- +import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; +import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type NameRendererFragment$ref: FragmentReference; +declare export opaque type NameRendererFragment$fragmentType: NameRendererFragment$ref; +export type NameRendererFragment = {| + +id: string, + +nameRenderer: ?{| + +__fragmentPropName?: ?string, + +__module_component?: ?string, + +$fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, + |}, + +$refType: NameRendererFragment$ref, +|}; +export type NameRendererFragment$data = NameRendererFragment; +export type NameRendererFragment$key = { + +$data?: NameRendererFragment$data, + +$fragmentRefs: NameRendererFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type PlainUserNameRenderer_name$ref: FragmentReference; +declare export opaque type PlainUserNameRenderer_name$fragmentType: PlainUserNameRenderer_name$ref; +export type PlainUserNameRenderer_name = {| + +plaintext: ?string, + +data: ?{| + +text: ?string + |}, + +$refType: PlainUserNameRenderer_name$ref, +|}; +export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; +export type PlainUserNameRenderer_name$key = { + +$data?: PlainUserNameRenderer_name$data, + +$fragmentRefs: PlainUserNameRenderer_name$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import type { Local3DPayload } from "relay-runtime"; +import type { AnotherNameRendererFragment$ref } from "AnotherNameRendererFragment.graphql"; +import type { NameRendererFragment$ref } from "NameRendererFragment.graphql"; +export type TestVariables = {||}; +export type TestResponse = {| + +node: ?{| + +username?: ?string, + +$fragmentRefs: NameRendererFragment$ref, + |}, + +viewer: ?{| + +actor: ?{| + +name?: ?string, + +$fragmentRefs: AnotherNameRendererFragment$ref, + |} + |}, +|}; +export type PlainUserNameRenderer_name = {| + +plaintext: ?string, + +data: ?{| + +text: ?string, + +id: ?string, + |}, +|}; +export type MarkdownUserNameRenderer_name = {| + +markdown: ?string, + +data: ?{| + +markup: ?string, + +id: ?string, + |}, +|}; +export type TestRawResponse = {| + +node: ?({| + +__typename: "User", + +id: string, + +username: ?string, + +nameRenderer: ?({| + +__typename: "PlainUserNameRenderer", + +__module_operation_NameRendererFragment: ?any, + +__module_component_NameRendererFragment: ?any, + ...PlainUserNameRenderer_name, + |} | Local3DPayload<"NameRendererFragment", {| + +__typename: "PlainUserNameRenderer", + ...PlainUserNameRenderer_name, + |}> | {| + +__typename: "MarkdownUserNameRenderer", + +__module_operation_NameRendererFragment: ?any, + +__module_component_NameRendererFragment: ?any, + ...MarkdownUserNameRenderer_name, + |} | Local3DPayload<"NameRendererFragment", {| + +__typename: "MarkdownUserNameRenderer", + ...MarkdownUserNameRenderer_name, + |}> | {| + +__typename: string + |}), + |} | {| + +__typename: string, + +id: string, + |}), + +viewer: ?{| + +actor: ?({| + +__typename: "User", + +id: string, + +name: ?string, + +nameRenderer: ?({| + +__typename: "PlainUserNameRenderer", + +__module_operation_AnotherNameRendererFragment: ?any, + +__module_component_AnotherNameRendererFragment: ?any, + ...PlainUserNameRenderer_name, + |} | Local3DPayload<"AnotherNameRendererFragment", {| + +__typename: "PlainUserNameRenderer", + ...PlainUserNameRenderer_name, + |}> | {| + +__typename: "MarkdownUserNameRenderer", + +__module_operation_AnotherNameRendererFragment: ?any, + +__module_component_AnotherNameRendererFragment: ?any, + ...MarkdownUserNameRenderer_name, + |} | Local3DPayload<"AnotherNameRendererFragment", {| + +__typename: "MarkdownUserNameRenderer", + ...MarkdownUserNameRenderer_name, + |}> | {| + +__typename: string + |}), + |} | {| + +__typename: string, + +id: string, + |}) + |}, +|}; +export type Test = {| + variables: TestVariables, + response: TestResponse, + rawResponse: TestRawResponse, +|}; +------------------------------------------------------------------------------- +import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; +import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type AnotherNameRendererFragment$ref: FragmentReference; +declare export opaque type AnotherNameRendererFragment$fragmentType: AnotherNameRendererFragment$ref; +export type AnotherNameRendererFragment = {| + +name: ?string, + +nameRenderer: ?{| + +__fragmentPropName?: ?string, + +__module_component?: ?string, + +$fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, + |}, + +$refType: AnotherNameRendererFragment$ref, +|}; +export type AnotherNameRendererFragment$data = AnotherNameRendererFragment; +export type AnotherNameRendererFragment$key = { + +$data?: AnotherNameRendererFragment$data, + +$fragmentRefs: AnotherNameRendererFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type MarkdownUserNameRenderer_name$ref: FragmentReference; +declare export opaque type MarkdownUserNameRenderer_name$fragmentType: MarkdownUserNameRenderer_name$ref; +export type MarkdownUserNameRenderer_name = {| + +markdown: ?string, + +data: ?{| + +markup: ?string + |}, + +$refType: MarkdownUserNameRenderer_name$ref, +|}; +export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; +export type MarkdownUserNameRenderer_name$key = { + +$data?: MarkdownUserNameRenderer_name$data, + +$fragmentRefs: MarkdownUserNameRenderer_name$ref, + ... +}; +------------------------------------------------------------------------------- +import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; +import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type NameRendererFragment$ref: FragmentReference; +declare export opaque type NameRendererFragment$fragmentType: NameRendererFragment$ref; +export type NameRendererFragment = {| + +id: string, + +nameRenderer: ?{| + +__fragmentPropName?: ?string, + +__module_component?: ?string, + +$fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, + |}, + +$refType: NameRendererFragment$ref, +|}; +export type NameRendererFragment$data = NameRendererFragment; +export type NameRendererFragment$key = { + +$data?: NameRendererFragment$data, + +$fragmentRefs: NameRendererFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type PlainUserNameRenderer_name$ref: FragmentReference; +declare export opaque type PlainUserNameRenderer_name$fragmentType: PlainUserNameRenderer_name$ref; +export type PlainUserNameRenderer_name = {| + +plaintext: ?string, + +data: ?{| + +text: ?string + |}, + +$refType: PlainUserNameRenderer_name$ref, +|}; +export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; +export type PlainUserNameRenderer_name$key = { + +$data?: PlainUserNameRenderer_name$data, + +$fragmentRefs: PlainUserNameRenderer_name$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import type { Local3DPayload } from "relay-runtime"; +import type { AnotherNameRendererFragment$ref } from "AnotherNameRendererFragment.graphql"; +import type { NameRendererFragment$ref } from "NameRendererFragment.graphql"; +export type TestVariables = {||}; +export type TestResponse = {| + +node: ?{| + +username?: ?string, + +$fragmentRefs: NameRendererFragment$ref, + |}, + +viewer: ?{| + +actor: ?{| + +name?: ?string, + +$fragmentRefs: AnotherNameRendererFragment$ref, + |} + |}, +|}; +export type PlainUserNameRenderer_name = {| + +plaintext: ?string, + +data: ?{| + +text: ?string, + +id: ?string, + |}, +|}; +export type MarkdownUserNameRenderer_name = {| + +markdown: ?string, + +data: ?{| + +markup: ?string, + +id: ?string, + |}, +|}; +export type TestRawResponse = {| + +node: ?({| + +__typename: "User", + +id: string, + +username: ?string, + +nameRenderer: ?({| + +__typename: "PlainUserNameRenderer", + +__module_operation_NameRendererFragment: ?any, + +__module_component_NameRendererFragment: ?any, + ...PlainUserNameRenderer_name, + |} | Local3DPayload<"NameRendererFragment", {| + +__typename: "PlainUserNameRenderer", + ...PlainUserNameRenderer_name, + |}> | {| + +__typename: "MarkdownUserNameRenderer", + +__module_operation_NameRendererFragment: ?any, + +__module_component_NameRendererFragment: ?any, + ...MarkdownUserNameRenderer_name, + |} | Local3DPayload<"NameRendererFragment", {| + +__typename: "MarkdownUserNameRenderer", + ...MarkdownUserNameRenderer_name, + |}> | {| + +__typename: string + |}), + |} | {| + +__typename: string, + +id: string, + |}), + +viewer: ?{| + +actor: ?({| + +__typename: "User", + +id: string, + +name: ?string, + +nameRenderer: ?({| + +__typename: "PlainUserNameRenderer", + +__module_operation_AnotherNameRendererFragment: ?any, + +__module_component_AnotherNameRendererFragment: ?any, + ...PlainUserNameRenderer_name, + |} | Local3DPayload<"AnotherNameRendererFragment", {| + +__typename: "PlainUserNameRenderer", + ...PlainUserNameRenderer_name, + |}> | {| + +__typename: "MarkdownUserNameRenderer", + +__module_operation_AnotherNameRendererFragment: ?any, + +__module_component_AnotherNameRendererFragment: ?any, + ...MarkdownUserNameRenderer_name, + |} | Local3DPayload<"AnotherNameRendererFragment", {| + +__typename: "MarkdownUserNameRenderer", + ...MarkdownUserNameRenderer_name, + |}> | {| + +__typename: string + |}), + |} | {| + +__typename: string, + +id: string, + |}) + |}, +|}; +export type Test = {| + variables: TestVariables, + response: TestResponse, + rawResponse: TestRawResponse, +|}; +------------------------------------------------------------------------------- +import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; +import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type AnotherNameRendererFragment$ref: FragmentReference; +declare export opaque type AnotherNameRendererFragment$fragmentType: AnotherNameRendererFragment$ref; +export type AnotherNameRendererFragment = {| + +name: ?string, + +nameRenderer: ?{| + +__fragmentPropName?: ?string, + +__module_component?: ?string, + +$fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, + |}, + +$refType: AnotherNameRendererFragment$ref, +|}; +export type AnotherNameRendererFragment$data = AnotherNameRendererFragment; +export type AnotherNameRendererFragment$key = { + +$data?: AnotherNameRendererFragment$data, + +$fragmentRefs: AnotherNameRendererFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type MarkdownUserNameRenderer_name$ref: FragmentReference; +declare export opaque type MarkdownUserNameRenderer_name$fragmentType: MarkdownUserNameRenderer_name$ref; +export type MarkdownUserNameRenderer_name = {| + +markdown: ?string, + +data: ?{| + +markup: ?string + |}, + +$refType: MarkdownUserNameRenderer_name$ref, +|}; +export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; +export type MarkdownUserNameRenderer_name$key = { + +$data?: MarkdownUserNameRenderer_name$data, + +$fragmentRefs: MarkdownUserNameRenderer_name$ref, + ... +}; +------------------------------------------------------------------------------- +import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; +import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type NameRendererFragment$ref: FragmentReference; +declare export opaque type NameRendererFragment$fragmentType: NameRendererFragment$ref; +export type NameRendererFragment = {| + +id: string, + +nameRenderer: ?{| + +__fragmentPropName?: ?string, + +__module_component?: ?string, + +$fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, + |}, + +$refType: NameRendererFragment$ref, +|}; +export type NameRendererFragment$data = NameRendererFragment; +export type NameRendererFragment$key = { + +$data?: NameRendererFragment$data, + +$fragmentRefs: NameRendererFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type PlainUserNameRenderer_name$ref: FragmentReference; +declare export opaque type PlainUserNameRenderer_name$fragmentType: PlainUserNameRenderer_name$ref; +export type PlainUserNameRenderer_name = {| + +plaintext: ?string, + +data: ?{| + +text: ?string + |}, + +$refType: PlainUserNameRenderer_name$ref, +|}; +export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; +export type PlainUserNameRenderer_name$key = { + +$data?: PlainUserNameRenderer_name$data, + +$fragmentRefs: PlainUserNameRenderer_name$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import type { Local3DPayload } from "relay-runtime"; -import type { AnotherNameRendererFragment$ref } from "./AnotherNameRendererFragment.graphql"; -import type { NameRendererFragment$ref } from "./NameRendererFragment.graphql"; +import type { AnotherNameRendererFragment$ref } from "AnotherNameRendererFragment.graphql"; +import type { NameRendererFragment$ref } from "NameRendererFragment.graphql"; export type TestVariables = {||}; export type TestResponse = {| +node: ?{| @@ -142,8 +672,8 @@ export type Test = {| rawResponse: TestRawResponse, |}; ------------------------------------------------------------------------------- -import type { MarkdownUserNameRenderer_name$ref } from "./MarkdownUserNameRenderer_name.graphql"; -import type { PlainUserNameRenderer_name$ref } from "./PlainUserNameRenderer_name.graphql"; +import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; +import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; import type { FragmentReference } from "relay-runtime"; declare export opaque type AnotherNameRendererFragment$ref: FragmentReference; declare export opaque type AnotherNameRendererFragment$fragmentType: AnotherNameRendererFragment$ref; @@ -180,8 +710,8 @@ export type MarkdownUserNameRenderer_name$key = { ... }; ------------------------------------------------------------------------------- -import type { MarkdownUserNameRenderer_name$ref } from "./MarkdownUserNameRenderer_name.graphql"; -import type { PlainUserNameRenderer_name$ref } from "./PlainUserNameRenderer_name.graphql"; +import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; +import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; import type { FragmentReference } from "relay-runtime"; declare export opaque type NameRendererFragment$ref: FragmentReference; declare export opaque type NameRendererFragment$fragmentType: NameRendererFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-conditional.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-conditional.expected index 83aa52655090b..071f2b8463012 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-conditional.expected @@ -16,7 +16,177 @@ fragment FriendFragment on User { } } ==================================== OUTPUT =================================== -import type { FriendFragment$ref } from "./FriendFragment.graphql"; +/* + * future proof enums: false + * future proof abstract types: false + */ + +import type { FriendFragment$ref } from "FriendFragment.graphql"; +export type ExampleQueryVariables = {| + id: string, + condition: boolean, +|}; +export type ExampleQueryResponse = {| + +node: ?{| + +$fragmentRefs: FriendFragment$ref + |} +|}; +export type ExampleQueryRawResponse = {| + +node: ?({| + +__typename: "User", + +id: string, + +name: ?string, + +lastName: ?string, + +feedback: ?{| + +id: string, + +name: ?string, + |}, + |} | {| + +__typename: string, + +id: string, + |}) +|}; +export type ExampleQuery = {| + variables: ExampleQueryVariables, + response: ExampleQueryResponse, + rawResponse: ExampleQueryRawResponse, +|}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type FriendFragment$ref: FragmentReference; +declare export opaque type FriendFragment$fragmentType: FriendFragment$ref; +export type FriendFragment = {| + +name?: ?string, + +lastName?: ?string, + +feedback?: ?{| + +id: string, + +name: ?string, + |}, + +$refType: FriendFragment$ref, +|}; +export type FriendFragment$data = FriendFragment; +export type FriendFragment$key = { + +$data?: FriendFragment$data, + +$fragmentRefs: FriendFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import type { FriendFragment$ref } from "FriendFragment.graphql"; +export type ExampleQueryVariables = {| + id: string, + condition: boolean, +|}; +export type ExampleQueryResponse = {| + +node: ?{| + +$fragmentRefs: FriendFragment$ref + |} +|}; +export type ExampleQueryRawResponse = {| + +node: ?({| + +__typename: "User", + +id: string, + +name: ?string, + +lastName: ?string, + +feedback: ?{| + +id: string, + +name: ?string, + |}, + |} | {| + +__typename: string, + +id: string, + |}) +|}; +export type ExampleQuery = {| + variables: ExampleQueryVariables, + response: ExampleQueryResponse, + rawResponse: ExampleQueryRawResponse, +|}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type FriendFragment$ref: FragmentReference; +declare export opaque type FriendFragment$fragmentType: FriendFragment$ref; +export type FriendFragment = {| + +name?: ?string, + +lastName?: ?string, + +feedback?: ?{| + +id: string, + +name: ?string, + |}, + +$refType: FriendFragment$ref, +|}; +export type FriendFragment$data = FriendFragment; +export type FriendFragment$key = { + +$data?: FriendFragment$data, + +$fragmentRefs: FriendFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import type { FriendFragment$ref } from "FriendFragment.graphql"; +export type ExampleQueryVariables = {| + id: string, + condition: boolean, +|}; +export type ExampleQueryResponse = {| + +node: ?{| + +$fragmentRefs: FriendFragment$ref + |} +|}; +export type ExampleQueryRawResponse = {| + +node: ?({| + +__typename: "User", + +id: string, + +name: ?string, + +lastName: ?string, + +feedback: ?{| + +id: string, + +name: ?string, + |}, + |} | {| + +__typename: string, + +id: string, + |}) +|}; +export type ExampleQuery = {| + variables: ExampleQueryVariables, + response: ExampleQueryResponse, + rawResponse: ExampleQueryRawResponse, +|}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type FriendFragment$ref: FragmentReference; +declare export opaque type FriendFragment$fragmentType: FriendFragment$ref; +export type FriendFragment = {| + +name?: ?string, + +lastName?: ?string, + +feedback?: ?{| + +id: string, + +name: ?string, + |}, + +$refType: FriendFragment$ref, +|}; +export type FriendFragment$data = FriendFragment; +export type FriendFragment$key = { + +$data?: FriendFragment$data, + +$fragmentRefs: FriendFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + +import type { FriendFragment$ref } from "FriendFragment.graphql"; export type ExampleQueryVariables = {| id: string, condition: boolean, diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-literal-conditional.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-literal-conditional.expected index 33556ec8d8bd1..6c70ecfd105de 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-literal-conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-literal-conditional.expected @@ -22,7 +22,162 @@ fragment FriendFragment on User { } } ==================================== OUTPUT =================================== -import type { FriendFragment$ref } from "./FriendFragment.graphql"; +/* + * future proof enums: false + * future proof abstract types: false + */ + +import type { FriendFragment$ref } from "FriendFragment.graphql"; +export type ExampleQueryVariables = {| + id: string +|}; +export type ExampleQueryResponse = {| + +node: ?{| + +username: ?string, + +friends?: ?{| + +count: ?number + |}, + +$fragmentRefs: FriendFragment$ref, + |} +|}; +export type ExampleQueryRawResponse = {| + +node: ?{| + +__typename: string, + +username: ?string, + +id: string, + |} +|}; +export type ExampleQuery = {| + variables: ExampleQueryVariables, + response: ExampleQueryResponse, + rawResponse: ExampleQueryRawResponse, +|}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type FriendFragment$ref: FragmentReference; +declare export opaque type FriendFragment$fragmentType: FriendFragment$ref; +export type FriendFragment = {| + +name?: ?string, + +lastName?: ?string, + +feedback?: ?{| + +id: string, + +name: ?string, + |}, + +$refType: FriendFragment$ref, +|}; +export type FriendFragment$data = FriendFragment; +export type FriendFragment$key = { + +$data?: FriendFragment$data, + +$fragmentRefs: FriendFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import type { FriendFragment$ref } from "FriendFragment.graphql"; +export type ExampleQueryVariables = {| + id: string +|}; +export type ExampleQueryResponse = {| + +node: ?{| + +username: ?string, + +friends?: ?{| + +count: ?number + |}, + +$fragmentRefs: FriendFragment$ref, + |} +|}; +export type ExampleQueryRawResponse = {| + +node: ?{| + +__typename: string, + +username: ?string, + +id: string, + |} +|}; +export type ExampleQuery = {| + variables: ExampleQueryVariables, + response: ExampleQueryResponse, + rawResponse: ExampleQueryRawResponse, +|}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type FriendFragment$ref: FragmentReference; +declare export opaque type FriendFragment$fragmentType: FriendFragment$ref; +export type FriendFragment = {| + +name?: ?string, + +lastName?: ?string, + +feedback?: ?{| + +id: string, + +name: ?string, + |}, + +$refType: FriendFragment$ref, +|}; +export type FriendFragment$data = FriendFragment; +export type FriendFragment$key = { + +$data?: FriendFragment$data, + +$fragmentRefs: FriendFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import type { FriendFragment$ref } from "FriendFragment.graphql"; +export type ExampleQueryVariables = {| + id: string +|}; +export type ExampleQueryResponse = {| + +node: ?{| + +username: ?string, + +friends?: ?{| + +count: ?number + |}, + +$fragmentRefs: FriendFragment$ref, + |} +|}; +export type ExampleQueryRawResponse = {| + +node: ?{| + +__typename: string, + +username: ?string, + +id: string, + |} +|}; +export type ExampleQuery = {| + variables: ExampleQueryVariables, + response: ExampleQueryResponse, + rawResponse: ExampleQueryRawResponse, +|}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type FriendFragment$ref: FragmentReference; +declare export opaque type FriendFragment$fragmentType: FriendFragment$ref; +export type FriendFragment = {| + +name?: ?string, + +lastName?: ?string, + +feedback?: ?{| + +id: string, + +name: ?string, + |}, + +$refType: FriendFragment$ref, +|}; +export type FriendFragment$data = FriendFragment; +export type FriendFragment$key = { + +$data?: FriendFragment$data, + +$fragmentRefs: FriendFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + +import type { FriendFragment$ref } from "FriendFragment.graphql"; export type ExampleQueryVariables = {| id: string |}; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-stream-connection.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-stream-connection.expected index db869695cc30f..74657280fbf45 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-stream-connection.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-stream-connection.expected @@ -17,6 +17,173 @@ query TestDefer @raw_response_type { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type TestDeferVariables = {||}; +export type TestDeferResponse = {| + +node: ?{| + +name?: ?string, + +friends?: ?{| + +edges: ?$ReadOnlyArray + |}, + |} +|}; +export type TestDeferRawResponse = {| + +node: ?({| + +__typename: "User", + +id: string, + +name: ?string, + +friends: ?{| + +edges: ?$ReadOnlyArray, + +pageInfo: ?{| + +endCursor: ?string, + +hasNextPage: ?boolean, + |}, + |}, + |} | {| + +__typename: string, + +id: string, + |}) +|}; +export type TestDefer = {| + variables: TestDeferVariables, + response: TestDeferResponse, + rawResponse: TestDeferRawResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type TestDeferVariables = {||}; +export type TestDeferResponse = {| + +node: ?{| + +name?: ?string, + +friends?: ?{| + +edges: ?$ReadOnlyArray + |}, + |} +|}; +export type TestDeferRawResponse = {| + +node: ?({| + +__typename: "User", + +id: string, + +name: ?string, + +friends: ?{| + +edges: ?$ReadOnlyArray, + +pageInfo: ?{| + +endCursor: ?string, + +hasNextPage: ?boolean, + |}, + |}, + |} | {| + +__typename: string, + +id: string, + |}) +|}; +export type TestDefer = {| + variables: TestDeferVariables, + response: TestDeferResponse, + rawResponse: TestDeferRawResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type TestDeferVariables = {||}; +export type TestDeferResponse = {| + +node: ?{| + +name?: ?string, + +friends?: ?{| + +edges: ?$ReadOnlyArray + |}, + |} +|}; +export type TestDeferRawResponse = {| + +node: ?({| + +__typename: "User", + +id: string, + +name: ?string, + +friends: ?{| + +edges: ?$ReadOnlyArray, + +pageInfo: ?{| + +endCursor: ?string, + +hasNextPage: ?boolean, + |}, + |}, + |} | {| + +__typename: string, + +id: string, + |}) +|}; +export type TestDefer = {| + variables: TestDeferVariables, + response: TestDeferResponse, + rawResponse: TestDeferRawResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type TestDeferVariables = {||}; export type TestDeferResponse = {| +node: ?{| diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-stream.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-stream.expected index e79ebc313b654..efd1a8224490f 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-stream.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-stream.expected @@ -18,6 +18,152 @@ query TestStream @raw_response_type { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type TestStreamVariables = {||}; +export type TestStreamResponse = {| + +node: ?{| + +name?: ?string, + +friends?: ?{| + +edges: ?$ReadOnlyArray + |}, + |} +|}; +export type TestStreamRawResponse = {| + +node: ?({| + +__typename: "User", + +id: string, + +name: ?string, + +friends: ?{| + +edges: ?$ReadOnlyArray, + +pageInfo: ?{| + +endCursor: ?string, + +hasNextPage: ?boolean, + |}, + |}, + |} | {| + +__typename: string, + +id: string, + |}) +|}; +export type TestStream = {| + variables: TestStreamVariables, + response: TestStreamResponse, + rawResponse: TestStreamRawResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type TestStreamVariables = {||}; +export type TestStreamResponse = {| + +node: ?{| + +name?: ?string, + +friends?: ?{| + +edges: ?$ReadOnlyArray + |}, + |} +|}; +export type TestStreamRawResponse = {| + +node: ?({| + +__typename: "User", + +id: string, + +name: ?string, + +friends: ?{| + +edges: ?$ReadOnlyArray, + +pageInfo: ?{| + +endCursor: ?string, + +hasNextPage: ?boolean, + |}, + |}, + |} | {| + +__typename: string, + +id: string, + |}) +|}; +export type TestStream = {| + variables: TestStreamVariables, + response: TestStreamResponse, + rawResponse: TestStreamRawResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type TestStreamVariables = {||}; +export type TestStreamResponse = {| + +node: ?{| + +name?: ?string, + +friends?: ?{| + +edges: ?$ReadOnlyArray + |}, + |} +|}; +export type TestStreamRawResponse = {| + +node: ?({| + +__typename: "User", + +id: string, + +name: ?string, + +friends: ?{| + +edges: ?$ReadOnlyArray, + +pageInfo: ?{| + +endCursor: ?string, + +hasNextPage: ?boolean, + |}, + |}, + |} | {| + +__typename: string, + +id: string, + |}) +|}; +export type TestStream = {| + variables: TestStreamVariables, + response: TestStreamResponse, + rawResponse: TestStreamRawResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type TestStreamVariables = {||}; export type TestStreamResponse = {| +node: ?{| diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/recursive-fragments.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/recursive-fragments.expected index 41d73a06c619d..f01e1fc9fec88 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/recursive-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/recursive-fragments.expected @@ -6,6 +6,71 @@ fragment FragmentSpread on Node { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type FragmentSpread$ref: FragmentReference; +declare export opaque type FragmentSpread$fragmentType: FragmentSpread$ref; +export type FragmentSpread = {| + +id: string, + +$fragmentRefs: FragmentSpread$ref, + +$refType: FragmentSpread$ref, +|}; +export type FragmentSpread$data = FragmentSpread; +export type FragmentSpread$key = { + +$data?: FragmentSpread$data, + +$fragmentRefs: FragmentSpread$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type FragmentSpread$ref: FragmentReference; +declare export opaque type FragmentSpread$fragmentType: FragmentSpread$ref; +export type FragmentSpread = {| + +id: string, + +$fragmentRefs: FragmentSpread$ref, + +$refType: FragmentSpread$ref, +|}; +export type FragmentSpread$data = FragmentSpread; +export type FragmentSpread$key = { + +$data?: FragmentSpread$data, + +$fragmentRefs: FragmentSpread$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type FragmentSpread$ref: FragmentReference; +declare export opaque type FragmentSpread$fragmentType: FragmentSpread$ref; +export type FragmentSpread = {| + +id: string, + +$fragmentRefs: FragmentSpread$ref, + +$refType: FragmentSpread$ref, +|}; +export type FragmentSpread$data = FragmentSpread; +export type FragmentSpread$key = { + +$data?: FragmentSpread$data, + +$fragmentRefs: FragmentSpread$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import type { FragmentReference } from "relay-runtime"; declare export opaque type FragmentSpread$ref: FragmentReference; declare export opaque type FragmentSpread$fragmentType: FragmentSpread$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/refetchable-fragment.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/refetchable-fragment.expected index 09e323df81954..38e765836869f 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/refetchable-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/refetchable-fragment.expected @@ -7,6 +7,125 @@ fragment RefetchableFragment on Node } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type RefetchableFragment$ref: FragmentReference; +declare export opaque type RefetchableFragment$fragmentType: RefetchableFragment$ref; +export type RefetchableFragmentQueryVariables = {| + id: string +|}; +export type RefetchableFragmentQueryResponse = {| + +node: ?{| + +$fragmentRefs: RefetchableFragment$ref + |} +|}; +export type RefetchableFragmentQuery = {| + variables: RefetchableFragmentQueryVariables, + response: RefetchableFragmentQueryResponse, +|}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +import type { RefetchableFragment$ref, RefetchableFragment$fragmentType } from "RefetchableFragmentQuery.graphql"; +export type { RefetchableFragment$ref, RefetchableFragment$fragmentType }; +export type RefetchableFragment = {| + +id: string, + +fragAndField: ?{| + +uri: ?string + |}, + +$refType: RefetchableFragment$ref, +|}; +export type RefetchableFragment$data = RefetchableFragment; +export type RefetchableFragment$key = { + +$data?: RefetchableFragment$data, + +$fragmentRefs: RefetchableFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type RefetchableFragment$ref: FragmentReference; +declare export opaque type RefetchableFragment$fragmentType: RefetchableFragment$ref; +export type RefetchableFragmentQueryVariables = {| + id: string +|}; +export type RefetchableFragmentQueryResponse = {| + +node: ?{| + +$fragmentRefs: RefetchableFragment$ref + |} +|}; +export type RefetchableFragmentQuery = {| + variables: RefetchableFragmentQueryVariables, + response: RefetchableFragmentQueryResponse, +|}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +import type { RefetchableFragment$ref, RefetchableFragment$fragmentType } from "RefetchableFragmentQuery.graphql"; +export type { RefetchableFragment$ref, RefetchableFragment$fragmentType }; +export type RefetchableFragment = {| + +id: string, + +fragAndField: ?{| + +uri: ?string + |}, + +$refType: RefetchableFragment$ref, +|}; +export type RefetchableFragment$data = RefetchableFragment; +export type RefetchableFragment$key = { + +$data?: RefetchableFragment$data, + +$fragmentRefs: RefetchableFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type RefetchableFragment$ref: FragmentReference; +declare export opaque type RefetchableFragment$fragmentType: RefetchableFragment$ref; +export type RefetchableFragmentQueryVariables = {| + id: string +|}; +export type RefetchableFragmentQueryResponse = {| + +node: ?{| + +$fragmentRefs: RefetchableFragment$ref + |} +|}; +export type RefetchableFragmentQuery = {| + variables: RefetchableFragmentQueryVariables, + response: RefetchableFragmentQueryResponse, +|}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +import type { RefetchableFragment$ref, RefetchableFragment$fragmentType } from "RefetchableFragmentQuery.graphql"; +export type { RefetchableFragment$ref, RefetchableFragment$fragmentType }; +export type RefetchableFragment = {| + +id: string, + +fragAndField: ?{| + +uri: ?string + |}, + +$refType: RefetchableFragment$ref, +|}; +export type RefetchableFragment$data = RefetchableFragment; +export type RefetchableFragment$key = { + +$data?: RefetchableFragment$data, + +$fragmentRefs: RefetchableFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import type { FragmentReference } from "relay-runtime"; declare export opaque type RefetchableFragment$ref: FragmentReference; declare export opaque type RefetchableFragment$fragmentType: RefetchableFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/refetchable.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/refetchable.expected index 783c90c40e80a..d20e76f9f02e5 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/refetchable.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/refetchable.expected @@ -7,6 +7,119 @@ fragment FlowRefetchableFragment on Node } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type FlowRefetchableFragment$ref: FragmentReference; +declare export opaque type FlowRefetchableFragment$fragmentType: FlowRefetchableFragment$ref; +export type FlowRefetchableFragmentQueryVariables = {| + id: string +|}; +export type FlowRefetchableFragmentQueryResponse = {| + +node: ?{| + +$fragmentRefs: FlowRefetchableFragment$ref + |} +|}; +export type FlowRefetchableFragmentQuery = {| + variables: FlowRefetchableFragmentQueryVariables, + response: FlowRefetchableFragmentQueryResponse, +|}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +import type { FlowRefetchableFragment$ref, FlowRefetchableFragment$fragmentType } from "FlowRefetchableFragmentQuery.graphql"; +export type { FlowRefetchableFragment$ref, FlowRefetchableFragment$fragmentType }; +export type FlowRefetchableFragment = {| + +id: string, + +name?: ?string, + +$refType: FlowRefetchableFragment$ref, +|}; +export type FlowRefetchableFragment$data = FlowRefetchableFragment; +export type FlowRefetchableFragment$key = { + +$data?: FlowRefetchableFragment$data, + +$fragmentRefs: FlowRefetchableFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type FlowRefetchableFragment$ref: FragmentReference; +declare export opaque type FlowRefetchableFragment$fragmentType: FlowRefetchableFragment$ref; +export type FlowRefetchableFragmentQueryVariables = {| + id: string +|}; +export type FlowRefetchableFragmentQueryResponse = {| + +node: ?{| + +$fragmentRefs: FlowRefetchableFragment$ref + |} +|}; +export type FlowRefetchableFragmentQuery = {| + variables: FlowRefetchableFragmentQueryVariables, + response: FlowRefetchableFragmentQueryResponse, +|}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +import type { FlowRefetchableFragment$ref, FlowRefetchableFragment$fragmentType } from "FlowRefetchableFragmentQuery.graphql"; +export type { FlowRefetchableFragment$ref, FlowRefetchableFragment$fragmentType }; +export type FlowRefetchableFragment = {| + +id: string, + +name?: ?string, + +$refType: FlowRefetchableFragment$ref, +|}; +export type FlowRefetchableFragment$data = FlowRefetchableFragment; +export type FlowRefetchableFragment$key = { + +$data?: FlowRefetchableFragment$data, + +$fragmentRefs: FlowRefetchableFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type FlowRefetchableFragment$ref: FragmentReference; +declare export opaque type FlowRefetchableFragment$fragmentType: FlowRefetchableFragment$ref; +export type FlowRefetchableFragmentQueryVariables = {| + id: string +|}; +export type FlowRefetchableFragmentQueryResponse = {| + +node: ?{| + +$fragmentRefs: FlowRefetchableFragment$ref + |} +|}; +export type FlowRefetchableFragmentQuery = {| + variables: FlowRefetchableFragmentQueryVariables, + response: FlowRefetchableFragmentQueryResponse, +|}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +import type { FlowRefetchableFragment$ref, FlowRefetchableFragment$fragmentType } from "FlowRefetchableFragmentQuery.graphql"; +export type { FlowRefetchableFragment$ref, FlowRefetchableFragment$fragmentType }; +export type FlowRefetchableFragment = {| + +id: string, + +name?: ?string, + +$refType: FlowRefetchableFragment$ref, +|}; +export type FlowRefetchableFragment$data = FlowRefetchableFragment; +export type FlowRefetchableFragment$key = { + +$data?: FlowRefetchableFragment$data, + +$fragmentRefs: FlowRefetchableFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import type { FragmentReference } from "relay-runtime"; declare export opaque type FlowRefetchableFragment$ref: FragmentReference; declare export opaque type FlowRefetchableFragment$fragmentType: FlowRefetchableFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.expected index 39ec042b5bb8e..b537d2fb5a774 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.expected @@ -27,6 +27,11 @@ query RelayClientIDFieldQuery($id: ID!) { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + export type RelayClientIDFieldQueryVariables = {| id: string |}; @@ -38,18 +43,159 @@ export type RelayClientIDFieldQueryResponse = {| +id: string, |}, +node: ?{| + +__typename: "Comment", + +commentBody: ?{| + +__typename: "PlainCommentBody", + +__id: string, + +text: ?{| + +__id: string, + +__typename: string, + +text: ?string, + |}, + |} | {| + +__typename: "MarkdownCommentBody" + |} & {| + +__id: string + |}, + |} | {| + +__typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "User" + |} & {| + +__id: string, + +id: string, + |}, +|}; +export type RelayClientIDFieldQuery = {| + variables: RelayClientIDFieldQueryVariables, + response: RelayClientIDFieldQueryResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type RelayClientIDFieldQueryVariables = {| + id: string +|}; +export type RelayClientIDFieldQueryResponse = {| + +__id: string, + +me: ?{| + +__id: string, + +__typename: string, + +id: string, + |}, + +node: ?{| + +__typename: "Comment", + +commentBody: ?{| + +__typename: "PlainCommentBody", + +__id: string, + +text: ?{| + +__id: string, + +__typename: string, + +text: ?string, + |}, + |} | {| + +__typename: "MarkdownCommentBody" + |} & {| + +__id: string + |}, + |} | {| + +__typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "User" + |} & {| + +__id: string, + +id: string, + |}, +|}; +export type RelayClientIDFieldQuery = {| + variables: RelayClientIDFieldQueryVariables, + response: RelayClientIDFieldQueryResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type RelayClientIDFieldQueryVariables = {| + id: string +|}; +export type RelayClientIDFieldQueryResponse = {| + +__id: string, + +me: ?{| +__id: string, +__typename: string, +id: string, - +commentBody?: ?{| + |}, + +node: ?{| + +__typename: "Comment", + +commentBody: ?{| + +__typename: "PlainCommentBody", +__id: string, - +__typename: string, - +text?: ?{| + +text: ?{| +__id: string, +__typename: string, +text: ?string, |}, + |} | {| + // This will never be '%other', but we need some + // value in case none of the concrete values match. + +__typename: "MarkdownCommentBody" | "%other" + |} & {| + +__id: string |}, + |} | {| + // This will never be '%other', but we need some + // value in case none of the concrete values match. + +__typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "User" | "%other" + |} & {| + +__id: string, + +id: string, + |}, +|}; +export type RelayClientIDFieldQuery = {| + variables: RelayClientIDFieldQueryVariables, + response: RelayClientIDFieldQueryResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + +export type RelayClientIDFieldQueryVariables = {| + id: string +|}; +export type RelayClientIDFieldQueryResponse = {| + +__id: string, + +me: ?{| + +__id: string, + +__typename: string, + +id: string, + |}, + +node: ?{| + +__typename: "Comment", + +commentBody: ?{| + +__typename: "PlainCommentBody", + +__id: string, + +text: ?{| + +__id: string, + +__typename: string, + +text: ?string, + |}, + |} | {| + // This will never be '%other', but we need some + // value in case none of the concrete values match. + +__typename: "MarkdownCommentBody" | "%other" + |} & {| + +__id: string + |}, + |} | {| + // This will never be '%other', but we need some + // value in case none of the concrete values match. + +__typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "User" | "%other" + |} & {| + +__id: string, + +id: string, |}, |}; export type RelayClientIDFieldQuery = {| diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected index 36f1e3a8fe0ad..17706bb896d2d 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected @@ -8,19 +8,95 @@ fragment Foo on Node { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + import type { FragmentReference } from "relay-runtime"; declare export opaque type Foo$ref: FragmentReference; declare export opaque type Foo$fragmentType: Foo$ref; -export type Foo = ?({| +export type Foo = ?{| + +__typename: "User", + +name: string, +|} | {| + +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" +|} & {| + +$refType: Foo$ref +|}; +export type Foo$data = Foo; +export type Foo$key = { + +$data?: Foo$data, + +$fragmentRefs: Foo$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type Foo$ref: FragmentReference; +declare export opaque type Foo$fragmentType: Foo$ref; +export type Foo = ?{| + +__typename: "User", + +name: string, +|} | {| + +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" +|} & {| + +$refType: Foo$ref +|}; +export type Foo$data = Foo; +export type Foo$key = { + +$data?: Foo$data, + +$fragmentRefs: Foo$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type Foo$ref: FragmentReference; +declare export opaque type Foo$fragmentType: Foo$ref; +export type Foo = ?{| + +__typename: "User", + +name: string, +|} | {| + // This will never be '%other', but we need some + // value in case none of the concrete values match. + +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" | "%other" +|} & {| + +$refType: Foo$ref +|}; +export type Foo$data = Foo; +export type Foo$key = { + +$data?: Foo$data, + +$fragmentRefs: Foo$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type Foo$ref: FragmentReference; +declare export opaque type Foo$fragmentType: Foo$ref; +export type Foo = ?{| +__typename: "User", +name: string, - +$refType: Foo$ref, |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +__typename: "%other", - +$refType: Foo$ref, -|}); + +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" | "%other" +|} & {| + +$refType: Foo$ref +|}; export type Foo$data = Foo; export type Foo$key = { +$data?: Foo$data, diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-fragment.expected index 25cebfecb25bc..97aa3b66d22da 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-fragment.expected @@ -4,6 +4,71 @@ fragment NonNullFragment on User { lastName @required(action: NONE) } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type NonNullFragment$ref: FragmentReference; +declare export opaque type NonNullFragment$fragmentType: NonNullFragment$ref; +export type NonNullFragment = ?{| + +firstName: ?string, + +lastName: string, + +$refType: NonNullFragment$ref, +|}; +export type NonNullFragment$data = NonNullFragment; +export type NonNullFragment$key = { + +$data?: NonNullFragment$data, + +$fragmentRefs: NonNullFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type NonNullFragment$ref: FragmentReference; +declare export opaque type NonNullFragment$fragmentType: NonNullFragment$ref; +export type NonNullFragment = ?{| + +firstName: ?string, + +lastName: string, + +$refType: NonNullFragment$ref, +|}; +export type NonNullFragment$data = NonNullFragment; +export type NonNullFragment$key = { + +$data?: NonNullFragment$data, + +$fragmentRefs: NonNullFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type NonNullFragment$ref: FragmentReference; +declare export opaque type NonNullFragment$fragmentType: NonNullFragment$ref; +export type NonNullFragment = ?{| + +firstName: ?string, + +lastName: string, + +$refType: NonNullFragment$ref, +|}; +export type NonNullFragment$data = NonNullFragment; +export type NonNullFragment$key = { + +$data?: NonNullFragment$data, + +$fragmentRefs: NonNullFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import type { FragmentReference } from "relay-runtime"; declare export opaque type NonNullFragment$ref: FragmentReference; declare export opaque type NonNullFragment$fragmentType: NonNullFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-item-in-plural-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-item-in-plural-field.expected index 40863e84d75d4..5f47a910341c0 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-item-in-plural-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-item-in-plural-field.expected @@ -7,6 +7,80 @@ fragment NonNullFragment on User { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type NonNullFragment$ref: FragmentReference; +declare export opaque type NonNullFragment$fragmentType: NonNullFragment$ref; +export type NonNullFragment = {| + +firstName: ?string, + +screennames: ?$ReadOnlyArray, + +$refType: NonNullFragment$ref, +|}; +export type NonNullFragment$data = NonNullFragment; +export type NonNullFragment$key = { + +$data?: NonNullFragment$data, + +$fragmentRefs: NonNullFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type NonNullFragment$ref: FragmentReference; +declare export opaque type NonNullFragment$fragmentType: NonNullFragment$ref; +export type NonNullFragment = {| + +firstName: ?string, + +screennames: ?$ReadOnlyArray, + +$refType: NonNullFragment$ref, +|}; +export type NonNullFragment$data = NonNullFragment; +export type NonNullFragment$key = { + +$data?: NonNullFragment$data, + +$fragmentRefs: NonNullFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type NonNullFragment$ref: FragmentReference; +declare export opaque type NonNullFragment$fragmentType: NonNullFragment$ref; +export type NonNullFragment = {| + +firstName: ?string, + +screennames: ?$ReadOnlyArray, + +$refType: NonNullFragment$ref, +|}; +export type NonNullFragment$data = NonNullFragment; +export type NonNullFragment$key = { + +$data?: NonNullFragment$data, + +$fragmentRefs: NonNullFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import type { FragmentReference } from "relay-runtime"; declare export opaque type NonNullFragment$ref: FragmentReference; declare export opaque type NonNullFragment$fragmentType: NonNullFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-non-null-item-in-non-null-plural-linked-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-non-null-item-in-non-null-plural-linked-field.expected index b631064636b1b..d15b0c5ec991c 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-non-null-item-in-non-null-plural-linked-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-non-null-item-in-non-null-plural-linked-field.expected @@ -5,6 +5,74 @@ fragment SomeFragment on User { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type SomeFragment$ref: FragmentReference; +declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; +export type SomeFragment = {| + +parents: $ReadOnlyArray, + +$refType: SomeFragment$ref, +|}; +export type SomeFragment$data = SomeFragment; +export type SomeFragment$key = { + +$data?: SomeFragment$data, + +$fragmentRefs: SomeFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type SomeFragment$ref: FragmentReference; +declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; +export type SomeFragment = {| + +parents: $ReadOnlyArray, + +$refType: SomeFragment$ref, +|}; +export type SomeFragment$data = SomeFragment; +export type SomeFragment$key = { + +$data?: SomeFragment$data, + +$fragmentRefs: SomeFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type SomeFragment$ref: FragmentReference; +declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; +export type SomeFragment = {| + +parents: $ReadOnlyArray, + +$refType: SomeFragment$ref, +|}; +export type SomeFragment$data = SomeFragment; +export type SomeFragment$key = { + +$data?: SomeFragment$data, + +$fragmentRefs: SomeFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import type { FragmentReference } from "relay-runtime"; declare export opaque type SomeFragment$ref: FragmentReference; declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-non-null-linked-field-through-inline-fragment.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-non-null-linked-field-through-inline-fragment.expected index a6312eeab06f1..3ff6566d7603c 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-non-null-linked-field-through-inline-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-non-null-linked-field-through-inline-fragment.expected @@ -7,6 +7,74 @@ fragment SomeFragment on User { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type SomeFragment$ref: FragmentReference; +declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; +export type SomeFragment = {| + +nearest_neighbor: ?{| + +name: string + |}, + +$refType: SomeFragment$ref, +|}; +export type SomeFragment$data = SomeFragment; +export type SomeFragment$key = { + +$data?: SomeFragment$data, + +$fragmentRefs: SomeFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type SomeFragment$ref: FragmentReference; +declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; +export type SomeFragment = {| + +nearest_neighbor: ?{| + +name: string + |}, + +$refType: SomeFragment$ref, +|}; +export type SomeFragment$data = SomeFragment; +export type SomeFragment$key = { + +$data?: SomeFragment$data, + +$fragmentRefs: SomeFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type SomeFragment$ref: FragmentReference; +declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; +export type SomeFragment = {| + +nearest_neighbor: ?{| + +name: string + |}, + +$refType: SomeFragment$ref, +|}; +export type SomeFragment$data = SomeFragment; +export type SomeFragment$key = { + +$data?: SomeFragment$data, + +$fragmentRefs: SomeFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import type { FragmentReference } from "relay-runtime"; declare export opaque type SomeFragment$ref: FragmentReference; declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-non-null-linked-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-non-null-linked-field.expected index 847985144aab0..3ea84c6335313 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-non-null-linked-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-non-null-linked-field.expected @@ -5,6 +5,74 @@ fragment SomeFragment on User { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type SomeFragment$ref: FragmentReference; +declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; +export type SomeFragment = {| + +nearest_neighbor: ?{| + +name: string + |}, + +$refType: SomeFragment$ref, +|}; +export type SomeFragment$data = SomeFragment; +export type SomeFragment$key = { + +$data?: SomeFragment$data, + +$fragmentRefs: SomeFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type SomeFragment$ref: FragmentReference; +declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; +export type SomeFragment = {| + +nearest_neighbor: ?{| + +name: string + |}, + +$refType: SomeFragment$ref, +|}; +export type SomeFragment$data = SomeFragment; +export type SomeFragment$key = { + +$data?: SomeFragment$data, + +$fragmentRefs: SomeFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type SomeFragment$ref: FragmentReference; +declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; +export type SomeFragment = {| + +nearest_neighbor: ?{| + +name: string + |}, + +$refType: SomeFragment$ref, +|}; +export type SomeFragment$data = SomeFragment; +export type SomeFragment$key = { + +$data?: SomeFragment$data, + +$fragmentRefs: SomeFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import type { FragmentReference } from "relay-runtime"; declare export opaque type SomeFragment$ref: FragmentReference; declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-non-null-plural-linked-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-non-null-plural-linked-field.expected index ca2a309412de3..5925931c1d2d5 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-non-null-plural-linked-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-non-null-plural-linked-field.expected @@ -5,6 +5,74 @@ fragment SomeFragment on User { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type SomeFragment$ref: FragmentReference; +declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; +export type SomeFragment = {| + +neighbors: ?$ReadOnlyArray, + +$refType: SomeFragment$ref, +|}; +export type SomeFragment$data = SomeFragment; +export type SomeFragment$key = { + +$data?: SomeFragment$data, + +$fragmentRefs: SomeFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type SomeFragment$ref: FragmentReference; +declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; +export type SomeFragment = {| + +neighbors: ?$ReadOnlyArray, + +$refType: SomeFragment$ref, +|}; +export type SomeFragment$data = SomeFragment; +export type SomeFragment$key = { + +$data?: SomeFragment$data, + +$fragmentRefs: SomeFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type SomeFragment$ref: FragmentReference; +declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; +export type SomeFragment = {| + +neighbors: ?$ReadOnlyArray, + +$refType: SomeFragment$ref, +|}; +export type SomeFragment$data = SomeFragment; +export type SomeFragment$key = { + +$data?: SomeFragment$data, + +$fragmentRefs: SomeFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import type { FragmentReference } from "relay-runtime"; declare export opaque type SomeFragment$ref: FragmentReference; declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-query.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-query.expected index 09cf659b48458..01d84c5b30b13 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-query.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-query.expected @@ -6,6 +6,62 @@ query FooQuery { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type FooQueryVariables = {||}; +export type FooQueryResponse = ?{| + +me: {| + +firstName: ?string, + +lastName: string, + |} +|}; +export type FooQuery = {| + variables: FooQueryVariables, + response: FooQueryResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type FooQueryVariables = {||}; +export type FooQueryResponse = ?{| + +me: {| + +firstName: ?string, + +lastName: string, + |} +|}; +export type FooQuery = {| + variables: FooQueryVariables, + response: FooQueryResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type FooQueryVariables = {||}; +export type FooQueryResponse = ?{| + +me: {| + +firstName: ?string, + +lastName: string, + |} +|}; +export type FooQuery = {| + variables: FooQueryVariables, + response: FooQueryResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type FooQueryVariables = {||}; export type FooQueryResponse = ?{| +me: {| diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-up-to-mutation-response.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-up-to-mutation-response.expected index 361231f2e410c..9da54cc13a7b1 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-up-to-mutation-response.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-up-to-mutation-response.expected @@ -7,6 +7,104 @@ mutation CommentCreateMutation($input: CommentCreateInput!) { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type CommentCreateInput = {| + clientMutationId?: ?string, + feedbackId?: ?string, + feedback?: ?CommentfeedbackFeedback, +|}; +export type CommentfeedbackFeedback = {| + comment?: ?FeedbackcommentComment +|}; +export type FeedbackcommentComment = {| + feedback?: ?CommentfeedbackFeedback +|}; +export type CommentCreateMutationVariables = {| + input: CommentCreateInput +|}; +export type CommentCreateMutationResponse = ?{| + +commentCreate: {| + +comment: {| + +id: string + |} + |} +|}; +export type CommentCreateMutation = {| + variables: CommentCreateMutationVariables, + response: CommentCreateMutationResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type CommentCreateInput = {| + clientMutationId?: ?string, + feedbackId?: ?string, + feedback?: ?CommentfeedbackFeedback, +|}; +export type CommentfeedbackFeedback = {| + comment?: ?FeedbackcommentComment +|}; +export type FeedbackcommentComment = {| + feedback?: ?CommentfeedbackFeedback +|}; +export type CommentCreateMutationVariables = {| + input: CommentCreateInput +|}; +export type CommentCreateMutationResponse = ?{| + +commentCreate: {| + +comment: {| + +id: string + |} + |} +|}; +export type CommentCreateMutation = {| + variables: CommentCreateMutationVariables, + response: CommentCreateMutationResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type CommentCreateInput = {| + clientMutationId?: ?string, + feedbackId?: ?string, + feedback?: ?CommentfeedbackFeedback, +|}; +export type CommentfeedbackFeedback = {| + comment?: ?FeedbackcommentComment +|}; +export type FeedbackcommentComment = {| + feedback?: ?CommentfeedbackFeedback +|}; +export type CommentCreateMutationVariables = {| + input: CommentCreateInput +|}; +export type CommentCreateMutationResponse = ?{| + +commentCreate: {| + +comment: {| + +id: string + |} + |} +|}; +export type CommentCreateMutation = {| + variables: CommentCreateMutationVariables, + response: CommentCreateMutationResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type CommentCreateInput = {| clientMutationId?: ?string, feedbackId?: ?string, diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-chain-bubbles-to-non-null-linked-field-through-inline-fragment.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-chain-bubbles-to-non-null-linked-field-through-inline-fragment.expected index ce5d63d8e3388..d291b9e64a7d4 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-chain-bubbles-to-non-null-linked-field-through-inline-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-chain-bubbles-to-non-null-linked-field-through-inline-fragment.expected @@ -7,6 +7,80 @@ fragment SomeFragment on User { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type SomeFragment$ref: FragmentReference; +declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; +export type SomeFragment = {| + +nearest_neighbor: ?{| + +profile_picture: {| + +uri: string + |} + |}, + +$refType: SomeFragment$ref, +|}; +export type SomeFragment$data = SomeFragment; +export type SomeFragment$key = { + +$data?: SomeFragment$data, + +$fragmentRefs: SomeFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type SomeFragment$ref: FragmentReference; +declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; +export type SomeFragment = {| + +nearest_neighbor: ?{| + +profile_picture: {| + +uri: string + |} + |}, + +$refType: SomeFragment$ref, +|}; +export type SomeFragment$data = SomeFragment; +export type SomeFragment$key = { + +$data?: SomeFragment$data, + +$fragmentRefs: SomeFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type SomeFragment$ref: FragmentReference; +declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; +export type SomeFragment = {| + +nearest_neighbor: ?{| + +profile_picture: {| + +uri: string + |} + |}, + +$refType: SomeFragment$ref, +|}; +export type SomeFragment$data = SomeFragment; +export type SomeFragment$key = { + +$data?: SomeFragment$data, + +$fragmentRefs: SomeFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import type { FragmentReference } from "relay-runtime"; declare export opaque type SomeFragment$ref: FragmentReference; declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-isolates-concrete-inline-fragments.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-isolates-concrete-inline-fragments.expected index fd2e2fd20cd7d..2c490b08ccbe9 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-isolates-concrete-inline-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-isolates-concrete-inline-fragments.expected @@ -28,6 +28,56 @@ fragment Foo on Node { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type Bar$ref: FragmentReference; +declare export opaque type Bar$fragmentType: Bar$ref; +export type Bar = ?{| + +name?: string, + +body?: ?{| + +text: ?string + |}, + +$refType: Bar$ref, +|}; +export type Bar$data = Bar; +export type Bar$key = { + +$data?: Bar$data, + +$fragmentRefs: Bar$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type Foo$ref: FragmentReference; +declare export opaque type Foo$fragmentType: Foo$ref; +export type Foo = ?{| + +__typename: "User", + +name: string, +|} | {| + +__typename: "Comment", + +body: ?{| + +text: ?string + |}, +|} | {| + +__typename: "Feedback" | "Page" | "PhotoStory" | "Story" +|} & {| + +$refType: Foo$ref +|}; +export type Foo$data = Foo; +export type Foo$key = { + +$data?: Foo$data, + +$fragmentRefs: Foo$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + import type { FragmentReference } from "relay-runtime"; declare export opaque type Bar$ref: FragmentReference; declare export opaque type Bar$fragmentType: Bar$ref; @@ -48,22 +98,113 @@ export type Bar$key = { import type { FragmentReference } from "relay-runtime"; declare export opaque type Foo$ref: FragmentReference; declare export opaque type Foo$fragmentType: Foo$ref; -export type Foo = ?({| +export type Foo = ?{| + +__typename: "User", + +name: string, +|} | {| + +__typename: "Comment", + +body: ?{| + +text: ?string + |}, +|} | {| + +__typename: "Feedback" | "Page" | "PhotoStory" | "Story" +|} & {| + +$refType: Foo$ref +|}; +export type Foo$data = Foo; +export type Foo$key = { + +$data?: Foo$data, + +$fragmentRefs: Foo$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type Bar$ref: FragmentReference; +declare export opaque type Bar$fragmentType: Bar$ref; +export type Bar = ?{| + +name?: string, + +body?: ?{| + +text: ?string + |}, + +$refType: Bar$ref, +|}; +export type Bar$data = Bar; +export type Bar$key = { + +$data?: Bar$data, + +$fragmentRefs: Bar$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type Foo$ref: FragmentReference; +declare export opaque type Foo$fragmentType: Foo$ref; +export type Foo = ?{| +__typename: "User", +name: string, - +$refType: Foo$ref, |} | {| +__typename: "Comment", +body: ?{| +text: ?string |}, - +$refType: Foo$ref, |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +__typename: "%other", - +$refType: Foo$ref, -|}); + +__typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "%other" +|} & {| + +$refType: Foo$ref +|}; +export type Foo$data = Foo; +export type Foo$key = { + +$data?: Foo$data, + +$fragmentRefs: Foo$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type Bar$ref: FragmentReference; +declare export opaque type Bar$fragmentType: Bar$ref; +export type Bar = ?{| + +name?: string, + +body?: ?{| + +text: ?string + |}, + +$refType: Bar$ref, +|}; +export type Bar$data = Bar; +export type Bar$key = { + +$data?: Bar$data, + +$fragmentRefs: Bar$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type Foo$ref: FragmentReference; +declare export opaque type Foo$fragmentType: Foo$ref; +export type Foo = ?{| + +__typename: "User", + +name: string, +|} | {| + +__typename: "Comment", + +body: ?{| + +text: ?string + |}, +|} | {| + // This will never be '%other', but we need some + // value in case none of the concrete values match. + +__typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "%other" +|} & {| + +$refType: Foo$ref +|}; export type Foo$data = Foo; export type Foo$key = { +$data?: Foo$data, diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-raw-response-type.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-raw-response-type.expected index 97b084a29690f..6c838e870ceff 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-raw-response-type.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-raw-response-type.expected @@ -6,6 +6,83 @@ query MyQuery @raw_response_type { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type MyQueryVariables = {||}; +export type MyQueryResponse = ?{| + +me: {| + +id: string, + +name: string, + |} +|}; +export type MyQueryRawResponse = {| + +me: ?{| + +id: string, + +name: ?string, + |} +|}; +export type MyQuery = {| + variables: MyQueryVariables, + response: MyQueryResponse, + rawResponse: MyQueryRawResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type MyQueryVariables = {||}; +export type MyQueryResponse = ?{| + +me: {| + +id: string, + +name: string, + |} +|}; +export type MyQueryRawResponse = {| + +me: ?{| + +id: string, + +name: ?string, + |} +|}; +export type MyQuery = {| + variables: MyQueryVariables, + response: MyQueryResponse, + rawResponse: MyQueryRawResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type MyQueryVariables = {||}; +export type MyQueryResponse = ?{| + +me: {| + +id: string, + +name: string, + |} +|}; +export type MyQueryRawResponse = {| + +me: ?{| + +id: string, + +name: ?string, + |} +|}; +export type MyQuery = {| + variables: MyQueryVariables, + response: MyQueryResponse, + rawResponse: MyQueryRawResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type MyQueryVariables = {||}; export type MyQueryResponse = ?{| +me: {| diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throw-doesnt-bubbles-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throw-doesnt-bubbles-to-fragment.expected index 5b4d4853c20a2..10b5887e09f5b 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throw-doesnt-bubbles-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throw-doesnt-bubbles-to-fragment.expected @@ -4,6 +4,71 @@ fragment NonNullFragment on User { lastName @required(action: THROW) } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type NonNullFragment$ref: FragmentReference; +declare export opaque type NonNullFragment$fragmentType: NonNullFragment$ref; +export type NonNullFragment = {| + +firstName: ?string, + +lastName: string, + +$refType: NonNullFragment$ref, +|}; +export type NonNullFragment$data = NonNullFragment; +export type NonNullFragment$key = { + +$data?: NonNullFragment$data, + +$fragmentRefs: NonNullFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type NonNullFragment$ref: FragmentReference; +declare export opaque type NonNullFragment$fragmentType: NonNullFragment$ref; +export type NonNullFragment = {| + +firstName: ?string, + +lastName: string, + +$refType: NonNullFragment$ref, +|}; +export type NonNullFragment$data = NonNullFragment; +export type NonNullFragment$key = { + +$data?: NonNullFragment$data, + +$fragmentRefs: NonNullFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type NonNullFragment$ref: FragmentReference; +declare export opaque type NonNullFragment$fragmentType: NonNullFragment$ref; +export type NonNullFragment = {| + +firstName: ?string, + +lastName: string, + +$refType: NonNullFragment$ref, +|}; +export type NonNullFragment$data = NonNullFragment; +export type NonNullFragment$key = { + +$data?: NonNullFragment$data, + +$fragmentRefs: NonNullFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import type { FragmentReference } from "relay-runtime"; declare export opaque type NonNullFragment$ref: FragmentReference; declare export opaque type NonNullFragment$fragmentType: NonNullFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throw-doesnt-bubbles-to-query.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throw-doesnt-bubbles-to-query.expected index 2bbcbc3c1baa0..c32d8ab4a4279 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throw-doesnt-bubbles-to-query.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throw-doesnt-bubbles-to-query.expected @@ -6,6 +6,62 @@ query FooQuery { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type FooQueryVariables = {||}; +export type FooQueryResponse = {| + +me: {| + +firstName: ?string, + +lastName: ?string, + |} +|}; +export type FooQuery = {| + variables: FooQueryVariables, + response: FooQueryResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type FooQueryVariables = {||}; +export type FooQueryResponse = {| + +me: {| + +firstName: ?string, + +lastName: ?string, + |} +|}; +export type FooQuery = {| + variables: FooQueryVariables, + response: FooQueryResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type FooQueryVariables = {||}; +export type FooQueryResponse = {| + +me: {| + +firstName: ?string, + +lastName: ?string, + |} +|}; +export type FooQuery = {| + variables: FooQueryVariables, + response: FooQueryResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type FooQueryVariables = {||}; export type FooQueryResponse = {| +me: {| diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throws-nested.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throws-nested.expected index 8b1ab03230fd8..fafea18175e11 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throws-nested.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throws-nested.expected @@ -6,6 +6,62 @@ query FooQuery { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type FooQueryVariables = {||}; +export type FooQueryResponse = {| + +me: ?{| + +firstName: ?string, + +lastName: string, + |} +|}; +export type FooQuery = {| + variables: FooQueryVariables, + response: FooQueryResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type FooQueryVariables = {||}; +export type FooQueryResponse = {| + +me: ?{| + +firstName: ?string, + +lastName: string, + |} +|}; +export type FooQuery = {| + variables: FooQueryVariables, + response: FooQueryResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type FooQueryVariables = {||}; +export type FooQueryResponse = {| + +me: ?{| + +firstName: ?string, + +lastName: string, + |} +|}; +export type FooQuery = {| + variables: FooQueryVariables, + response: FooQueryResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type FooQueryVariables = {||}; export type FooQueryResponse = {| +me: ?{| diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throws-within-non-null-linked-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throws-within-non-null-linked-field.expected index 4960335a1198a..c85589c49ec11 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throws-within-non-null-linked-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throws-within-non-null-linked-field.expected @@ -5,6 +5,74 @@ fragment SomeFragment on User { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type SomeFragment$ref: FragmentReference; +declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; +export type SomeFragment = {| + +nearest_neighbor: {| + +name: string + |}, + +$refType: SomeFragment$ref, +|}; +export type SomeFragment$data = SomeFragment; +export type SomeFragment$key = { + +$data?: SomeFragment$data, + +$fragmentRefs: SomeFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type SomeFragment$ref: FragmentReference; +declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; +export type SomeFragment = {| + +nearest_neighbor: {| + +name: string + |}, + +$refType: SomeFragment$ref, +|}; +export type SomeFragment$data = SomeFragment; +export type SomeFragment$key = { + +$data?: SomeFragment$data, + +$fragmentRefs: SomeFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type SomeFragment$ref: FragmentReference; +declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; +export type SomeFragment = {| + +nearest_neighbor: {| + +name: string + |}, + +$refType: SomeFragment$ref, +|}; +export type SomeFragment$data = SomeFragment; +export type SomeFragment$key = { + +$data?: SomeFragment$data, + +$fragmentRefs: SomeFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import type { FragmentReference } from "relay-runtime"; declare export opaque type SomeFragment$ref: FragmentReference; declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throws-within-non-null-plural-linked-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throws-within-non-null-plural-linked-field.expected index c67fd1e885d22..390ffe560b996 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throws-within-non-null-plural-linked-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throws-within-non-null-plural-linked-field.expected @@ -5,6 +5,74 @@ fragment SomeFragment on User { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type SomeFragment$ref: FragmentReference; +declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; +export type SomeFragment = {| + +neighbors: ?$ReadOnlyArray<{| + +name: string + |}>, + +$refType: SomeFragment$ref, +|}; +export type SomeFragment$data = SomeFragment; +export type SomeFragment$key = { + +$data?: SomeFragment$data, + +$fragmentRefs: SomeFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type SomeFragment$ref: FragmentReference; +declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; +export type SomeFragment = {| + +neighbors: ?$ReadOnlyArray<{| + +name: string + |}>, + +$refType: SomeFragment$ref, +|}; +export type SomeFragment$data = SomeFragment; +export type SomeFragment$key = { + +$data?: SomeFragment$data, + +$fragmentRefs: SomeFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type SomeFragment$ref: FragmentReference; +declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; +export type SomeFragment = {| + +neighbors: ?$ReadOnlyArray<{| + +name: string + |}>, + +$refType: SomeFragment$ref, +|}; +export type SomeFragment$data = SomeFragment; +export type SomeFragment$key = { + +$data?: SomeFragment$data, + +$fragmentRefs: SomeFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import type { FragmentReference } from "relay-runtime"; declare export opaque type SomeFragment$ref: FragmentReference; declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required.expected index e82aac670513c..591f753c13b2d 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required.expected @@ -6,6 +6,62 @@ query FooQuery { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type FooQueryVariables = {||}; +export type FooQueryResponse = {| + +me: ?{| + +firstName: ?string, + +lastName: string, + |} +|}; +export type FooQuery = {| + variables: FooQueryVariables, + response: FooQueryResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type FooQueryVariables = {||}; +export type FooQueryResponse = {| + +me: ?{| + +firstName: ?string, + +lastName: string, + |} +|}; +export type FooQuery = {| + variables: FooQueryVariables, + response: FooQueryResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type FooQueryVariables = {||}; +export type FooQueryResponse = {| + +me: ?{| + +firstName: ?string, + +lastName: string, + |} +|}; +export type FooQuery = {| + variables: FooQueryVariables, + response: FooQueryResponse, +|}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type FooQueryVariables = {||}; export type FooQueryResponse = {| +me: ?{| diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/roots.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/roots.expected index e9ca5bcadf722..fdbb3c02203d4 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/roots.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/roots.expected @@ -25,6 +25,242 @@ subscription TestSubscription($input: FeedbackLikeInput) { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type ExampleQueryVariables = {| + id: string +|}; +export type ExampleQueryResponse = {| + +node: ?{| + +id: string + |} +|}; +export type ExampleQuery = {| + variables: ExampleQueryVariables, + response: ExampleQueryResponse, +|}; +------------------------------------------------------------------------------- +export type CommentCreateInput = {| + clientMutationId?: ?string, + feedbackId?: ?string, + feedback?: ?CommentfeedbackFeedback, +|}; +export type CommentfeedbackFeedback = {| + comment?: ?FeedbackcommentComment +|}; +export type FeedbackcommentComment = {| + feedback?: ?CommentfeedbackFeedback +|}; +export type TestMutationVariables = {| + input: CommentCreateInput +|}; +export type TestMutationResponse = {| + +commentCreate: ?{| + +comment: ?{| + +id: string + |} + |} +|}; +export type TestMutation = {| + variables: TestMutationVariables, + response: TestMutationResponse, +|}; +------------------------------------------------------------------------------- +export type FeedbackLikeInput = {| + clientMutationId?: ?string, + feedbackId?: ?string, +|}; +export type TestSubscriptionVariables = {| + input?: ?FeedbackLikeInput +|}; +export type TestSubscriptionResponse = {| + +feedbackLikeSubscribe: ?{| + +feedback: ?{| + +id: string + |} + |} +|}; +export type TestSubscription = {| + variables: TestSubscriptionVariables, + response: TestSubscriptionResponse, +|}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type ExampleFragment$ref: FragmentReference; +declare export opaque type ExampleFragment$fragmentType: ExampleFragment$ref; +export type ExampleFragment = {| + +id: string, + +$refType: ExampleFragment$ref, +|}; +export type ExampleFragment$data = ExampleFragment; +export type ExampleFragment$key = { + +$data?: ExampleFragment$data, + +$fragmentRefs: ExampleFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type ExampleQueryVariables = {| + id: string +|}; +export type ExampleQueryResponse = {| + +node: ?{| + +id: string + |} +|}; +export type ExampleQuery = {| + variables: ExampleQueryVariables, + response: ExampleQueryResponse, +|}; +------------------------------------------------------------------------------- +export type CommentCreateInput = {| + clientMutationId?: ?string, + feedbackId?: ?string, + feedback?: ?CommentfeedbackFeedback, +|}; +export type CommentfeedbackFeedback = {| + comment?: ?FeedbackcommentComment +|}; +export type FeedbackcommentComment = {| + feedback?: ?CommentfeedbackFeedback +|}; +export type TestMutationVariables = {| + input: CommentCreateInput +|}; +export type TestMutationResponse = {| + +commentCreate: ?{| + +comment: ?{| + +id: string + |} + |} +|}; +export type TestMutation = {| + variables: TestMutationVariables, + response: TestMutationResponse, +|}; +------------------------------------------------------------------------------- +export type FeedbackLikeInput = {| + clientMutationId?: ?string, + feedbackId?: ?string, +|}; +export type TestSubscriptionVariables = {| + input?: ?FeedbackLikeInput +|}; +export type TestSubscriptionResponse = {| + +feedbackLikeSubscribe: ?{| + +feedback: ?{| + +id: string + |} + |} +|}; +export type TestSubscription = {| + variables: TestSubscriptionVariables, + response: TestSubscriptionResponse, +|}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type ExampleFragment$ref: FragmentReference; +declare export opaque type ExampleFragment$fragmentType: ExampleFragment$ref; +export type ExampleFragment = {| + +id: string, + +$refType: ExampleFragment$ref, +|}; +export type ExampleFragment$data = ExampleFragment; +export type ExampleFragment$key = { + +$data?: ExampleFragment$data, + +$fragmentRefs: ExampleFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type ExampleQueryVariables = {| + id: string +|}; +export type ExampleQueryResponse = {| + +node: ?{| + +id: string + |} +|}; +export type ExampleQuery = {| + variables: ExampleQueryVariables, + response: ExampleQueryResponse, +|}; +------------------------------------------------------------------------------- +export type CommentCreateInput = {| + clientMutationId?: ?string, + feedbackId?: ?string, + feedback?: ?CommentfeedbackFeedback, +|}; +export type CommentfeedbackFeedback = {| + comment?: ?FeedbackcommentComment +|}; +export type FeedbackcommentComment = {| + feedback?: ?CommentfeedbackFeedback +|}; +export type TestMutationVariables = {| + input: CommentCreateInput +|}; +export type TestMutationResponse = {| + +commentCreate: ?{| + +comment: ?{| + +id: string + |} + |} +|}; +export type TestMutation = {| + variables: TestMutationVariables, + response: TestMutationResponse, +|}; +------------------------------------------------------------------------------- +export type FeedbackLikeInput = {| + clientMutationId?: ?string, + feedbackId?: ?string, +|}; +export type TestSubscriptionVariables = {| + input?: ?FeedbackLikeInput +|}; +export type TestSubscriptionResponse = {| + +feedbackLikeSubscribe: ?{| + +feedback: ?{| + +id: string + |} + |} +|}; +export type TestSubscription = {| + variables: TestSubscriptionVariables, + response: TestSubscriptionResponse, +|}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type ExampleFragment$ref: FragmentReference; +declare export opaque type ExampleFragment$fragmentType: ExampleFragment$ref; +export type ExampleFragment = {| + +id: string, + +$refType: ExampleFragment$ref, +|}; +export type ExampleFragment$data = ExampleFragment; +export type ExampleFragment$key = { + +$data?: ExampleFragment$data, + +$fragmentRefs: ExampleFragment$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type ExampleQueryVariables = {| id: string |}; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/scalar-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/scalar-field.expected index fa4e94725ada7..39e67c03adb7e 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/scalar-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/scalar-field.expected @@ -13,6 +13,101 @@ fragment ScalarField on User { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type PersonalityTraits = "CHEERFUL" | "DERISIVE" | "HELPFUL" | "SNARKY"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type ScalarField$ref: FragmentReference; +declare export opaque type ScalarField$fragmentType: ScalarField$ref; +export type ScalarField = {| + +id: string, + +name: ?string, + +websites: ?$ReadOnlyArray, + +traits: ?$ReadOnlyArray, + +aliasedLinkedField: ?{| + +aliasedField: ?number + |}, + +screennames: ?$ReadOnlyArray, + +$refType: ScalarField$ref, +|}; +export type ScalarField$data = ScalarField; +export type ScalarField$key = { + +$data?: ScalarField$data, + +$fragmentRefs: ScalarField$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type PersonalityTraits = "CHEERFUL" | "DERISIVE" | "HELPFUL" | "SNARKY" | "%future added value"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type ScalarField$ref: FragmentReference; +declare export opaque type ScalarField$fragmentType: ScalarField$ref; +export type ScalarField = {| + +id: string, + +name: ?string, + +websites: ?$ReadOnlyArray, + +traits: ?$ReadOnlyArray, + +aliasedLinkedField: ?{| + +aliasedField: ?number + |}, + +screennames: ?$ReadOnlyArray, + +$refType: ScalarField$ref, +|}; +export type ScalarField$data = ScalarField; +export type ScalarField$key = { + +$data?: ScalarField$data, + +$fragmentRefs: ScalarField$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type PersonalityTraits = "CHEERFUL" | "DERISIVE" | "HELPFUL" | "SNARKY"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type ScalarField$ref: FragmentReference; +declare export opaque type ScalarField$fragmentType: ScalarField$ref; +export type ScalarField = {| + +id: string, + +name: ?string, + +websites: ?$ReadOnlyArray, + +traits: ?$ReadOnlyArray, + +aliasedLinkedField: ?{| + +aliasedField: ?number + |}, + +screennames: ?$ReadOnlyArray, + +$refType: ScalarField$ref, +|}; +export type ScalarField$data = ScalarField; +export type ScalarField$key = { + +$data?: ScalarField$data, + +$fragmentRefs: ScalarField$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type PersonalityTraits = "CHEERFUL" | "DERISIVE" | "HELPFUL" | "SNARKY" | "%future added value"; import type { FragmentReference } from "relay-runtime"; declare export opaque type ScalarField$ref: FragmentReference; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/simple.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/simple.expected index 5e073ec3e140e..682c89107ffeb 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/simple.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/simple.expected @@ -8,6 +8,83 @@ fragment LinkedField on User { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type LinkedField$ref: FragmentReference; +declare export opaque type LinkedField$fragmentType: LinkedField$ref; +export type LinkedField = {| + +name: ?string, + +profilePicture: ?{| + +uri: ?string, + +width: ?number, + +height: ?number, + |}, + +$refType: LinkedField$ref, +|}; +export type LinkedField$data = LinkedField; +export type LinkedField$key = { + +$data?: LinkedField$data, + +$fragmentRefs: LinkedField$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type LinkedField$ref: FragmentReference; +declare export opaque type LinkedField$fragmentType: LinkedField$ref; +export type LinkedField = {| + +name: ?string, + +profilePicture: ?{| + +uri: ?string, + +width: ?number, + +height: ?number, + |}, + +$refType: LinkedField$ref, +|}; +export type LinkedField$data = LinkedField; +export type LinkedField$key = { + +$data?: LinkedField$data, + +$fragmentRefs: LinkedField$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type LinkedField$ref: FragmentReference; +declare export opaque type LinkedField$fragmentType: LinkedField$ref; +export type LinkedField = {| + +name: ?string, + +profilePicture: ?{| + +uri: ?string, + +width: ?number, + +height: ?number, + |}, + +$refType: LinkedField$ref, +|}; +export type LinkedField$data = LinkedField; +export type LinkedField$key = { + +$data?: LinkedField$data, + +$fragmentRefs: LinkedField$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import type { FragmentReference } from "relay-runtime"; declare export opaque type LinkedField$ref: FragmentReference; declare export opaque type LinkedField$fragmentType: LinkedField$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-inside-with-overlapping-fields.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-inside-with-overlapping-fields.expected index 687c34aa09f14..19ad6ea1cb05e 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-inside-with-overlapping-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-inside-with-overlapping-fields.expected @@ -16,6 +16,105 @@ fragment TypenameInsideWithOverlappingFields on Viewer { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type TypenameInsideWithOverlappingFields$ref: FragmentReference; +declare export opaque type TypenameInsideWithOverlappingFields$fragmentType: TypenameInsideWithOverlappingFields$ref; +export type TypenameInsideWithOverlappingFields = {| + +actor: ?({| + +__typename: "Page", + +id: string, + +name: ?string, + |} | {| + +__typename: "User", + +id: string, + +name: ?string, + +profile_picture: ?{| + +uri: ?string + |}, + |}), + +$refType: TypenameInsideWithOverlappingFields$ref, +|}; +export type TypenameInsideWithOverlappingFields$data = TypenameInsideWithOverlappingFields; +export type TypenameInsideWithOverlappingFields$key = { + +$data?: TypenameInsideWithOverlappingFields$data, + +$fragmentRefs: TypenameInsideWithOverlappingFields$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type TypenameInsideWithOverlappingFields$ref: FragmentReference; +declare export opaque type TypenameInsideWithOverlappingFields$fragmentType: TypenameInsideWithOverlappingFields$ref; +export type TypenameInsideWithOverlappingFields = {| + +actor: ?({| + +__typename: "Page", + +id: string, + +name: ?string, + |} | {| + +__typename: "User", + +id: string, + +name: ?string, + +profile_picture: ?{| + +uri: ?string + |}, + |}), + +$refType: TypenameInsideWithOverlappingFields$ref, +|}; +export type TypenameInsideWithOverlappingFields$data = TypenameInsideWithOverlappingFields; +export type TypenameInsideWithOverlappingFields$key = { + +$data?: TypenameInsideWithOverlappingFields$data, + +$fragmentRefs: TypenameInsideWithOverlappingFields$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type TypenameInsideWithOverlappingFields$ref: FragmentReference; +declare export opaque type TypenameInsideWithOverlappingFields$fragmentType: TypenameInsideWithOverlappingFields$ref; +export type TypenameInsideWithOverlappingFields = {| + +actor: ?({| + +__typename: "Page", + +id: string, + +name: ?string, + |} | {| + +__typename: "User", + +id: string, + +name: ?string, + +profile_picture: ?{| + +uri: ?string + |}, + |} | {| + // This will never be '%other', but we need some + // value in case none of the concrete values match. + +__typename: "%other" + |}), + +$refType: TypenameInsideWithOverlappingFields$ref, +|}; +export type TypenameInsideWithOverlappingFields$data = TypenameInsideWithOverlappingFields; +export type TypenameInsideWithOverlappingFields$key = { + +$data?: TypenameInsideWithOverlappingFields$data, + +$fragmentRefs: TypenameInsideWithOverlappingFields$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import type { FragmentReference } from "relay-runtime"; declare export opaque type TypenameInsideWithOverlappingFields$ref: FragmentReference; declare export opaque type TypenameInsideWithOverlappingFields$fragmentType: TypenameInsideWithOverlappingFields$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected index 6faea549595a9..f7c8ffce47323 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected @@ -80,22 +80,346 @@ fragment TypenameAliases on Actor { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type TypenameAlias$ref: FragmentReference; +declare export opaque type TypenameAlias$fragmentType: TypenameAlias$ref; +export type TypenameAlias = {| + +_typeAlias: "User", + +firstName: ?string, +|} | {| + +_typeAlias: "Page", + +username: ?string, +|} & {| + +$refType: TypenameAlias$ref +|}; +export type TypenameAlias$data = TypenameAlias; +export type TypenameAlias$key = { + +$data?: TypenameAlias$data, + +$fragmentRefs: TypenameAlias$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type TypenameAliases$ref: FragmentReference; +declare export opaque type TypenameAliases$fragmentType: TypenameAliases$ref; +export type TypenameAliases = {| + +_typeAlias1: "User", + +_typeAlias2: "User", + +firstName: ?string, +|} | {| + +_typeAlias1: "Page", + +_typeAlias2: "Page", + +username: ?string, +|} & {| + +$refType: TypenameAliases$ref +|}; +export type TypenameAliases$data = TypenameAliases; +export type TypenameAliases$key = { + +$data?: TypenameAliases$data, + +$fragmentRefs: TypenameAliases$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type TypenameInside$ref: FragmentReference; +declare export opaque type TypenameInside$fragmentType: TypenameInside$ref; +export type TypenameInside = {| + +__typename: "User", + +firstName: ?string, +|} | {| + +__typename: "Page", + +username: ?string, +|} & {| + +$refType: TypenameInside$ref +|}; +export type TypenameInside$data = TypenameInside; +export type TypenameInside$key = { + +$data?: TypenameInside$data, + +$fragmentRefs: TypenameInside$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type TypenameOutside$ref: FragmentReference; +declare export opaque type TypenameOutside$fragmentType: TypenameOutside$ref; +export type TypenameOutside = {| + +__typename: "User", + +firstName: ?string, +|} | {| + +__typename: "Page", + +username: ?string, +|} & {| + +$refType: TypenameOutside$ref +|}; +export type TypenameOutside$data = TypenameOutside; +export type TypenameOutside$key = { + +$data?: TypenameOutside$data, + +$fragmentRefs: TypenameOutside$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type TypenameOutsideWithAbstractType$ref: FragmentReference; +declare export opaque type TypenameOutsideWithAbstractType$fragmentType: TypenameOutsideWithAbstractType$ref; +export type TypenameOutsideWithAbstractType = {| + +__typename: "User", + +firstName: ?string, + +address: ?{| + +street: ?string, + +city: ?string, + |}, +|} | {| + +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" +|} & {| + +username?: ?string, + +address?: ?{| + +city: ?string, + +country: ?string, + |}, + +$refType: TypenameOutsideWithAbstractType$ref, +|}; +export type TypenameOutsideWithAbstractType$data = TypenameOutsideWithAbstractType; +export type TypenameOutsideWithAbstractType$key = { + +$data?: TypenameOutsideWithAbstractType$data, + +$fragmentRefs: TypenameOutsideWithAbstractType$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type TypenameWithCommonSelections$ref: FragmentReference; +declare export opaque type TypenameWithCommonSelections$fragmentType: TypenameWithCommonSelections$ref; +export type TypenameWithCommonSelections = {| + +__typename: "User", + +firstName: ?string, +|} | {| + +__typename: "Page", + +username: ?string, +|} & {| + +name: ?string, + +$refType: TypenameWithCommonSelections$ref, +|}; +export type TypenameWithCommonSelections$data = TypenameWithCommonSelections; +export type TypenameWithCommonSelections$key = { + +$data?: TypenameWithCommonSelections$data, + +$fragmentRefs: TypenameWithCommonSelections$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type TypenameWithoutSpreads$ref: FragmentReference; +declare export opaque type TypenameWithoutSpreads$fragmentType: TypenameWithoutSpreads$ref; +export type TypenameWithoutSpreads = {| + +__typename: "User", + +firstName: ?string, + +$refType: TypenameWithoutSpreads$ref, +|}; +export type TypenameWithoutSpreads$data = TypenameWithoutSpreads; +export type TypenameWithoutSpreads$key = { + +$data?: TypenameWithoutSpreads$data, + +$fragmentRefs: TypenameWithoutSpreads$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type TypenameWithoutSpreadsAbstractType$ref: FragmentReference; +declare export opaque type TypenameWithoutSpreadsAbstractType$fragmentType: TypenameWithoutSpreadsAbstractType$ref; +export type TypenameWithoutSpreadsAbstractType = {| + +__typename: string, + +id: string, + +$refType: TypenameWithoutSpreadsAbstractType$ref, +|}; +export type TypenameWithoutSpreadsAbstractType$data = TypenameWithoutSpreadsAbstractType; +export type TypenameWithoutSpreadsAbstractType$key = { + +$data?: TypenameWithoutSpreadsAbstractType$data, + +$fragmentRefs: TypenameWithoutSpreadsAbstractType$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type TypenameAlias$ref: FragmentReference; +declare export opaque type TypenameAlias$fragmentType: TypenameAlias$ref; +export type TypenameAlias = {| + +_typeAlias: "User", + +firstName: ?string, +|} | {| + +_typeAlias: "Page", + +username: ?string, +|} & {| + +$refType: TypenameAlias$ref +|}; +export type TypenameAlias$data = TypenameAlias; +export type TypenameAlias$key = { + +$data?: TypenameAlias$data, + +$fragmentRefs: TypenameAlias$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type TypenameAliases$ref: FragmentReference; +declare export opaque type TypenameAliases$fragmentType: TypenameAliases$ref; +export type TypenameAliases = {| + +_typeAlias1: "User", + +_typeAlias2: "User", + +firstName: ?string, +|} | {| + +_typeAlias1: "Page", + +_typeAlias2: "Page", + +username: ?string, +|} & {| + +$refType: TypenameAliases$ref +|}; +export type TypenameAliases$data = TypenameAliases; +export type TypenameAliases$key = { + +$data?: TypenameAliases$data, + +$fragmentRefs: TypenameAliases$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type TypenameInside$ref: FragmentReference; +declare export opaque type TypenameInside$fragmentType: TypenameInside$ref; +export type TypenameInside = {| + +__typename: "User", + +firstName: ?string, +|} | {| + +__typename: "Page", + +username: ?string, +|} & {| + +$refType: TypenameInside$ref +|}; +export type TypenameInside$data = TypenameInside; +export type TypenameInside$key = { + +$data?: TypenameInside$data, + +$fragmentRefs: TypenameInside$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type TypenameOutside$ref: FragmentReference; +declare export opaque type TypenameOutside$fragmentType: TypenameOutside$ref; +export type TypenameOutside = {| + +__typename: "User", + +firstName: ?string, +|} | {| + +__typename: "Page", + +username: ?string, +|} & {| + +$refType: TypenameOutside$ref +|}; +export type TypenameOutside$data = TypenameOutside; +export type TypenameOutside$key = { + +$data?: TypenameOutside$data, + +$fragmentRefs: TypenameOutside$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type TypenameOutsideWithAbstractType$ref: FragmentReference; +declare export opaque type TypenameOutsideWithAbstractType$fragmentType: TypenameOutsideWithAbstractType$ref; +export type TypenameOutsideWithAbstractType = {| + +__typename: "User", + +firstName: ?string, + +address: ?{| + +street: ?string, + +city: ?string, + |}, +|} | {| + +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" +|} & {| + +username?: ?string, + +address?: ?{| + +city: ?string, + +country: ?string, + |}, + +$refType: TypenameOutsideWithAbstractType$ref, +|}; +export type TypenameOutsideWithAbstractType$data = TypenameOutsideWithAbstractType; +export type TypenameOutsideWithAbstractType$key = { + +$data?: TypenameOutsideWithAbstractType$data, + +$fragmentRefs: TypenameOutsideWithAbstractType$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type TypenameWithCommonSelections$ref: FragmentReference; +declare export opaque type TypenameWithCommonSelections$fragmentType: TypenameWithCommonSelections$ref; +export type TypenameWithCommonSelections = {| + +__typename: "User", + +firstName: ?string, +|} | {| + +__typename: "Page", + +username: ?string, +|} & {| + +name: ?string, + +$refType: TypenameWithCommonSelections$ref, +|}; +export type TypenameWithCommonSelections$data = TypenameWithCommonSelections; +export type TypenameWithCommonSelections$key = { + +$data?: TypenameWithCommonSelections$data, + +$fragmentRefs: TypenameWithCommonSelections$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type TypenameWithoutSpreads$ref: FragmentReference; +declare export opaque type TypenameWithoutSpreads$fragmentType: TypenameWithoutSpreads$ref; +export type TypenameWithoutSpreads = {| + +__typename: "User", + +firstName: ?string, + +$refType: TypenameWithoutSpreads$ref, +|}; +export type TypenameWithoutSpreads$data = TypenameWithoutSpreads; +export type TypenameWithoutSpreads$key = { + +$data?: TypenameWithoutSpreads$data, + +$fragmentRefs: TypenameWithoutSpreads$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type TypenameWithoutSpreadsAbstractType$ref: FragmentReference; +declare export opaque type TypenameWithoutSpreadsAbstractType$fragmentType: TypenameWithoutSpreadsAbstractType$ref; +export type TypenameWithoutSpreadsAbstractType = {| + +__typename: string, + +id: string, + +$refType: TypenameWithoutSpreadsAbstractType$ref, +|}; +export type TypenameWithoutSpreadsAbstractType$data = TypenameWithoutSpreadsAbstractType; +export type TypenameWithoutSpreadsAbstractType$key = { + +$data?: TypenameWithoutSpreadsAbstractType$data, + +$fragmentRefs: TypenameWithoutSpreadsAbstractType$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + import type { FragmentReference } from "relay-runtime"; declare export opaque type TypenameAlias$ref: FragmentReference; declare export opaque type TypenameAlias$fragmentType: TypenameAlias$ref; export type TypenameAlias = {| +_typeAlias: "User", +firstName: ?string, - +$refType: TypenameAlias$ref, |} | {| +_typeAlias: "Page", +username: ?string, - +$refType: TypenameAlias$ref, |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +_typeAlias: "%other", - +$refType: TypenameAlias$ref, + +_typeAlias: "%other" +|} & {| + +$refType: TypenameAlias$ref |}; export type TypenameAlias$data = TypenameAlias; export type TypenameAlias$key = { @@ -111,12 +435,10 @@ export type TypenameAliases = {| +_typeAlias1: "User", +_typeAlias2: "User", +firstName: ?string, - +$refType: TypenameAliases$ref, |} | {| +_typeAlias1: "Page", +_typeAlias2: "Page", +username: ?string, - +$refType: TypenameAliases$ref, |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. @@ -124,7 +446,8 @@ export type TypenameAliases = {| // This will never be '%other', but we need some // value in case none of the concrete values match. +_typeAlias2: "%other", - +$refType: TypenameAliases$ref, +|} & {| + +$refType: TypenameAliases$ref |}; export type TypenameAliases$data = TypenameAliases; export type TypenameAliases$key = { @@ -139,16 +462,15 @@ declare export opaque type TypenameInside$fragmentType: TypenameInside$ref; export type TypenameInside = {| +__typename: "User", +firstName: ?string, - +$refType: TypenameInside$ref, |} | {| +__typename: "Page", +username: ?string, - +$refType: TypenameInside$ref, |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +__typename: "%other", - +$refType: TypenameInside$ref, + +__typename: "%other" +|} & {| + +$refType: TypenameInside$ref |}; export type TypenameInside$data = TypenameInside; export type TypenameInside$key = { @@ -163,16 +485,15 @@ declare export opaque type TypenameOutside$fragmentType: TypenameOutside$ref; export type TypenameOutside = {| +__typename: "User", +firstName: ?string, - +$refType: TypenameOutside$ref, |} | {| +__typename: "Page", +username: ?string, - +$refType: TypenameOutside$ref, |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +__typename: "%other", - +$refType: TypenameOutside$ref, + +__typename: "%other" +|} & {| + +$refType: TypenameOutside$ref |}; export type TypenameOutside$data = TypenameOutside; export type TypenameOutside$key = { @@ -185,14 +506,22 @@ import type { FragmentReference } from "relay-runtime"; declare export opaque type TypenameOutsideWithAbstractType$ref: FragmentReference; declare export opaque type TypenameOutsideWithAbstractType$fragmentType: TypenameOutsideWithAbstractType$ref; export type TypenameOutsideWithAbstractType = {| - +__typename: string, + +__typename: "User", + +firstName: ?string, + +address: ?{| + +street: ?string, + +city: ?string, + |}, +|} | {| + // This will never be '%other', but we need some + // value in case none of the concrete values match. + +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" | "%other" +|} & {| +username?: ?string, +address?: ?{| +city: ?string, +country: ?string, - +street?: ?string, |}, - +firstName?: ?string, +$refType: TypenameOutsideWithAbstractType$ref, |}; export type TypenameOutsideWithAbstractType$data = TypenameOutsideWithAbstractType; @@ -206,10 +535,17 @@ import type { FragmentReference } from "relay-runtime"; declare export opaque type TypenameWithCommonSelections$ref: FragmentReference; declare export opaque type TypenameWithCommonSelections$fragmentType: TypenameWithCommonSelections$ref; export type TypenameWithCommonSelections = {| - +__typename: string, + +__typename: "User", + +firstName: ?string, +|} | {| + +__typename: "Page", + +username: ?string, +|} | {| + // This will never be '%other', but we need some + // value in case none of the concrete values match. + +__typename: "%other" +|} & {| +name: ?string, - +firstName?: ?string, - +username?: ?string, +$refType: TypenameWithCommonSelections$ref, |}; export type TypenameWithCommonSelections$data = TypenameWithCommonSelections; @@ -223,8 +559,193 @@ import type { FragmentReference } from "relay-runtime"; declare export opaque type TypenameWithoutSpreads$ref: FragmentReference; declare export opaque type TypenameWithoutSpreads$fragmentType: TypenameWithoutSpreads$ref; export type TypenameWithoutSpreads = {| + +__typename: "User", + +firstName: ?string, + +$refType: TypenameWithoutSpreads$ref, +|}; +export type TypenameWithoutSpreads$data = TypenameWithoutSpreads; +export type TypenameWithoutSpreads$key = { + +$data?: TypenameWithoutSpreads$data, + +$fragmentRefs: TypenameWithoutSpreads$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type TypenameWithoutSpreadsAbstractType$ref: FragmentReference; +declare export opaque type TypenameWithoutSpreadsAbstractType$fragmentType: TypenameWithoutSpreadsAbstractType$ref; +export type TypenameWithoutSpreadsAbstractType = {| + +__typename: string, + +id: string, + +$refType: TypenameWithoutSpreadsAbstractType$ref, +|}; +export type TypenameWithoutSpreadsAbstractType$data = TypenameWithoutSpreadsAbstractType; +export type TypenameWithoutSpreadsAbstractType$key = { + +$data?: TypenameWithoutSpreadsAbstractType$data, + +$fragmentRefs: TypenameWithoutSpreadsAbstractType$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type TypenameAlias$ref: FragmentReference; +declare export opaque type TypenameAlias$fragmentType: TypenameAlias$ref; +export type TypenameAlias = {| + +_typeAlias: "User", + +firstName: ?string, +|} | {| + +_typeAlias: "Page", + +username: ?string, +|} | {| + // This will never be '%other', but we need some + // value in case none of the concrete values match. + +_typeAlias: "%other" +|} & {| + +$refType: TypenameAlias$ref +|}; +export type TypenameAlias$data = TypenameAlias; +export type TypenameAlias$key = { + +$data?: TypenameAlias$data, + +$fragmentRefs: TypenameAlias$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type TypenameAliases$ref: FragmentReference; +declare export opaque type TypenameAliases$fragmentType: TypenameAliases$ref; +export type TypenameAliases = {| + +_typeAlias1: "User", + +_typeAlias2: "User", +firstName: ?string, +|} | {| + +_typeAlias1: "Page", + +_typeAlias2: "Page", + +username: ?string, +|} | {| + // This will never be '%other', but we need some + // value in case none of the concrete values match. + +_typeAlias1: "%other", + // This will never be '%other', but we need some + // value in case none of the concrete values match. + +_typeAlias2: "%other", +|} & {| + +$refType: TypenameAliases$ref +|}; +export type TypenameAliases$data = TypenameAliases; +export type TypenameAliases$key = { + +$data?: TypenameAliases$data, + +$fragmentRefs: TypenameAliases$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type TypenameInside$ref: FragmentReference; +declare export opaque type TypenameInside$fragmentType: TypenameInside$ref; +export type TypenameInside = {| +__typename: "User", + +firstName: ?string, +|} | {| + +__typename: "Page", + +username: ?string, +|} | {| + // This will never be '%other', but we need some + // value in case none of the concrete values match. + +__typename: "%other" +|} & {| + +$refType: TypenameInside$ref +|}; +export type TypenameInside$data = TypenameInside; +export type TypenameInside$key = { + +$data?: TypenameInside$data, + +$fragmentRefs: TypenameInside$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type TypenameOutside$ref: FragmentReference; +declare export opaque type TypenameOutside$fragmentType: TypenameOutside$ref; +export type TypenameOutside = {| + +__typename: "User", + +firstName: ?string, +|} | {| + +__typename: "Page", + +username: ?string, +|} | {| + // This will never be '%other', but we need some + // value in case none of the concrete values match. + +__typename: "%other" +|} & {| + +$refType: TypenameOutside$ref +|}; +export type TypenameOutside$data = TypenameOutside; +export type TypenameOutside$key = { + +$data?: TypenameOutside$data, + +$fragmentRefs: TypenameOutside$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type TypenameOutsideWithAbstractType$ref: FragmentReference; +declare export opaque type TypenameOutsideWithAbstractType$fragmentType: TypenameOutsideWithAbstractType$ref; +export type TypenameOutsideWithAbstractType = {| + +__typename: "User", + +firstName: ?string, + +address: ?{| + +street: ?string, + +city: ?string, + |}, +|} | {| + // This will never be '%other', but we need some + // value in case none of the concrete values match. + +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" | "%other" +|} & {| + +username?: ?string, + +address?: ?{| + +city: ?string, + +country: ?string, + |}, + +$refType: TypenameOutsideWithAbstractType$ref, +|}; +export type TypenameOutsideWithAbstractType$data = TypenameOutsideWithAbstractType; +export type TypenameOutsideWithAbstractType$key = { + +$data?: TypenameOutsideWithAbstractType$data, + +$fragmentRefs: TypenameOutsideWithAbstractType$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type TypenameWithCommonSelections$ref: FragmentReference; +declare export opaque type TypenameWithCommonSelections$fragmentType: TypenameWithCommonSelections$ref; +export type TypenameWithCommonSelections = {| + +__typename: "User", + +firstName: ?string, +|} | {| + +__typename: "Page", + +username: ?string, +|} | {| + // This will never be '%other', but we need some + // value in case none of the concrete values match. + +__typename: "%other" +|} & {| + +name: ?string, + +$refType: TypenameWithCommonSelections$ref, +|}; +export type TypenameWithCommonSelections$data = TypenameWithCommonSelections; +export type TypenameWithCommonSelections$key = { + +$data?: TypenameWithCommonSelections$data, + +$fragmentRefs: TypenameWithCommonSelections$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type TypenameWithoutSpreads$ref: FragmentReference; +declare export opaque type TypenameWithoutSpreads$fragmentType: TypenameWithoutSpreads$ref; +export type TypenameWithoutSpreads = {| + +__typename: "User", + +firstName: ?string, +$refType: TypenameWithoutSpreads$ref, |}; export type TypenameWithoutSpreads$data = TypenameWithoutSpreads; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/unmasked-fragment-spreads.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/unmasked-fragment-spreads.expected index ad8e4eeb71fe8..c2c7727c5bda3 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/unmasked-fragment-spreads.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/unmasked-fragment-spreads.expected @@ -26,6 +26,221 @@ fragment AnotherRecursiveFragment on Image { height } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type AnotherRecursiveFragment$ref: FragmentReference; +declare export opaque type AnotherRecursiveFragment$fragmentType: AnotherRecursiveFragment$ref; +export type AnotherRecursiveFragment = {| + +uri: ?string, + +height: ?number, + +$refType: AnotherRecursiveFragment$ref, +|}; +export type AnotherRecursiveFragment$data = AnotherRecursiveFragment; +export type AnotherRecursiveFragment$key = { + +$data?: AnotherRecursiveFragment$data, + +$fragmentRefs: AnotherRecursiveFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type PhotoFragment$ref: FragmentReference; +declare export opaque type PhotoFragment$fragmentType: PhotoFragment$ref; +export type PhotoFragment = {| + +uri: ?string, + +width: ?number, + +$refType: PhotoFragment$ref, +|}; +export type PhotoFragment$data = PhotoFragment; +export type PhotoFragment$key = { + +$data?: PhotoFragment$data, + +$fragmentRefs: PhotoFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type RecursiveFragment$ref: FragmentReference; +declare export opaque type RecursiveFragment$fragmentType: RecursiveFragment$ref; +export type RecursiveFragment = { + +uri: ?string, + +width: ?number, + ... +}; +export type RecursiveFragment$data = RecursiveFragment; +export type RecursiveFragment$key = { + +$data?: RecursiveFragment$data, + +$fragmentRefs: RecursiveFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { PhotoFragment$ref } from "PhotoFragment.graphql"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type UserProfile$ref: FragmentReference; +declare export opaque type UserProfile$fragmentType: UserProfile$ref; +export type UserProfile = {| + +profilePicture: ?{| + +uri: ?string, + +width: ?number, + +height: ?number, + +$fragmentRefs: PhotoFragment$ref, + |}, + +$refType: UserProfile$ref, +|}; +export type UserProfile$data = UserProfile; +export type UserProfile$key = { + +$data?: UserProfile$data, + +$fragmentRefs: UserProfile$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type AnotherRecursiveFragment$ref: FragmentReference; +declare export opaque type AnotherRecursiveFragment$fragmentType: AnotherRecursiveFragment$ref; +export type AnotherRecursiveFragment = {| + +uri: ?string, + +height: ?number, + +$refType: AnotherRecursiveFragment$ref, +|}; +export type AnotherRecursiveFragment$data = AnotherRecursiveFragment; +export type AnotherRecursiveFragment$key = { + +$data?: AnotherRecursiveFragment$data, + +$fragmentRefs: AnotherRecursiveFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type PhotoFragment$ref: FragmentReference; +declare export opaque type PhotoFragment$fragmentType: PhotoFragment$ref; +export type PhotoFragment = {| + +uri: ?string, + +width: ?number, + +$refType: PhotoFragment$ref, +|}; +export type PhotoFragment$data = PhotoFragment; +export type PhotoFragment$key = { + +$data?: PhotoFragment$data, + +$fragmentRefs: PhotoFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type RecursiveFragment$ref: FragmentReference; +declare export opaque type RecursiveFragment$fragmentType: RecursiveFragment$ref; +export type RecursiveFragment = { + +uri: ?string, + +width: ?number, + ... +}; +export type RecursiveFragment$data = RecursiveFragment; +export type RecursiveFragment$key = { + +$data?: RecursiveFragment$data, + +$fragmentRefs: RecursiveFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { PhotoFragment$ref } from "PhotoFragment.graphql"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type UserProfile$ref: FragmentReference; +declare export opaque type UserProfile$fragmentType: UserProfile$ref; +export type UserProfile = {| + +profilePicture: ?{| + +uri: ?string, + +width: ?number, + +height: ?number, + +$fragmentRefs: PhotoFragment$ref, + |}, + +$refType: UserProfile$ref, +|}; +export type UserProfile$data = UserProfile; +export type UserProfile$key = { + +$data?: UserProfile$data, + +$fragmentRefs: UserProfile$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import type { FragmentReference } from "relay-runtime"; +declare export opaque type AnotherRecursiveFragment$ref: FragmentReference; +declare export opaque type AnotherRecursiveFragment$fragmentType: AnotherRecursiveFragment$ref; +export type AnotherRecursiveFragment = {| + +uri: ?string, + +height: ?number, + +$refType: AnotherRecursiveFragment$ref, +|}; +export type AnotherRecursiveFragment$data = AnotherRecursiveFragment; +export type AnotherRecursiveFragment$key = { + +$data?: AnotherRecursiveFragment$data, + +$fragmentRefs: AnotherRecursiveFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type PhotoFragment$ref: FragmentReference; +declare export opaque type PhotoFragment$fragmentType: PhotoFragment$ref; +export type PhotoFragment = {| + +uri: ?string, + +width: ?number, + +$refType: PhotoFragment$ref, +|}; +export type PhotoFragment$data = PhotoFragment; +export type PhotoFragment$key = { + +$data?: PhotoFragment$data, + +$fragmentRefs: PhotoFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { FragmentReference } from "relay-runtime"; +declare export opaque type RecursiveFragment$ref: FragmentReference; +declare export opaque type RecursiveFragment$fragmentType: RecursiveFragment$ref; +export type RecursiveFragment = { + +uri: ?string, + +width: ?number, + ... +}; +export type RecursiveFragment$data = RecursiveFragment; +export type RecursiveFragment$key = { + +$data?: RecursiveFragment$data, + +$fragmentRefs: RecursiveFragment$ref, + ... +}; +------------------------------------------------------------------------------- +import type { PhotoFragment$ref } from "PhotoFragment.graphql"; +import type { FragmentReference } from "relay-runtime"; +declare export opaque type UserProfile$ref: FragmentReference; +declare export opaque type UserProfile$fragmentType: UserProfile$ref; +export type UserProfile = {| + +profilePicture: ?{| + +uri: ?string, + +width: ?number, + +height: ?number, + +$fragmentRefs: PhotoFragment$ref, + |}, + +$refType: UserProfile$ref, +|}; +export type UserProfile$data = UserProfile; +export type UserProfile$key = { + +$data?: UserProfile$data, + +$fragmentRefs: UserProfile$ref, + ... +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import type { FragmentReference } from "relay-runtime"; declare export opaque type AnotherRecursiveFragment$ref: FragmentReference; declare export opaque type AnotherRecursiveFragment$fragmentType: AnotherRecursiveFragment$ref; @@ -71,7 +286,7 @@ export type RecursiveFragment$key = { ... }; ------------------------------------------------------------------------------- -import type { PhotoFragment$ref } from "./PhotoFragment.graphql"; +import type { PhotoFragment$ref } from "PhotoFragment.graphql"; import type { FragmentReference } from "relay-runtime"; declare export opaque type UserProfile$ref: FragmentReference; declare export opaque type UserProfile$fragmentType: UserProfile$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/mod.rs b/compiler/crates/relay-typegen/tests/generate_flow/mod.rs index 879b0c89620ac..686944f7e72d6 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/mod.rs +++ b/compiler/crates/relay-typegen/tests/generate_flow/mod.rs @@ -45,35 +45,51 @@ pub fn transform_fixture(fixture: &Fixture<'_>) -> Result { ) .unwrap(); - let typegen_config = TypegenConfig { - language: TypegenLanguage::Flow, - haste: true, - ..Default::default() - }; + let separator = + "-------------------------------------------------------------------------------\n"; + Ok(vec![false, false, true, false, false, true, true, true] + .chunks(2) + .map(|bools| (bools[0], bools[1])) + .map(|(future_proof_enums, future_proof_abstract_types)| { + let typegen_config = TypegenConfig { + language: TypegenLanguage::Flow, + haste: true, + future_proof_abstract_types, + future_proof_enums, + ..Default::default() + }; + + let mut operations: Vec<_> = programs.typegen.operations().collect(); + operations.sort_by_key(|op| op.name.item); + let operation_strings = operations.into_iter().map(|typegen_operation| { + let normalization_operation = programs + .normalization + .operation(typegen_operation.name.item) + .unwrap(); + relay_typegen::generate_operation_type( + typegen_operation, + normalization_operation, + &schema, + &typegen_config, + ) + }); - let mut operations: Vec<_> = programs.typegen.operations().collect(); - operations.sort_by_key(|op| op.name.item); - let operation_strings = operations.into_iter().map(|typegen_operation| { - let normalization_operation = programs - .normalization - .operation(typegen_operation.name.item) - .unwrap(); - relay_typegen::generate_operation_type( - typegen_operation, - normalization_operation, - &schema, - &typegen_config, - ) - }); + let mut fragments: Vec<_> = programs.typegen.fragments().collect(); + fragments.sort_by_key(|frag| frag.name.item); + let fragment_strings = fragments + .into_iter() + .map(|frag| relay_typegen::generate_fragment_type(frag, &schema, &typegen_config)); - let mut fragments: Vec<_> = programs.typegen.fragments().collect(); - fragments.sort_by_key(|frag| frag.name.item); - let fragment_strings = fragments - .into_iter() - .map(|frag| relay_typegen::generate_fragment_type(frag, &schema, &typegen_config)); + let mut result: Vec = operation_strings.collect(); + result.extend(fragment_strings); - let mut result: Vec = operation_strings.collect(); - result.extend(fragment_strings); - Ok(result - .join("-------------------------------------------------------------------------------\n")) + format!( + "/*\n * future proof enums: {}\n * future proof abstract types: {}\n */\n\n{}", + future_proof_enums, + future_proof_abstract_types, + result.join(separator) + ) + }) + .collect::>() + .join(separator)) } diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/conditional.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/conditional.expected index 3bf28a089d997..212454356d435 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/conditional.expected @@ -9,6 +9,92 @@ fragment NestedCondition on Node { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import { FragmentRefs } from "relay-runtime"; +export type ConditionField = { + readonly id?: string, + readonly " $refType": FragmentRefs<"ConditionField">, +}; +export type ConditionField$data = ConditionField; +export type ConditionField$key = { + readonly " $data"?: ConditionField$data, + readonly " $fragmentRefs": FragmentRefs<"ConditionField">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type NestedCondition = { + readonly id?: string, + readonly " $refType": FragmentRefs<"NestedCondition">, +}; +export type NestedCondition$data = NestedCondition; +export type NestedCondition$key = { + readonly " $data"?: NestedCondition$data, + readonly " $fragmentRefs": FragmentRefs<"NestedCondition">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import { FragmentRefs } from "relay-runtime"; +export type ConditionField = { + readonly id?: string, + readonly " $refType": FragmentRefs<"ConditionField">, +}; +export type ConditionField$data = ConditionField; +export type ConditionField$key = { + readonly " $data"?: ConditionField$data, + readonly " $fragmentRefs": FragmentRefs<"ConditionField">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type NestedCondition = { + readonly id?: string, + readonly " $refType": FragmentRefs<"NestedCondition">, +}; +export type NestedCondition$data = NestedCondition; +export type NestedCondition$key = { + readonly " $data"?: NestedCondition$data, + readonly " $fragmentRefs": FragmentRefs<"NestedCondition">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import { FragmentRefs } from "relay-runtime"; +export type ConditionField = { + readonly id?: string, + readonly " $refType": FragmentRefs<"ConditionField">, +}; +export type ConditionField$data = ConditionField; +export type ConditionField$key = { + readonly " $data"?: ConditionField$data, + readonly " $fragmentRefs": FragmentRefs<"ConditionField">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type NestedCondition = { + readonly id?: string, + readonly " $refType": FragmentRefs<"NestedCondition">, +}; +export type NestedCondition$data = NestedCondition; +export type NestedCondition$key = { + readonly " $data"?: NestedCondition$data, + readonly " $fragmentRefs": FragmentRefs<"NestedCondition">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import { FragmentRefs } from "relay-runtime"; export type ConditionField = { readonly id?: string, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected index 2e76bada805e0..504f6738653fa 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected @@ -48,6 +48,205 @@ fragment UserFrag2 on User { __typename } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import { FragmentRefs } from "relay-runtime"; +export type ConcreateTypes = { + readonly actor: { + readonly __typename: "Page", + readonly id: string, + readonly " $fragmentRefs": FragmentRefs<"PageFragment">, + } | { + readonly __typename: "User", + readonly name: string | null, + } | null, + readonly " $refType": FragmentRefs<"ConcreateTypes">, +}; +export type ConcreateTypes$data = ConcreateTypes; +export type ConcreateTypes$key = { + readonly " $data"?: ConcreateTypes$data, + readonly " $fragmentRefs": FragmentRefs<"ConcreateTypes">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type FragmentSpread = { + readonly id: string, + readonly justFrag: { + readonly " $fragmentRefs": FragmentRefs<"PictureFragment"> + } | null, + readonly fragAndField: { + readonly uri: string | null, + readonly " $fragmentRefs": FragmentRefs<"PictureFragment">, + } | null, + readonly " $fragmentRefs": FragmentRefs<"OtherFragment" | "UserFrag1" | "UserFrag2">, + readonly " $refType": FragmentRefs<"FragmentSpread">, +}; +export type FragmentSpread$data = FragmentSpread; +export type FragmentSpread$key = { + readonly " $data"?: FragmentSpread$data, + readonly " $fragmentRefs": FragmentRefs<"FragmentSpread">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type OtherFragment = { + readonly __typename: string, + readonly " $refType": FragmentRefs<"OtherFragment">, +}; +export type OtherFragment$data = OtherFragment; +export type OtherFragment$key = { + readonly " $data"?: OtherFragment$data, + readonly " $fragmentRefs": FragmentRefs<"OtherFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type PageFragment = { + readonly __typename: "Page", + readonly " $refType": FragmentRefs<"PageFragment">, +}; +export type PageFragment$data = PageFragment; +export type PageFragment$key = { + readonly " $data"?: PageFragment$data, + readonly " $fragmentRefs": FragmentRefs<"PageFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type PictureFragment = { + readonly __typename: "Image", + readonly " $refType": FragmentRefs<"PictureFragment">, +}; +export type PictureFragment$data = PictureFragment; +export type PictureFragment$key = { + readonly " $data"?: PictureFragment$data, + readonly " $fragmentRefs": FragmentRefs<"PictureFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type UserFrag1 = { + readonly __typename: "User", + readonly " $refType": FragmentRefs<"UserFrag1">, +}; +export type UserFrag1$data = UserFrag1; +export type UserFrag1$key = { + readonly " $data"?: UserFrag1$data, + readonly " $fragmentRefs": FragmentRefs<"UserFrag1">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type UserFrag2 = { + readonly __typename: "User", + readonly " $refType": FragmentRefs<"UserFrag2">, +}; +export type UserFrag2$data = UserFrag2; +export type UserFrag2$key = { + readonly " $data"?: UserFrag2$data, + readonly " $fragmentRefs": FragmentRefs<"UserFrag2">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import { FragmentRefs } from "relay-runtime"; +export type ConcreateTypes = { + readonly actor: { + readonly __typename: "Page", + readonly id: string, + readonly " $fragmentRefs": FragmentRefs<"PageFragment">, + } | { + readonly __typename: "User", + readonly name: string | null, + } | null, + readonly " $refType": FragmentRefs<"ConcreateTypes">, +}; +export type ConcreateTypes$data = ConcreateTypes; +export type ConcreateTypes$key = { + readonly " $data"?: ConcreateTypes$data, + readonly " $fragmentRefs": FragmentRefs<"ConcreateTypes">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type FragmentSpread = { + readonly id: string, + readonly justFrag: { + readonly " $fragmentRefs": FragmentRefs<"PictureFragment"> + } | null, + readonly fragAndField: { + readonly uri: string | null, + readonly " $fragmentRefs": FragmentRefs<"PictureFragment">, + } | null, + readonly " $fragmentRefs": FragmentRefs<"OtherFragment" | "UserFrag1" | "UserFrag2">, + readonly " $refType": FragmentRefs<"FragmentSpread">, +}; +export type FragmentSpread$data = FragmentSpread; +export type FragmentSpread$key = { + readonly " $data"?: FragmentSpread$data, + readonly " $fragmentRefs": FragmentRefs<"FragmentSpread">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type OtherFragment = { + readonly __typename: string, + readonly " $refType": FragmentRefs<"OtherFragment">, +}; +export type OtherFragment$data = OtherFragment; +export type OtherFragment$key = { + readonly " $data"?: OtherFragment$data, + readonly " $fragmentRefs": FragmentRefs<"OtherFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type PageFragment = { + readonly __typename: "Page", + readonly " $refType": FragmentRefs<"PageFragment">, +}; +export type PageFragment$data = PageFragment; +export type PageFragment$key = { + readonly " $data"?: PageFragment$data, + readonly " $fragmentRefs": FragmentRefs<"PageFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type PictureFragment = { + readonly __typename: "Image", + readonly " $refType": FragmentRefs<"PictureFragment">, +}; +export type PictureFragment$data = PictureFragment; +export type PictureFragment$key = { + readonly " $data"?: PictureFragment$data, + readonly " $fragmentRefs": FragmentRefs<"PictureFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type UserFrag1 = { + readonly __typename: "User", + readonly " $refType": FragmentRefs<"UserFrag1">, +}; +export type UserFrag1$data = UserFrag1; +export type UserFrag1$key = { + readonly " $data"?: UserFrag1$data, + readonly " $fragmentRefs": FragmentRefs<"UserFrag1">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type UserFrag2 = { + readonly __typename: "User", + readonly " $refType": FragmentRefs<"UserFrag2">, +}; +export type UserFrag2$data = UserFrag2; +export type UserFrag2$key = { + readonly " $data"?: UserFrag2$data, + readonly " $fragmentRefs": FragmentRefs<"UserFrag2">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + import { FragmentRefs } from "relay-runtime"; export type ConcreateTypes = { readonly actor: { @@ -104,11 +303,6 @@ import { FragmentRefs } from "relay-runtime"; export type PageFragment = { readonly __typename: "Page", readonly " $refType": FragmentRefs<"PageFragment">, -} | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly __typename: "%other", - readonly " $refType": FragmentRefs<"PageFragment">, }; export type PageFragment$data = PageFragment; export type PageFragment$key = { @@ -120,11 +314,6 @@ import { FragmentRefs } from "relay-runtime"; export type PictureFragment = { readonly __typename: "Image", readonly " $refType": FragmentRefs<"PictureFragment">, -} | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly __typename: "%other", - readonly " $refType": FragmentRefs<"PictureFragment">, }; export type PictureFragment$data = PictureFragment; export type PictureFragment$key = { @@ -136,11 +325,6 @@ import { FragmentRefs } from "relay-runtime"; export type UserFrag1 = { readonly __typename: "User", readonly " $refType": FragmentRefs<"UserFrag1">, -} | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly __typename: "%other", - readonly " $refType": FragmentRefs<"UserFrag1">, }; export type UserFrag1$data = UserFrag1; export type UserFrag1$key = { @@ -152,10 +336,106 @@ import { FragmentRefs } from "relay-runtime"; export type UserFrag2 = { readonly __typename: "User", readonly " $refType": FragmentRefs<"UserFrag2">, -} | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly __typename: "%other", +}; +export type UserFrag2$data = UserFrag2; +export type UserFrag2$key = { + readonly " $data"?: UserFrag2$data, + readonly " $fragmentRefs": FragmentRefs<"UserFrag2">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + +import { FragmentRefs } from "relay-runtime"; +export type ConcreateTypes = { + readonly actor: { + readonly __typename: "Page", + readonly id: string, + readonly " $fragmentRefs": FragmentRefs<"PageFragment">, + } | { + readonly __typename: "User", + readonly name: string | null, + } | { + // This will never be '%other', but we need some + // value in case none of the concrete values match. + readonly __typename: "%other" + } | null, + readonly " $refType": FragmentRefs<"ConcreateTypes">, +}; +export type ConcreateTypes$data = ConcreateTypes; +export type ConcreateTypes$key = { + readonly " $data"?: ConcreateTypes$data, + readonly " $fragmentRefs": FragmentRefs<"ConcreateTypes">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type FragmentSpread = { + readonly id: string, + readonly justFrag: { + readonly " $fragmentRefs": FragmentRefs<"PictureFragment"> + } | null, + readonly fragAndField: { + readonly uri: string | null, + readonly " $fragmentRefs": FragmentRefs<"PictureFragment">, + } | null, + readonly " $fragmentRefs": FragmentRefs<"OtherFragment" | "UserFrag1" | "UserFrag2">, + readonly " $refType": FragmentRefs<"FragmentSpread">, +}; +export type FragmentSpread$data = FragmentSpread; +export type FragmentSpread$key = { + readonly " $data"?: FragmentSpread$data, + readonly " $fragmentRefs": FragmentRefs<"FragmentSpread">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type OtherFragment = { + readonly __typename: string, + readonly " $refType": FragmentRefs<"OtherFragment">, +}; +export type OtherFragment$data = OtherFragment; +export type OtherFragment$key = { + readonly " $data"?: OtherFragment$data, + readonly " $fragmentRefs": FragmentRefs<"OtherFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type PageFragment = { + readonly __typename: "Page", + readonly " $refType": FragmentRefs<"PageFragment">, +}; +export type PageFragment$data = PageFragment; +export type PageFragment$key = { + readonly " $data"?: PageFragment$data, + readonly " $fragmentRefs": FragmentRefs<"PageFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type PictureFragment = { + readonly __typename: "Image", + readonly " $refType": FragmentRefs<"PictureFragment">, +}; +export type PictureFragment$data = PictureFragment; +export type PictureFragment$key = { + readonly " $data"?: PictureFragment$data, + readonly " $fragmentRefs": FragmentRefs<"PictureFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type UserFrag1 = { + readonly __typename: "User", + readonly " $refType": FragmentRefs<"UserFrag1">, +}; +export type UserFrag1$data = UserFrag1; +export type UserFrag1$key = { + readonly " $data"?: UserFrag1$data, + readonly " $fragmentRefs": FragmentRefs<"UserFrag1">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type UserFrag2 = { + readonly __typename: "User", readonly " $refType": FragmentRefs<"UserFrag2">, }; export type UserFrag2$data = UserFrag2; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected index 6000ed3d43b2f..f6513306a3c10 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected @@ -64,6 +64,92 @@ fragment SomeFragment on User { __typename } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import { FragmentRefs } from "relay-runtime"; +export type InlineFragment = { + readonly id: string, + readonly name?: string | null, + readonly message?: { + readonly text: string | null + } | null, + readonly " $refType": FragmentRefs<"InlineFragment">, +}; +export type InlineFragment$data = InlineFragment; +export type InlineFragment$key = { + readonly " $data"?: InlineFragment$data, + readonly " $fragmentRefs": FragmentRefs<"InlineFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type InlineFragmentConditionalID = { + readonly id?: string, + readonly name?: string | null, + readonly " $refType": FragmentRefs<"InlineFragmentConditionalID">, +}; +export type InlineFragmentConditionalID$data = InlineFragmentConditionalID; +export type InlineFragmentConditionalID$key = { + readonly " $data"?: InlineFragmentConditionalID$data, + readonly " $fragmentRefs": FragmentRefs<"InlineFragmentConditionalID">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type InlineFragmentKitchenSink = { + readonly actor: { + readonly id: string, + readonly profilePicture: { + readonly uri: string | null, + readonly width?: number | null, + readonly height?: number | null, + } | null, + readonly name?: string | null, + readonly " $fragmentRefs": FragmentRefs<"SomeFragment">, + } | null, + readonly " $refType": FragmentRefs<"InlineFragmentKitchenSink">, +}; +export type InlineFragmentKitchenSink$data = InlineFragmentKitchenSink; +export type InlineFragmentKitchenSink$key = { + readonly " $data"?: InlineFragmentKitchenSink$data, + readonly " $fragmentRefs": FragmentRefs<"InlineFragmentKitchenSink">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type InlineFragmentWithOverlappingFields = { + readonly hometown?: { + readonly id: string, + readonly name: string | null, + readonly message?: { + readonly text: string | null + } | null, + } | null, + readonly name?: string | null, + readonly " $refType": FragmentRefs<"InlineFragmentWithOverlappingFields">, +}; +export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; +export type InlineFragmentWithOverlappingFields$key = { + readonly " $data"?: InlineFragmentWithOverlappingFields$data, + readonly " $fragmentRefs": FragmentRefs<"InlineFragmentWithOverlappingFields">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type SomeFragment = { + readonly __typename: "User", + readonly " $refType": FragmentRefs<"SomeFragment">, +}; +export type SomeFragment$data = SomeFragment; +export type SomeFragment$key = { + readonly " $data"?: SomeFragment$data, + readonly " $fragmentRefs": FragmentRefs<"SomeFragment">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + import { FragmentRefs } from "relay-runtime"; export type InlineFragment = { readonly id: string, @@ -133,10 +219,167 @@ import { FragmentRefs } from "relay-runtime"; export type SomeFragment = { readonly __typename: "User", readonly " $refType": FragmentRefs<"SomeFragment">, -} | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly __typename: "%other", +}; +export type SomeFragment$data = SomeFragment; +export type SomeFragment$key = { + readonly " $data"?: SomeFragment$data, + readonly " $fragmentRefs": FragmentRefs<"SomeFragment">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import { FragmentRefs } from "relay-runtime"; +export type InlineFragment = { + readonly id: string, + readonly name?: string | null, + readonly message?: { + readonly text: string | null + } | null, + readonly " $refType": FragmentRefs<"InlineFragment">, +}; +export type InlineFragment$data = InlineFragment; +export type InlineFragment$key = { + readonly " $data"?: InlineFragment$data, + readonly " $fragmentRefs": FragmentRefs<"InlineFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type InlineFragmentConditionalID = { + readonly id?: string, + readonly name?: string | null, + readonly " $refType": FragmentRefs<"InlineFragmentConditionalID">, +}; +export type InlineFragmentConditionalID$data = InlineFragmentConditionalID; +export type InlineFragmentConditionalID$key = { + readonly " $data"?: InlineFragmentConditionalID$data, + readonly " $fragmentRefs": FragmentRefs<"InlineFragmentConditionalID">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type InlineFragmentKitchenSink = { + readonly actor: { + readonly id: string, + readonly profilePicture: { + readonly uri: string | null, + readonly width?: number | null, + readonly height?: number | null, + } | null, + readonly name?: string | null, + readonly " $fragmentRefs": FragmentRefs<"SomeFragment">, + } | null, + readonly " $refType": FragmentRefs<"InlineFragmentKitchenSink">, +}; +export type InlineFragmentKitchenSink$data = InlineFragmentKitchenSink; +export type InlineFragmentKitchenSink$key = { + readonly " $data"?: InlineFragmentKitchenSink$data, + readonly " $fragmentRefs": FragmentRefs<"InlineFragmentKitchenSink">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type InlineFragmentWithOverlappingFields = { + readonly hometown?: { + readonly id: string, + readonly name: string | null, + readonly message?: { + readonly text: string | null + } | null, + } | null, + readonly name?: string | null, + readonly " $refType": FragmentRefs<"InlineFragmentWithOverlappingFields">, +}; +export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; +export type InlineFragmentWithOverlappingFields$key = { + readonly " $data"?: InlineFragmentWithOverlappingFields$data, + readonly " $fragmentRefs": FragmentRefs<"InlineFragmentWithOverlappingFields">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type SomeFragment = { + readonly __typename: "User", + readonly " $refType": FragmentRefs<"SomeFragment">, +}; +export type SomeFragment$data = SomeFragment; +export type SomeFragment$key = { + readonly " $data"?: SomeFragment$data, + readonly " $fragmentRefs": FragmentRefs<"SomeFragment">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + +import { FragmentRefs } from "relay-runtime"; +export type InlineFragment = { + readonly id: string, + readonly name?: string | null, + readonly message?: { + readonly text: string | null + } | null, + readonly " $refType": FragmentRefs<"InlineFragment">, +}; +export type InlineFragment$data = InlineFragment; +export type InlineFragment$key = { + readonly " $data"?: InlineFragment$data, + readonly " $fragmentRefs": FragmentRefs<"InlineFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type InlineFragmentConditionalID = { + readonly id?: string, + readonly name?: string | null, + readonly " $refType": FragmentRefs<"InlineFragmentConditionalID">, +}; +export type InlineFragmentConditionalID$data = InlineFragmentConditionalID; +export type InlineFragmentConditionalID$key = { + readonly " $data"?: InlineFragmentConditionalID$data, + readonly " $fragmentRefs": FragmentRefs<"InlineFragmentConditionalID">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type InlineFragmentKitchenSink = { + readonly actor: { + readonly id: string, + readonly profilePicture: { + readonly uri: string | null, + readonly width?: number | null, + readonly height?: number | null, + } | null, + readonly name?: string | null, + readonly " $fragmentRefs": FragmentRefs<"SomeFragment">, + } | null, + readonly " $refType": FragmentRefs<"InlineFragmentKitchenSink">, +}; +export type InlineFragmentKitchenSink$data = InlineFragmentKitchenSink; +export type InlineFragmentKitchenSink$key = { + readonly " $data"?: InlineFragmentKitchenSink$data, + readonly " $fragmentRefs": FragmentRefs<"InlineFragmentKitchenSink">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type InlineFragmentWithOverlappingFields = { + readonly hometown?: { + readonly id: string, + readonly name: string | null, + readonly message?: { + readonly text: string | null + } | null, + } | null, + readonly name?: string | null, + readonly " $refType": FragmentRefs<"InlineFragmentWithOverlappingFields">, +}; +export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; +export type InlineFragmentWithOverlappingFields$key = { + readonly " $data"?: InlineFragmentWithOverlappingFields$data, + readonly " $fragmentRefs": FragmentRefs<"InlineFragmentWithOverlappingFields">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type SomeFragment = { + readonly __typename: "User", readonly " $refType": FragmentRefs<"SomeFragment">, }; export type SomeFragment$data = SomeFragment; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected index bdeff5e9fa4a7..a31c3c795245d 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected @@ -27,6 +27,142 @@ query UnionTypeTest { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type UnionTypeTestVariables = {}; +export type UnionTypeTestResponse = { + readonly neverNode: { + readonly __typename: "FakeNode", + readonly id: string, + } | { + readonly __typename: "NonNode" + } | null +}; +export type UnionTypeTest = { + variables: UnionTypeTestVariables, + response: UnionTypeTestResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type LinkedField = { + readonly profilePicture: { + readonly uri: string | null, + readonly width: number | null, + readonly height: number | null, + } | null, + readonly hometown: { + readonly id: string, + readonly profilePicture: { + readonly uri: string | null + } | null, + } | null, + readonly actor: { + readonly id: string + } | null, + readonly " $refType": FragmentRefs<"LinkedField">, +}; +export type LinkedField$data = LinkedField; +export type LinkedField$key = { + readonly " $data"?: LinkedField$data, + readonly " $fragmentRefs": FragmentRefs<"LinkedField">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type UnionTypeTestVariables = {}; +export type UnionTypeTestResponse = { + readonly neverNode: { + readonly __typename: "FakeNode", + readonly id: string, + } | { + readonly __typename: "NonNode" + } | null +}; +export type UnionTypeTest = { + variables: UnionTypeTestVariables, + response: UnionTypeTestResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type LinkedField = { + readonly profilePicture: { + readonly uri: string | null, + readonly width: number | null, + readonly height: number | null, + } | null, + readonly hometown: { + readonly id: string, + readonly profilePicture: { + readonly uri: string | null + } | null, + } | null, + readonly actor: { + readonly id: string + } | null, + readonly " $refType": FragmentRefs<"LinkedField">, +}; +export type LinkedField$data = LinkedField; +export type LinkedField$key = { + readonly " $data"?: LinkedField$data, + readonly " $fragmentRefs": FragmentRefs<"LinkedField">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type UnionTypeTestVariables = {}; +export type UnionTypeTestResponse = { + readonly neverNode: { + readonly __typename: "FakeNode", + readonly id: string, + } | { + // This will never be '%other', but we need some + // value in case none of the concrete values match. + readonly __typename: "NonNode" | "%other" + } | null +}; +export type UnionTypeTest = { + variables: UnionTypeTestVariables, + response: UnionTypeTestResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type LinkedField = { + readonly profilePicture: { + readonly uri: string | null, + readonly width: number | null, + readonly height: number | null, + } | null, + readonly hometown: { + readonly id: string, + readonly profilePicture: { + readonly uri: string | null + } | null, + } | null, + readonly actor: { + readonly id: string + } | null, + readonly " $refType": FragmentRefs<"LinkedField">, +}; +export type LinkedField$data = LinkedField; +export type LinkedField$key = { + readonly " $data"?: LinkedField$data, + readonly " $fragmentRefs": FragmentRefs<"LinkedField">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type UnionTypeTestVariables = {}; export type UnionTypeTestResponse = { readonly neverNode: { @@ -35,7 +171,7 @@ export type UnionTypeTestResponse = { } | { // This will never be '%other', but we need some // value in case none of the concrete values match. - readonly __typename: "%other" + readonly __typename: "NonNode" | "%other" } | null }; export type UnionTypeTest = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected index b47cd4dd41b54..9b99933d405e7 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected @@ -23,6 +23,155 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type NameRendererQueryVariables = {}; +export type NameRendererQueryResponse = { + readonly me: { + readonly nameRenderer: { + readonly __fragmentPropName?: string | null, + readonly __module_component?: string | null, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, + } | null + } | null +}; +export type NameRendererQuery = { + variables: NameRendererQueryVariables, + response: NameRendererQueryResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type MarkdownUserNameRenderer_name = { + readonly markdown: string | null, + readonly data: { + readonly markup: string | null + } | null, + readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">, +}; +export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; +export type MarkdownUserNameRenderer_name$key = { + readonly " $data"?: MarkdownUserNameRenderer_name$data, + readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type PlainUserNameRenderer_name = { + readonly plaintext: string | null, + readonly data: { + readonly text: string | null + } | null, + readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">, +}; +export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; +export type PlainUserNameRenderer_name$key = { + readonly " $data"?: PlainUserNameRenderer_name$data, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type NameRendererQueryVariables = {}; +export type NameRendererQueryResponse = { + readonly me: { + readonly nameRenderer: { + readonly __fragmentPropName?: string | null, + readonly __module_component?: string | null, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, + } | null + } | null +}; +export type NameRendererQuery = { + variables: NameRendererQueryVariables, + response: NameRendererQueryResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type MarkdownUserNameRenderer_name = { + readonly markdown: string | null, + readonly data: { + readonly markup: string | null + } | null, + readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">, +}; +export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; +export type MarkdownUserNameRenderer_name$key = { + readonly " $data"?: MarkdownUserNameRenderer_name$data, + readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type PlainUserNameRenderer_name = { + readonly plaintext: string | null, + readonly data: { + readonly text: string | null + } | null, + readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">, +}; +export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; +export type PlainUserNameRenderer_name$key = { + readonly " $data"?: PlainUserNameRenderer_name$data, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type NameRendererQueryVariables = {}; +export type NameRendererQueryResponse = { + readonly me: { + readonly nameRenderer: { + readonly __fragmentPropName?: string | null, + readonly __module_component?: string | null, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, + } | null + } | null +}; +export type NameRendererQuery = { + variables: NameRendererQueryVariables, + response: NameRendererQueryResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type MarkdownUserNameRenderer_name = { + readonly markdown: string | null, + readonly data: { + readonly markup: string | null + } | null, + readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">, +}; +export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; +export type MarkdownUserNameRenderer_name$key = { + readonly " $data"?: MarkdownUserNameRenderer_name$data, + readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type PlainUserNameRenderer_name = { + readonly plaintext: string | null, + readonly data: { + readonly text: string | null + } | null, + readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">, +}; +export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; +export type PlainUserNameRenderer_name$key = { + readonly " $data"?: PlainUserNameRenderer_name$data, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type NameRendererQueryVariables = {}; export type NameRendererQueryResponse = { readonly me: { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected index d342f3675fb52..2a48f5a9c4f5a 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected @@ -22,6 +22,158 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import { FragmentRefs } from "relay-runtime"; +export type MarkdownUserNameRenderer_name = { + readonly markdown: string | null, + readonly data: { + readonly markup: string | null + } | null, + readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">, +}; +export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; +export type MarkdownUserNameRenderer_name$key = { + readonly " $data"?: MarkdownUserNameRenderer_name$data, + readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type NameRendererFragment = { + readonly id: string, + readonly nameRenderer: { + readonly __fragmentPropName?: string | null, + readonly __module_component?: string | null, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, + } | null, + readonly " $refType": FragmentRefs<"NameRendererFragment">, +}; +export type NameRendererFragment$data = NameRendererFragment; +export type NameRendererFragment$key = { + readonly " $data"?: NameRendererFragment$data, + readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type PlainUserNameRenderer_name = { + readonly plaintext: string | null, + readonly data: { + readonly text: string | null + } | null, + readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">, +}; +export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; +export type PlainUserNameRenderer_name$key = { + readonly " $data"?: PlainUserNameRenderer_name$data, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import { FragmentRefs } from "relay-runtime"; +export type MarkdownUserNameRenderer_name = { + readonly markdown: string | null, + readonly data: { + readonly markup: string | null + } | null, + readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">, +}; +export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; +export type MarkdownUserNameRenderer_name$key = { + readonly " $data"?: MarkdownUserNameRenderer_name$data, + readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type NameRendererFragment = { + readonly id: string, + readonly nameRenderer: { + readonly __fragmentPropName?: string | null, + readonly __module_component?: string | null, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, + } | null, + readonly " $refType": FragmentRefs<"NameRendererFragment">, +}; +export type NameRendererFragment$data = NameRendererFragment; +export type NameRendererFragment$key = { + readonly " $data"?: NameRendererFragment$data, + readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type PlainUserNameRenderer_name = { + readonly plaintext: string | null, + readonly data: { + readonly text: string | null + } | null, + readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">, +}; +export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; +export type PlainUserNameRenderer_name$key = { + readonly " $data"?: PlainUserNameRenderer_name$data, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import { FragmentRefs } from "relay-runtime"; +export type MarkdownUserNameRenderer_name = { + readonly markdown: string | null, + readonly data: { + readonly markup: string | null + } | null, + readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">, +}; +export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; +export type MarkdownUserNameRenderer_name$key = { + readonly " $data"?: MarkdownUserNameRenderer_name$data, + readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type NameRendererFragment = { + readonly id: string, + readonly nameRenderer: { + readonly __fragmentPropName?: string | null, + readonly __module_component?: string | null, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, + } | null, + readonly " $refType": FragmentRefs<"NameRendererFragment">, +}; +export type NameRendererFragment$data = NameRendererFragment; +export type NameRendererFragment$key = { + readonly " $data"?: NameRendererFragment$data, + readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type PlainUserNameRenderer_name = { + readonly plaintext: string | null, + readonly data: { + readonly text: string | null + } | null, + readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">, +}; +export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; +export type PlainUserNameRenderer_name$key = { + readonly " $data"?: PlainUserNameRenderer_name$data, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import { FragmentRefs } from "relay-runtime"; export type MarkdownUserNameRenderer_name = { readonly markdown: string | null, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-input-has-array.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-input-has-array.expected index 402600925e076..a074afbad07d7 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-input-has-array.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-input-has-array.expected @@ -7,6 +7,110 @@ mutation InputHasArray($input: UpdateAllSeenStateInput) @raw_response_type { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type UpdateAllSeenStateInput = { + clientMutationId?: string | null, + storyIds?: ReadonlyArray | null, +}; +export type InputHasArrayVariables = { + input?: UpdateAllSeenStateInput | null +}; +export type InputHasArrayResponse = { + readonly viewerNotificationsUpdateAllSeenState: { + readonly stories: ReadonlyArray<{ + readonly actorCount: number | null + } | null> | null + } | null +}; +export type InputHasArrayRawResponse = { + readonly viewerNotificationsUpdateAllSeenState: { + readonly stories: ReadonlyArray<{ + readonly actorCount: number | null, + readonly id: string, + } | null> | null + } | null +}; +export type InputHasArray = { + variables: InputHasArrayVariables, + response: InputHasArrayResponse, + rawResponse: InputHasArrayRawResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type UpdateAllSeenStateInput = { + clientMutationId?: string | null, + storyIds?: ReadonlyArray | null, +}; +export type InputHasArrayVariables = { + input?: UpdateAllSeenStateInput | null +}; +export type InputHasArrayResponse = { + readonly viewerNotificationsUpdateAllSeenState: { + readonly stories: ReadonlyArray<{ + readonly actorCount: number | null + } | null> | null + } | null +}; +export type InputHasArrayRawResponse = { + readonly viewerNotificationsUpdateAllSeenState: { + readonly stories: ReadonlyArray<{ + readonly actorCount: number | null, + readonly id: string, + } | null> | null + } | null +}; +export type InputHasArray = { + variables: InputHasArrayVariables, + response: InputHasArrayResponse, + rawResponse: InputHasArrayRawResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type UpdateAllSeenStateInput = { + clientMutationId?: string | null, + storyIds?: ReadonlyArray | null, +}; +export type InputHasArrayVariables = { + input?: UpdateAllSeenStateInput | null +}; +export type InputHasArrayResponse = { + readonly viewerNotificationsUpdateAllSeenState: { + readonly stories: ReadonlyArray<{ + readonly actorCount: number | null + } | null> | null + } | null +}; +export type InputHasArrayRawResponse = { + readonly viewerNotificationsUpdateAllSeenState: { + readonly stories: ReadonlyArray<{ + readonly actorCount: number | null, + readonly id: string, + } | null> | null + } | null +}; +export type InputHasArray = { + variables: InputHasArrayVariables, + response: InputHasArrayResponse, + rawResponse: InputHasArrayRawResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type UpdateAllSeenStateInput = { clientMutationId?: string | null, storyIds?: ReadonlyArray | null, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-client-extension.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-client-extension.expected index 80c474f6a5059..ebf6a3ca335b2 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-client-extension.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-client-extension.expected @@ -19,6 +19,122 @@ type Foo { bar: String } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type UpdateAllSeenStateInput = { + clientMutationId?: string | null, + storyIds?: ReadonlyArray | null, +}; +export type TestVariables = { + input?: UpdateAllSeenStateInput | null +}; +export type TestResponse = { + readonly viewerNotificationsUpdateAllSeenState: { + readonly stories: ReadonlyArray<{ + readonly foos: ReadonlyArray<{ + readonly bar: string | null + } | null> | null + } | null> | null + } | null +}; +export type TestRawResponse = { + readonly viewerNotificationsUpdateAllSeenState: { + readonly stories: ReadonlyArray<{ + readonly id: string, + readonly foos?: ReadonlyArray<{ + readonly bar: string | null + } | null> | null, + } | null> | null + } | null +}; +export type Test = { + variables: TestVariables, + response: TestResponse, + rawResponse: TestRawResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type UpdateAllSeenStateInput = { + clientMutationId?: string | null, + storyIds?: ReadonlyArray | null, +}; +export type TestVariables = { + input?: UpdateAllSeenStateInput | null +}; +export type TestResponse = { + readonly viewerNotificationsUpdateAllSeenState: { + readonly stories: ReadonlyArray<{ + readonly foos: ReadonlyArray<{ + readonly bar: string | null + } | null> | null + } | null> | null + } | null +}; +export type TestRawResponse = { + readonly viewerNotificationsUpdateAllSeenState: { + readonly stories: ReadonlyArray<{ + readonly id: string, + readonly foos?: ReadonlyArray<{ + readonly bar: string | null + } | null> | null, + } | null> | null + } | null +}; +export type Test = { + variables: TestVariables, + response: TestResponse, + rawResponse: TestRawResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type UpdateAllSeenStateInput = { + clientMutationId?: string | null, + storyIds?: ReadonlyArray | null, +}; +export type TestVariables = { + input?: UpdateAllSeenStateInput | null +}; +export type TestResponse = { + readonly viewerNotificationsUpdateAllSeenState: { + readonly stories: ReadonlyArray<{ + readonly foos: ReadonlyArray<{ + readonly bar: string | null + } | null> | null + } | null> | null + } | null +}; +export type TestRawResponse = { + readonly viewerNotificationsUpdateAllSeenState: { + readonly stories: ReadonlyArray<{ + readonly id: string, + readonly foos?: ReadonlyArray<{ + readonly bar: string | null + } | null> | null, + } | null> | null + } | null +}; +export type Test = { + variables: TestVariables, + response: TestResponse, + rawResponse: TestRawResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type UpdateAllSeenStateInput = { clientMutationId?: string | null, storyIds?: ReadonlyArray | null, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected index e5f57f07824df..1c60fb80485af 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected @@ -27,6 +27,248 @@ fragment FriendFragment on User { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type TestEnums = "mark" | "zuck"; +export type CommentCreateInput = { + clientMutationId?: string | null, + feedbackId?: string | null, + feedback?: CommentfeedbackFeedback | null, +}; +export type CommentfeedbackFeedback = { + comment?: FeedbackcommentComment | null +}; +export type FeedbackcommentComment = { + feedback?: CommentfeedbackFeedback | null +}; +export type CommentCreateMutationVariables = { + input: CommentCreateInput, + first?: number | null, + orderBy?: ReadonlyArray | null, +}; +export type CommentCreateMutationResponse = { + readonly commentCreate: { + readonly comment: { + readonly friends: { + readonly edges: ReadonlyArray<{ + readonly node: { + readonly id: string, + readonly __typename: string, + readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, + } | null + } | null> | null + } | null + } | null + } | null +}; +export type CommentCreateMutationRawResponse = { + readonly commentCreate: { + readonly comment: { + readonly friends: { + readonly edges: ReadonlyArray<{ + readonly node: { + readonly id: string, + readonly __typename: "User", + readonly name: string | null, + readonly lastName: string | null, + readonly profilePicture2: { + readonly test_enums: TestEnums | null + } | null, + } | null + } | null> | null + } | null, + readonly id: string, + } | null + } | null +}; +export type CommentCreateMutation = { + variables: CommentCreateMutationVariables, + response: CommentCreateMutationResponse, + rawResponse: CommentCreateMutationRawResponse, +}; +------------------------------------------------------------------------------- +export type TestEnums = "mark" | "zuck"; +import { FragmentRefs } from "relay-runtime"; +export type FriendFragment = { + readonly name: string | null, + readonly lastName: string | null, + readonly profilePicture2: { + readonly test_enums: TestEnums | null + } | null, + readonly " $refType": FragmentRefs<"FriendFragment">, +}; +export type FriendFragment$data = FriendFragment; +export type FriendFragment$key = { + readonly " $data"?: FriendFragment$data, + readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type TestEnums = "mark" | "zuck" | "%future added value"; +export type CommentCreateInput = { + clientMutationId?: string | null, + feedbackId?: string | null, + feedback?: CommentfeedbackFeedback | null, +}; +export type CommentfeedbackFeedback = { + comment?: FeedbackcommentComment | null +}; +export type FeedbackcommentComment = { + feedback?: CommentfeedbackFeedback | null +}; +export type CommentCreateMutationVariables = { + input: CommentCreateInput, + first?: number | null, + orderBy?: ReadonlyArray | null, +}; +export type CommentCreateMutationResponse = { + readonly commentCreate: { + readonly comment: { + readonly friends: { + readonly edges: ReadonlyArray<{ + readonly node: { + readonly id: string, + readonly __typename: string, + readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, + } | null + } | null> | null + } | null + } | null + } | null +}; +export type CommentCreateMutationRawResponse = { + readonly commentCreate: { + readonly comment: { + readonly friends: { + readonly edges: ReadonlyArray<{ + readonly node: { + readonly id: string, + readonly __typename: "User", + readonly name: string | null, + readonly lastName: string | null, + readonly profilePicture2: { + readonly test_enums: TestEnums | null + } | null, + } | null + } | null> | null + } | null, + readonly id: string, + } | null + } | null +}; +export type CommentCreateMutation = { + variables: CommentCreateMutationVariables, + response: CommentCreateMutationResponse, + rawResponse: CommentCreateMutationRawResponse, +}; +------------------------------------------------------------------------------- +export type TestEnums = "mark" | "zuck" | "%future added value"; +import { FragmentRefs } from "relay-runtime"; +export type FriendFragment = { + readonly name: string | null, + readonly lastName: string | null, + readonly profilePicture2: { + readonly test_enums: TestEnums | null + } | null, + readonly " $refType": FragmentRefs<"FriendFragment">, +}; +export type FriendFragment$data = FriendFragment; +export type FriendFragment$key = { + readonly " $data"?: FriendFragment$data, + readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type TestEnums = "mark" | "zuck"; +export type CommentCreateInput = { + clientMutationId?: string | null, + feedbackId?: string | null, + feedback?: CommentfeedbackFeedback | null, +}; +export type CommentfeedbackFeedback = { + comment?: FeedbackcommentComment | null +}; +export type FeedbackcommentComment = { + feedback?: CommentfeedbackFeedback | null +}; +export type CommentCreateMutationVariables = { + input: CommentCreateInput, + first?: number | null, + orderBy?: ReadonlyArray | null, +}; +export type CommentCreateMutationResponse = { + readonly commentCreate: { + readonly comment: { + readonly friends: { + readonly edges: ReadonlyArray<{ + readonly node: { + readonly id: string, + readonly __typename: string, + readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, + } | null + } | null> | null + } | null + } | null + } | null +}; +export type CommentCreateMutationRawResponse = { + readonly commentCreate: { + readonly comment: { + readonly friends: { + readonly edges: ReadonlyArray<{ + readonly node: { + readonly id: string, + readonly __typename: "User", + readonly name: string | null, + readonly lastName: string | null, + readonly profilePicture2: { + readonly test_enums: TestEnums | null + } | null, + } | null + } | null> | null + } | null, + readonly id: string, + } | null + } | null +}; +export type CommentCreateMutation = { + variables: CommentCreateMutationVariables, + response: CommentCreateMutationResponse, + rawResponse: CommentCreateMutationRawResponse, +}; +------------------------------------------------------------------------------- +export type TestEnums = "mark" | "zuck"; +import { FragmentRefs } from "relay-runtime"; +export type FriendFragment = { + readonly name: string | null, + readonly lastName: string | null, + readonly profilePicture2: { + readonly test_enums: TestEnums | null + } | null, + readonly " $refType": FragmentRefs<"FriendFragment">, +}; +export type FriendFragment$data = FriendFragment; +export type FriendFragment$key = { + readonly " $data"?: FriendFragment$data, + readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type TestEnums = "mark" | "zuck" | "%future added value"; export type CommentCreateInput = { clientMutationId?: string | null, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected index 3af2033897974..ffc2b4de2d413 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected @@ -31,6 +31,275 @@ fragment FeedbackFragment on Feedback { name } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type CommentCreateInput = { + clientMutationId?: string | null, + feedbackId?: string | null, + feedback?: CommentfeedbackFeedback | null, +}; +export type CommentfeedbackFeedback = { + comment?: FeedbackcommentComment | null +}; +export type FeedbackcommentComment = { + feedback?: CommentfeedbackFeedback | null +}; +export type CommentCreateMutationVariables = { + input: CommentCreateInput, + first?: number | null, + orderBy?: ReadonlyArray | null, +}; +export type CommentCreateMutationResponse = { + readonly commentCreate: { + readonly comment: { + readonly friends: { + readonly edges: ReadonlyArray<{ + readonly node: { + readonly lastName: string | null, + readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, + } | null + } | null> | null + } | null + } | null + } | null +}; +export type CommentCreateMutationRawResponse = { + readonly commentCreate: { + readonly comment: { + readonly friends: { + readonly edges: ReadonlyArray<{ + readonly node: { + readonly lastName: string | null, + readonly name: string | null, + readonly feedback: { + readonly id: string, + readonly name: string | null, + } | null, + readonly id: string, + } | null + } | null> | null + } | null, + readonly id: string, + } | null + } | null +}; +export type CommentCreateMutation = { + variables: CommentCreateMutationVariables, + response: CommentCreateMutationResponse, + rawResponse: CommentCreateMutationRawResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type FeedbackFragment = { + readonly id: string, + readonly name: string | null, + readonly " $refType": FragmentRefs<"FeedbackFragment">, +}; +export type FeedbackFragment$data = FeedbackFragment; +export type FeedbackFragment$key = { + readonly " $data"?: FeedbackFragment$data, + readonly " $fragmentRefs": FragmentRefs<"FeedbackFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type FriendFragment = { + readonly name: string | null, + readonly lastName: string | null, + readonly feedback: { + readonly " $fragmentRefs": FragmentRefs<"FeedbackFragment"> + } | null, + readonly " $refType": FragmentRefs<"FriendFragment">, +}; +export type FriendFragment$data = FriendFragment; +export type FriendFragment$key = { + readonly " $data"?: FriendFragment$data, + readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type CommentCreateInput = { + clientMutationId?: string | null, + feedbackId?: string | null, + feedback?: CommentfeedbackFeedback | null, +}; +export type CommentfeedbackFeedback = { + comment?: FeedbackcommentComment | null +}; +export type FeedbackcommentComment = { + feedback?: CommentfeedbackFeedback | null +}; +export type CommentCreateMutationVariables = { + input: CommentCreateInput, + first?: number | null, + orderBy?: ReadonlyArray | null, +}; +export type CommentCreateMutationResponse = { + readonly commentCreate: { + readonly comment: { + readonly friends: { + readonly edges: ReadonlyArray<{ + readonly node: { + readonly lastName: string | null, + readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, + } | null + } | null> | null + } | null + } | null + } | null +}; +export type CommentCreateMutationRawResponse = { + readonly commentCreate: { + readonly comment: { + readonly friends: { + readonly edges: ReadonlyArray<{ + readonly node: { + readonly lastName: string | null, + readonly name: string | null, + readonly feedback: { + readonly id: string, + readonly name: string | null, + } | null, + readonly id: string, + } | null + } | null> | null + } | null, + readonly id: string, + } | null + } | null +}; +export type CommentCreateMutation = { + variables: CommentCreateMutationVariables, + response: CommentCreateMutationResponse, + rawResponse: CommentCreateMutationRawResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type FeedbackFragment = { + readonly id: string, + readonly name: string | null, + readonly " $refType": FragmentRefs<"FeedbackFragment">, +}; +export type FeedbackFragment$data = FeedbackFragment; +export type FeedbackFragment$key = { + readonly " $data"?: FeedbackFragment$data, + readonly " $fragmentRefs": FragmentRefs<"FeedbackFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type FriendFragment = { + readonly name: string | null, + readonly lastName: string | null, + readonly feedback: { + readonly " $fragmentRefs": FragmentRefs<"FeedbackFragment"> + } | null, + readonly " $refType": FragmentRefs<"FriendFragment">, +}; +export type FriendFragment$data = FriendFragment; +export type FriendFragment$key = { + readonly " $data"?: FriendFragment$data, + readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type CommentCreateInput = { + clientMutationId?: string | null, + feedbackId?: string | null, + feedback?: CommentfeedbackFeedback | null, +}; +export type CommentfeedbackFeedback = { + comment?: FeedbackcommentComment | null +}; +export type FeedbackcommentComment = { + feedback?: CommentfeedbackFeedback | null +}; +export type CommentCreateMutationVariables = { + input: CommentCreateInput, + first?: number | null, + orderBy?: ReadonlyArray | null, +}; +export type CommentCreateMutationResponse = { + readonly commentCreate: { + readonly comment: { + readonly friends: { + readonly edges: ReadonlyArray<{ + readonly node: { + readonly lastName: string | null, + readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, + } | null + } | null> | null + } | null + } | null + } | null +}; +export type CommentCreateMutationRawResponse = { + readonly commentCreate: { + readonly comment: { + readonly friends: { + readonly edges: ReadonlyArray<{ + readonly node: { + readonly lastName: string | null, + readonly name: string | null, + readonly feedback: { + readonly id: string, + readonly name: string | null, + } | null, + readonly id: string, + } | null + } | null> | null + } | null, + readonly id: string, + } | null + } | null +}; +export type CommentCreateMutation = { + variables: CommentCreateMutationVariables, + response: CommentCreateMutationResponse, + rawResponse: CommentCreateMutationRawResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type FeedbackFragment = { + readonly id: string, + readonly name: string | null, + readonly " $refType": FragmentRefs<"FeedbackFragment">, +}; +export type FeedbackFragment$data = FeedbackFragment; +export type FeedbackFragment$key = { + readonly " $data"?: FeedbackFragment$data, + readonly " $fragmentRefs": FragmentRefs<"FeedbackFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type FriendFragment = { + readonly name: string | null, + readonly lastName: string | null, + readonly feedback: { + readonly " $fragmentRefs": FragmentRefs<"FeedbackFragment"> + } | null, + readonly " $refType": FragmentRefs<"FriendFragment">, +}; +export type FriendFragment$data = FriendFragment; +export type FriendFragment$key = { + readonly " $data"?: FriendFragment$data, + readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type CommentCreateInput = { clientMutationId?: string | null, feedbackId?: string | null, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected index e6a99c5a06228..32be5fa414a00 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected @@ -27,6 +27,257 @@ fragment InlineFragmentWithOverlappingFields on Actor { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type CommentCreateInput = { + clientMutationId?: string | null, + feedbackId?: string | null, + feedback?: CommentfeedbackFeedback | null, +}; +export type CommentfeedbackFeedback = { + comment?: FeedbackcommentComment | null +}; +export type FeedbackcommentComment = { + feedback?: CommentfeedbackFeedback | null +}; +export type TestMutationVariables = { + input: CommentCreateInput +}; +export type TestMutationResponse = { + readonly commentCreate: { + readonly viewer: { + readonly actor: { + readonly " $fragmentRefs": FragmentRefs<"InlineFragmentWithOverlappingFields"> + } | null + } | null + } | null +}; +export type TestMutationRawResponse = { + readonly commentCreate: { + readonly viewer: { + readonly actor: { + readonly __typename: "User", + readonly __isActor: "User", + readonly id: string, + readonly hometown: { + readonly id: string, + readonly name: string | null, + } | null, + } | { + readonly __typename: "Page", + readonly __isActor: "Page", + readonly id: string, + readonly name: string | null, + readonly hometown: { + readonly id: string, + readonly message: { + readonly text: string | null + } | null, + } | null, + } | { + readonly __typename: string, + readonly __isActor: string, + readonly id: string, + } | null + } | null + } | null +}; +export type TestMutation = { + variables: TestMutationVariables, + response: TestMutationResponse, + rawResponse: TestMutationRawResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type InlineFragmentWithOverlappingFields = { + readonly hometown?: { + readonly id: string, + readonly name: string | null, + readonly message?: { + readonly text: string | null + } | null, + } | null, + readonly name?: string | null, + readonly " $refType": FragmentRefs<"InlineFragmentWithOverlappingFields">, +}; +export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; +export type InlineFragmentWithOverlappingFields$key = { + readonly " $data"?: InlineFragmentWithOverlappingFields$data, + readonly " $fragmentRefs": FragmentRefs<"InlineFragmentWithOverlappingFields">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type CommentCreateInput = { + clientMutationId?: string | null, + feedbackId?: string | null, + feedback?: CommentfeedbackFeedback | null, +}; +export type CommentfeedbackFeedback = { + comment?: FeedbackcommentComment | null +}; +export type FeedbackcommentComment = { + feedback?: CommentfeedbackFeedback | null +}; +export type TestMutationVariables = { + input: CommentCreateInput +}; +export type TestMutationResponse = { + readonly commentCreate: { + readonly viewer: { + readonly actor: { + readonly " $fragmentRefs": FragmentRefs<"InlineFragmentWithOverlappingFields"> + } | null + } | null + } | null +}; +export type TestMutationRawResponse = { + readonly commentCreate: { + readonly viewer: { + readonly actor: { + readonly __typename: "User", + readonly __isActor: "User", + readonly id: string, + readonly hometown: { + readonly id: string, + readonly name: string | null, + } | null, + } | { + readonly __typename: "Page", + readonly __isActor: "Page", + readonly id: string, + readonly name: string | null, + readonly hometown: { + readonly id: string, + readonly message: { + readonly text: string | null + } | null, + } | null, + } | { + readonly __typename: string, + readonly __isActor: string, + readonly id: string, + } | null + } | null + } | null +}; +export type TestMutation = { + variables: TestMutationVariables, + response: TestMutationResponse, + rawResponse: TestMutationRawResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type InlineFragmentWithOverlappingFields = { + readonly hometown?: { + readonly id: string, + readonly name: string | null, + readonly message?: { + readonly text: string | null + } | null, + } | null, + readonly name?: string | null, + readonly " $refType": FragmentRefs<"InlineFragmentWithOverlappingFields">, +}; +export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; +export type InlineFragmentWithOverlappingFields$key = { + readonly " $data"?: InlineFragmentWithOverlappingFields$data, + readonly " $fragmentRefs": FragmentRefs<"InlineFragmentWithOverlappingFields">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type CommentCreateInput = { + clientMutationId?: string | null, + feedbackId?: string | null, + feedback?: CommentfeedbackFeedback | null, +}; +export type CommentfeedbackFeedback = { + comment?: FeedbackcommentComment | null +}; +export type FeedbackcommentComment = { + feedback?: CommentfeedbackFeedback | null +}; +export type TestMutationVariables = { + input: CommentCreateInput +}; +export type TestMutationResponse = { + readonly commentCreate: { + readonly viewer: { + readonly actor: { + readonly " $fragmentRefs": FragmentRefs<"InlineFragmentWithOverlappingFields"> + } | null + } | null + } | null +}; +export type TestMutationRawResponse = { + readonly commentCreate: { + readonly viewer: { + readonly actor: { + readonly __typename: "User", + readonly __isActor: "User", + readonly id: string, + readonly hometown: { + readonly id: string, + readonly name: string | null, + } | null, + } | { + readonly __typename: "Page", + readonly __isActor: "Page", + readonly id: string, + readonly name: string | null, + readonly hometown: { + readonly id: string, + readonly message: { + readonly text: string | null + } | null, + } | null, + } | { + readonly __typename: string, + readonly __isActor: string, + readonly id: string, + } | null + } | null + } | null +}; +export type TestMutation = { + variables: TestMutationVariables, + response: TestMutationResponse, + rawResponse: TestMutationRawResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type InlineFragmentWithOverlappingFields = { + readonly hometown?: { + readonly id: string, + readonly name: string | null, + readonly message?: { + readonly text: string | null + } | null, + } | null, + readonly name?: string | null, + readonly " $refType": FragmentRefs<"InlineFragmentWithOverlappingFields">, +}; +export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; +export type InlineFragmentWithOverlappingFields$key = { + readonly " $data"?: InlineFragmentWithOverlappingFields$data, + readonly " $fragmentRefs": FragmentRefs<"InlineFragmentWithOverlappingFields">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type CommentCreateInput = { clientMutationId?: string | null, feedbackId?: string | null, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation.expected index 58af9cf555905..82b541571339d 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation.expected @@ -15,6 +15,122 @@ mutation CommentCreateMutation( } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type CommentCreateInput = { + clientMutationId?: string | null, + feedbackId?: string | null, + feedback?: CommentfeedbackFeedback | null, +}; +export type CommentfeedbackFeedback = { + comment?: FeedbackcommentComment | null +}; +export type FeedbackcommentComment = { + feedback?: CommentfeedbackFeedback | null +}; +export type CommentCreateMutationVariables = { + input: CommentCreateInput, + first?: number | null, + orderBy?: ReadonlyArray | null, +}; +export type CommentCreateMutationResponse = { + readonly commentCreate: { + readonly comment: { + readonly id: string, + readonly name: string | null, + readonly friends: { + readonly count: number | null + } | null, + } | null + } | null +}; +export type CommentCreateMutation = { + variables: CommentCreateMutationVariables, + response: CommentCreateMutationResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type CommentCreateInput = { + clientMutationId?: string | null, + feedbackId?: string | null, + feedback?: CommentfeedbackFeedback | null, +}; +export type CommentfeedbackFeedback = { + comment?: FeedbackcommentComment | null +}; +export type FeedbackcommentComment = { + feedback?: CommentfeedbackFeedback | null +}; +export type CommentCreateMutationVariables = { + input: CommentCreateInput, + first?: number | null, + orderBy?: ReadonlyArray | null, +}; +export type CommentCreateMutationResponse = { + readonly commentCreate: { + readonly comment: { + readonly id: string, + readonly name: string | null, + readonly friends: { + readonly count: number | null + } | null, + } | null + } | null +}; +export type CommentCreateMutation = { + variables: CommentCreateMutationVariables, + response: CommentCreateMutationResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type CommentCreateInput = { + clientMutationId?: string | null, + feedbackId?: string | null, + feedback?: CommentfeedbackFeedback | null, +}; +export type CommentfeedbackFeedback = { + comment?: FeedbackcommentComment | null +}; +export type FeedbackcommentComment = { + feedback?: CommentfeedbackFeedback | null +}; +export type CommentCreateMutationVariables = { + input: CommentCreateInput, + first?: number | null, + orderBy?: ReadonlyArray | null, +}; +export type CommentCreateMutationResponse = { + readonly commentCreate: { + readonly comment: { + readonly id: string, + readonly name: string | null, + readonly friends: { + readonly count: number | null + } | null, + } | null + } | null +}; +export type CommentCreateMutation = { + variables: CommentCreateMutationVariables, + response: CommentCreateMutationResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type CommentCreateInput = { clientMutationId?: string | null, feedbackId?: string | null, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/plural-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/plural-fragment.expected index 7a6199b62aac6..d897e605deb74 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/plural-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/plural-fragment.expected @@ -3,6 +3,59 @@ fragment PluralFragment on Node @relay(plural: true) { id } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import { FragmentRefs } from "relay-runtime"; +export type PluralFragment = ReadonlyArray<{ + readonly id: string, + readonly " $refType": FragmentRefs<"PluralFragment">, +}>; +export type PluralFragment$data = PluralFragment; +export type PluralFragment$key = ReadonlyArray<{ + readonly " $data"?: PluralFragment$data, + readonly " $fragmentRefs": FragmentRefs<"PluralFragment">, +}>; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import { FragmentRefs } from "relay-runtime"; +export type PluralFragment = ReadonlyArray<{ + readonly id: string, + readonly " $refType": FragmentRefs<"PluralFragment">, +}>; +export type PluralFragment$data = PluralFragment; +export type PluralFragment$key = ReadonlyArray<{ + readonly " $data"?: PluralFragment$data, + readonly " $fragmentRefs": FragmentRefs<"PluralFragment">, +}>; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import { FragmentRefs } from "relay-runtime"; +export type PluralFragment = ReadonlyArray<{ + readonly id: string, + readonly " $refType": FragmentRefs<"PluralFragment">, +}>; +export type PluralFragment$data = PluralFragment; +export type PluralFragment$key = ReadonlyArray<{ + readonly " $data"?: PluralFragment$data, + readonly " $fragmentRefs": FragmentRefs<"PluralFragment">, +}>; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import { FragmentRefs } from "relay-runtime"; export type PluralFragment = ReadonlyArray<{ readonly id: string, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-handles.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-handles.expected index 6fb55a9ec73a2..0bfda6fdd9803 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-handles.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-handles.expected @@ -17,6 +17,182 @@ query ScalarHandleField($id: ID!) @raw_response_type { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type LinkedHandleFieldVariables = { + id: string +}; +export type LinkedHandleFieldResponse = { + readonly node: { + readonly friends?: { + readonly count: number | null + } | null + } | null +}; +export type LinkedHandleFieldRawResponse = { + readonly node: { + readonly __typename: "User", + readonly id: string, + readonly friends: { + readonly count: number | null + } | null, + } | { + readonly __typename: string, + readonly id: string, + } | null +}; +export type LinkedHandleField = { + variables: LinkedHandleFieldVariables, + response: LinkedHandleFieldResponse, + rawResponse: LinkedHandleFieldRawResponse, +}; +------------------------------------------------------------------------------- +export type ScalarHandleFieldVariables = { + id: string +}; +export type ScalarHandleFieldResponse = { + readonly node: { + readonly name?: string | null + } | null +}; +export type ScalarHandleFieldRawResponse = { + readonly node: { + readonly __typename: "User", + readonly id: string, + readonly name: string | null, + } | { + readonly __typename: string, + readonly id: string, + } | null +}; +export type ScalarHandleField = { + variables: ScalarHandleFieldVariables, + response: ScalarHandleFieldResponse, + rawResponse: ScalarHandleFieldRawResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type LinkedHandleFieldVariables = { + id: string +}; +export type LinkedHandleFieldResponse = { + readonly node: { + readonly friends?: { + readonly count: number | null + } | null + } | null +}; +export type LinkedHandleFieldRawResponse = { + readonly node: { + readonly __typename: "User", + readonly id: string, + readonly friends: { + readonly count: number | null + } | null, + } | { + readonly __typename: string, + readonly id: string, + } | null +}; +export type LinkedHandleField = { + variables: LinkedHandleFieldVariables, + response: LinkedHandleFieldResponse, + rawResponse: LinkedHandleFieldRawResponse, +}; +------------------------------------------------------------------------------- +export type ScalarHandleFieldVariables = { + id: string +}; +export type ScalarHandleFieldResponse = { + readonly node: { + readonly name?: string | null + } | null +}; +export type ScalarHandleFieldRawResponse = { + readonly node: { + readonly __typename: "User", + readonly id: string, + readonly name: string | null, + } | { + readonly __typename: string, + readonly id: string, + } | null +}; +export type ScalarHandleField = { + variables: ScalarHandleFieldVariables, + response: ScalarHandleFieldResponse, + rawResponse: ScalarHandleFieldRawResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type LinkedHandleFieldVariables = { + id: string +}; +export type LinkedHandleFieldResponse = { + readonly node: { + readonly friends?: { + readonly count: number | null + } | null + } | null +}; +export type LinkedHandleFieldRawResponse = { + readonly node: { + readonly __typename: "User", + readonly id: string, + readonly friends: { + readonly count: number | null + } | null, + } | { + readonly __typename: string, + readonly id: string, + } | null +}; +export type LinkedHandleField = { + variables: LinkedHandleFieldVariables, + response: LinkedHandleFieldResponse, + rawResponse: LinkedHandleFieldRawResponse, +}; +------------------------------------------------------------------------------- +export type ScalarHandleFieldVariables = { + id: string +}; +export type ScalarHandleFieldResponse = { + readonly node: { + readonly name?: string | null + } | null +}; +export type ScalarHandleFieldRawResponse = { + readonly node: { + readonly __typename: "User", + readonly id: string, + readonly name: string | null, + } | { + readonly __typename: string, + readonly id: string, + } | null +}; +export type ScalarHandleField = { + variables: ScalarHandleFieldVariables, + response: ScalarHandleFieldResponse, + rawResponse: ScalarHandleFieldRawResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type LinkedHandleFieldVariables = { id: string }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected index 74c6d7c27e022..abec731066827 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected @@ -28,6 +28,311 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import { Local3DPayload } from "relay-runtime"; +export type TestVariables = {}; +export type TestResponse = { + readonly node: { + readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment"> + } | null +}; +export type PlainUserNameRenderer_name = { + readonly plaintext: string | null, + readonly data: { + readonly text: string | null, + readonly id: string | null, + } | null, +}; +export type MarkdownUserNameRenderer_name = { + readonly markdown: string | null, + readonly data: { + readonly markup: string | null, + readonly id: string | null, + } | null, +}; +export type TestRawResponse = { + readonly node: { + readonly __typename: "User", + readonly id: string, + readonly nameRenderer: { + readonly __typename: "PlainUserNameRenderer", + readonly __module_operation_NameRendererFragment: any | null, + readonly __module_component_NameRendererFragment: any | null, + } | Local3DPayload<"NameRendererFragment", { + readonly __typename: "PlainUserNameRenderer", + }> | { + readonly __typename: "MarkdownUserNameRenderer", + readonly __module_operation_NameRendererFragment: any | null, + readonly __module_component_NameRendererFragment: any | null, + } | Local3DPayload<"NameRendererFragment", { + readonly __typename: "MarkdownUserNameRenderer", + }> | { + readonly __typename: string + } | null, + } | { + readonly __typename: string, + readonly id: string, + } | null +}; +export type Test = { + variables: TestVariables, + response: TestResponse, + rawResponse: TestRawResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type MarkdownUserNameRenderer_name = { + readonly markdown: string | null, + readonly data: { + readonly markup: string | null + } | null, + readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">, +}; +export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; +export type MarkdownUserNameRenderer_name$key = { + readonly " $data"?: MarkdownUserNameRenderer_name$data, + readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type NameRendererFragment = { + readonly id: string, + readonly nameRenderer: { + readonly __fragmentPropName?: string | null, + readonly __module_component?: string | null, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, + } | null, + readonly " $refType": FragmentRefs<"NameRendererFragment">, +}; +export type NameRendererFragment$data = NameRendererFragment; +export type NameRendererFragment$key = { + readonly " $data"?: NameRendererFragment$data, + readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type PlainUserNameRenderer_name = { + readonly plaintext: string | null, + readonly data: { + readonly text: string | null + } | null, + readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">, +}; +export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; +export type PlainUserNameRenderer_name$key = { + readonly " $data"?: PlainUserNameRenderer_name$data, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import { Local3DPayload } from "relay-runtime"; +export type TestVariables = {}; +export type TestResponse = { + readonly node: { + readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment"> + } | null +}; +export type PlainUserNameRenderer_name = { + readonly plaintext: string | null, + readonly data: { + readonly text: string | null, + readonly id: string | null, + } | null, +}; +export type MarkdownUserNameRenderer_name = { + readonly markdown: string | null, + readonly data: { + readonly markup: string | null, + readonly id: string | null, + } | null, +}; +export type TestRawResponse = { + readonly node: { + readonly __typename: "User", + readonly id: string, + readonly nameRenderer: { + readonly __typename: "PlainUserNameRenderer", + readonly __module_operation_NameRendererFragment: any | null, + readonly __module_component_NameRendererFragment: any | null, + } | Local3DPayload<"NameRendererFragment", { + readonly __typename: "PlainUserNameRenderer", + }> | { + readonly __typename: "MarkdownUserNameRenderer", + readonly __module_operation_NameRendererFragment: any | null, + readonly __module_component_NameRendererFragment: any | null, + } | Local3DPayload<"NameRendererFragment", { + readonly __typename: "MarkdownUserNameRenderer", + }> | { + readonly __typename: string + } | null, + } | { + readonly __typename: string, + readonly id: string, + } | null +}; +export type Test = { + variables: TestVariables, + response: TestResponse, + rawResponse: TestRawResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type MarkdownUserNameRenderer_name = { + readonly markdown: string | null, + readonly data: { + readonly markup: string | null + } | null, + readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">, +}; +export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; +export type MarkdownUserNameRenderer_name$key = { + readonly " $data"?: MarkdownUserNameRenderer_name$data, + readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type NameRendererFragment = { + readonly id: string, + readonly nameRenderer: { + readonly __fragmentPropName?: string | null, + readonly __module_component?: string | null, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, + } | null, + readonly " $refType": FragmentRefs<"NameRendererFragment">, +}; +export type NameRendererFragment$data = NameRendererFragment; +export type NameRendererFragment$key = { + readonly " $data"?: NameRendererFragment$data, + readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type PlainUserNameRenderer_name = { + readonly plaintext: string | null, + readonly data: { + readonly text: string | null + } | null, + readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">, +}; +export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; +export type PlainUserNameRenderer_name$key = { + readonly " $data"?: PlainUserNameRenderer_name$data, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import { Local3DPayload } from "relay-runtime"; +export type TestVariables = {}; +export type TestResponse = { + readonly node: { + readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment"> + } | null +}; +export type PlainUserNameRenderer_name = { + readonly plaintext: string | null, + readonly data: { + readonly text: string | null, + readonly id: string | null, + } | null, +}; +export type MarkdownUserNameRenderer_name = { + readonly markdown: string | null, + readonly data: { + readonly markup: string | null, + readonly id: string | null, + } | null, +}; +export type TestRawResponse = { + readonly node: { + readonly __typename: "User", + readonly id: string, + readonly nameRenderer: { + readonly __typename: "PlainUserNameRenderer", + readonly __module_operation_NameRendererFragment: any | null, + readonly __module_component_NameRendererFragment: any | null, + } | Local3DPayload<"NameRendererFragment", { + readonly __typename: "PlainUserNameRenderer", + }> | { + readonly __typename: "MarkdownUserNameRenderer", + readonly __module_operation_NameRendererFragment: any | null, + readonly __module_component_NameRendererFragment: any | null, + } | Local3DPayload<"NameRendererFragment", { + readonly __typename: "MarkdownUserNameRenderer", + }> | { + readonly __typename: string + } | null, + } | { + readonly __typename: string, + readonly id: string, + } | null +}; +export type Test = { + variables: TestVariables, + response: TestResponse, + rawResponse: TestRawResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type MarkdownUserNameRenderer_name = { + readonly markdown: string | null, + readonly data: { + readonly markup: string | null + } | null, + readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">, +}; +export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; +export type MarkdownUserNameRenderer_name$key = { + readonly " $data"?: MarkdownUserNameRenderer_name$data, + readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type NameRendererFragment = { + readonly id: string, + readonly nameRenderer: { + readonly __fragmentPropName?: string | null, + readonly __module_component?: string | null, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, + } | null, + readonly " $refType": FragmentRefs<"NameRendererFragment">, +}; +export type NameRendererFragment$data = NameRendererFragment; +export type NameRendererFragment$key = { + readonly " $data"?: NameRendererFragment$data, + readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type PlainUserNameRenderer_name = { + readonly plaintext: string | null, + readonly data: { + readonly text: string | null + } | null, + readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">, +}; +export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; +export type PlainUserNameRenderer_name$key = { + readonly " $data"?: PlainUserNameRenderer_name$data, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import { Local3DPayload } from "relay-runtime"; export type TestVariables = {}; export type TestResponse = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected index 1efcd9e1b2cc9..91d2d58fb2e3c 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected @@ -17,6 +17,206 @@ fragment Test_userRenderer on PlainUserRenderer { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import { Local3DPayload } from "relay-runtime"; +export type TestVariables = {}; +export type TestResponse = { + readonly node: { + readonly " $fragmentRefs": FragmentRefs<"Test_user"> + } | null +}; +export type Test_userRenderer = { + readonly user: { + readonly username: string | null, + readonly id: string, + } | null +}; +export type TestRawResponse = { + readonly node: { + readonly __typename: "User", + readonly id: string, + readonly plainUserRenderer: { + readonly __module_operation_Test_user: any | null, + readonly __module_component_Test_user: any | null, + } | Local3DPayload<"Test_user", {}> | null, + } | { + readonly __typename: string, + readonly id: string, + } | null +}; +export type Test = { + variables: TestVariables, + response: TestResponse, + rawResponse: TestRawResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type Test_user = { + readonly plainUserRenderer: { + readonly __fragmentPropName?: string | null, + readonly __module_component?: string | null, + readonly " $fragmentRefs": FragmentRefs<"Test_userRenderer">, + } | null, + readonly " $refType": FragmentRefs<"Test_user">, +}; +export type Test_user$data = Test_user; +export type Test_user$key = { + readonly " $data"?: Test_user$data, + readonly " $fragmentRefs": FragmentRefs<"Test_user">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type Test_userRenderer = { + readonly user: { + readonly username: string | null + } | null, + readonly " $refType": FragmentRefs<"Test_userRenderer">, +}; +export type Test_userRenderer$data = Test_userRenderer; +export type Test_userRenderer$key = { + readonly " $data"?: Test_userRenderer$data, + readonly " $fragmentRefs": FragmentRefs<"Test_userRenderer">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import { Local3DPayload } from "relay-runtime"; +export type TestVariables = {}; +export type TestResponse = { + readonly node: { + readonly " $fragmentRefs": FragmentRefs<"Test_user"> + } | null +}; +export type Test_userRenderer = { + readonly user: { + readonly username: string | null, + readonly id: string, + } | null +}; +export type TestRawResponse = { + readonly node: { + readonly __typename: "User", + readonly id: string, + readonly plainUserRenderer: { + readonly __module_operation_Test_user: any | null, + readonly __module_component_Test_user: any | null, + } | Local3DPayload<"Test_user", {}> | null, + } | { + readonly __typename: string, + readonly id: string, + } | null +}; +export type Test = { + variables: TestVariables, + response: TestResponse, + rawResponse: TestRawResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type Test_user = { + readonly plainUserRenderer: { + readonly __fragmentPropName?: string | null, + readonly __module_component?: string | null, + readonly " $fragmentRefs": FragmentRefs<"Test_userRenderer">, + } | null, + readonly " $refType": FragmentRefs<"Test_user">, +}; +export type Test_user$data = Test_user; +export type Test_user$key = { + readonly " $data"?: Test_user$data, + readonly " $fragmentRefs": FragmentRefs<"Test_user">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type Test_userRenderer = { + readonly user: { + readonly username: string | null + } | null, + readonly " $refType": FragmentRefs<"Test_userRenderer">, +}; +export type Test_userRenderer$data = Test_userRenderer; +export type Test_userRenderer$key = { + readonly " $data"?: Test_userRenderer$data, + readonly " $fragmentRefs": FragmentRefs<"Test_userRenderer">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import { Local3DPayload } from "relay-runtime"; +export type TestVariables = {}; +export type TestResponse = { + readonly node: { + readonly " $fragmentRefs": FragmentRefs<"Test_user"> + } | null +}; +export type Test_userRenderer = { + readonly user: { + readonly username: string | null, + readonly id: string, + } | null +}; +export type TestRawResponse = { + readonly node: { + readonly __typename: "User", + readonly id: string, + readonly plainUserRenderer: { + readonly __module_operation_Test_user: any | null, + readonly __module_component_Test_user: any | null, + } | Local3DPayload<"Test_user", {}> | null, + } | { + readonly __typename: string, + readonly id: string, + } | null +}; +export type Test = { + variables: TestVariables, + response: TestResponse, + rawResponse: TestRawResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type Test_user = { + readonly plainUserRenderer: { + readonly __fragmentPropName?: string | null, + readonly __module_component?: string | null, + readonly " $fragmentRefs": FragmentRefs<"Test_userRenderer">, + } | null, + readonly " $refType": FragmentRefs<"Test_user">, +}; +export type Test_user$data = Test_user; +export type Test_user$key = { + readonly " $data"?: Test_user$data, + readonly " $fragmentRefs": FragmentRefs<"Test_user">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type Test_userRenderer = { + readonly user: { + readonly username: string | null + } | null, + readonly " $refType": FragmentRefs<"Test_userRenderer">, +}; +export type Test_userRenderer$data = Test_userRenderer; +export type Test_userRenderer$key = { + readonly " $data"?: Test_userRenderer$data, + readonly " $fragmentRefs": FragmentRefs<"Test_userRenderer">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import { Local3DPayload } from "relay-runtime"; export type TestVariables = {}; export type TestResponse = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected index 3f30ae8c30d19..e7e21f0eb0705 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected @@ -48,6 +48,458 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import { Local3DPayload } from "relay-runtime"; +export type TestVariables = {}; +export type TestResponse = { + readonly node: { + readonly username?: string | null, + readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment">, + } | null, + readonly viewer: { + readonly actor: { + readonly name?: string | null, + readonly " $fragmentRefs": FragmentRefs<"AnotherNameRendererFragment">, + } | null + } | null, +}; +export type PlainUserNameRenderer_name = { + readonly plaintext: string | null, + readonly data: { + readonly text: string | null, + readonly id: string | null, + } | null, +}; +export type MarkdownUserNameRenderer_name = { + readonly markdown: string | null, + readonly data: { + readonly markup: string | null, + readonly id: string | null, + } | null, +}; +export type TestRawResponse = { + readonly node: { + readonly __typename: "User", + readonly id: string, + readonly username: string | null, + readonly nameRenderer: { + readonly __typename: "PlainUserNameRenderer", + readonly __module_operation_NameRendererFragment: any | null, + readonly __module_component_NameRendererFragment: any | null, + } | Local3DPayload<"NameRendererFragment", { + readonly __typename: "PlainUserNameRenderer", + }> | { + readonly __typename: "MarkdownUserNameRenderer", + readonly __module_operation_NameRendererFragment: any | null, + readonly __module_component_NameRendererFragment: any | null, + } | Local3DPayload<"NameRendererFragment", { + readonly __typename: "MarkdownUserNameRenderer", + }> | { + readonly __typename: string + } | null, + } | { + readonly __typename: string, + readonly id: string, + } | null, + readonly viewer: { + readonly actor: { + readonly __typename: "User", + readonly id: string, + readonly name: string | null, + readonly nameRenderer: { + readonly __typename: "PlainUserNameRenderer", + readonly __module_operation_AnotherNameRendererFragment: any | null, + readonly __module_component_AnotherNameRendererFragment: any | null, + } | Local3DPayload<"AnotherNameRendererFragment", { + readonly __typename: "PlainUserNameRenderer", + }> | { + readonly __typename: "MarkdownUserNameRenderer", + readonly __module_operation_AnotherNameRendererFragment: any | null, + readonly __module_component_AnotherNameRendererFragment: any | null, + } | Local3DPayload<"AnotherNameRendererFragment", { + readonly __typename: "MarkdownUserNameRenderer", + }> | { + readonly __typename: string + } | null, + } | { + readonly __typename: string, + readonly id: string, + } | null + } | null, +}; +export type Test = { + variables: TestVariables, + response: TestResponse, + rawResponse: TestRawResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type AnotherNameRendererFragment = { + readonly name: string | null, + readonly nameRenderer: { + readonly __fragmentPropName?: string | null, + readonly __module_component?: string | null, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, + } | null, + readonly " $refType": FragmentRefs<"AnotherNameRendererFragment">, +}; +export type AnotherNameRendererFragment$data = AnotherNameRendererFragment; +export type AnotherNameRendererFragment$key = { + readonly " $data"?: AnotherNameRendererFragment$data, + readonly " $fragmentRefs": FragmentRefs<"AnotherNameRendererFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type MarkdownUserNameRenderer_name = { + readonly markdown: string | null, + readonly data: { + readonly markup: string | null + } | null, + readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">, +}; +export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; +export type MarkdownUserNameRenderer_name$key = { + readonly " $data"?: MarkdownUserNameRenderer_name$data, + readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type NameRendererFragment = { + readonly id: string, + readonly nameRenderer: { + readonly __fragmentPropName?: string | null, + readonly __module_component?: string | null, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, + } | null, + readonly " $refType": FragmentRefs<"NameRendererFragment">, +}; +export type NameRendererFragment$data = NameRendererFragment; +export type NameRendererFragment$key = { + readonly " $data"?: NameRendererFragment$data, + readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type PlainUserNameRenderer_name = { + readonly plaintext: string | null, + readonly data: { + readonly text: string | null + } | null, + readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">, +}; +export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; +export type PlainUserNameRenderer_name$key = { + readonly " $data"?: PlainUserNameRenderer_name$data, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import { Local3DPayload } from "relay-runtime"; +export type TestVariables = {}; +export type TestResponse = { + readonly node: { + readonly username?: string | null, + readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment">, + } | null, + readonly viewer: { + readonly actor: { + readonly name?: string | null, + readonly " $fragmentRefs": FragmentRefs<"AnotherNameRendererFragment">, + } | null + } | null, +}; +export type PlainUserNameRenderer_name = { + readonly plaintext: string | null, + readonly data: { + readonly text: string | null, + readonly id: string | null, + } | null, +}; +export type MarkdownUserNameRenderer_name = { + readonly markdown: string | null, + readonly data: { + readonly markup: string | null, + readonly id: string | null, + } | null, +}; +export type TestRawResponse = { + readonly node: { + readonly __typename: "User", + readonly id: string, + readonly username: string | null, + readonly nameRenderer: { + readonly __typename: "PlainUserNameRenderer", + readonly __module_operation_NameRendererFragment: any | null, + readonly __module_component_NameRendererFragment: any | null, + } | Local3DPayload<"NameRendererFragment", { + readonly __typename: "PlainUserNameRenderer", + }> | { + readonly __typename: "MarkdownUserNameRenderer", + readonly __module_operation_NameRendererFragment: any | null, + readonly __module_component_NameRendererFragment: any | null, + } | Local3DPayload<"NameRendererFragment", { + readonly __typename: "MarkdownUserNameRenderer", + }> | { + readonly __typename: string + } | null, + } | { + readonly __typename: string, + readonly id: string, + } | null, + readonly viewer: { + readonly actor: { + readonly __typename: "User", + readonly id: string, + readonly name: string | null, + readonly nameRenderer: { + readonly __typename: "PlainUserNameRenderer", + readonly __module_operation_AnotherNameRendererFragment: any | null, + readonly __module_component_AnotherNameRendererFragment: any | null, + } | Local3DPayload<"AnotherNameRendererFragment", { + readonly __typename: "PlainUserNameRenderer", + }> | { + readonly __typename: "MarkdownUserNameRenderer", + readonly __module_operation_AnotherNameRendererFragment: any | null, + readonly __module_component_AnotherNameRendererFragment: any | null, + } | Local3DPayload<"AnotherNameRendererFragment", { + readonly __typename: "MarkdownUserNameRenderer", + }> | { + readonly __typename: string + } | null, + } | { + readonly __typename: string, + readonly id: string, + } | null + } | null, +}; +export type Test = { + variables: TestVariables, + response: TestResponse, + rawResponse: TestRawResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type AnotherNameRendererFragment = { + readonly name: string | null, + readonly nameRenderer: { + readonly __fragmentPropName?: string | null, + readonly __module_component?: string | null, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, + } | null, + readonly " $refType": FragmentRefs<"AnotherNameRendererFragment">, +}; +export type AnotherNameRendererFragment$data = AnotherNameRendererFragment; +export type AnotherNameRendererFragment$key = { + readonly " $data"?: AnotherNameRendererFragment$data, + readonly " $fragmentRefs": FragmentRefs<"AnotherNameRendererFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type MarkdownUserNameRenderer_name = { + readonly markdown: string | null, + readonly data: { + readonly markup: string | null + } | null, + readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">, +}; +export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; +export type MarkdownUserNameRenderer_name$key = { + readonly " $data"?: MarkdownUserNameRenderer_name$data, + readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type NameRendererFragment = { + readonly id: string, + readonly nameRenderer: { + readonly __fragmentPropName?: string | null, + readonly __module_component?: string | null, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, + } | null, + readonly " $refType": FragmentRefs<"NameRendererFragment">, +}; +export type NameRendererFragment$data = NameRendererFragment; +export type NameRendererFragment$key = { + readonly " $data"?: NameRendererFragment$data, + readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type PlainUserNameRenderer_name = { + readonly plaintext: string | null, + readonly data: { + readonly text: string | null + } | null, + readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">, +}; +export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; +export type PlainUserNameRenderer_name$key = { + readonly " $data"?: PlainUserNameRenderer_name$data, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import { Local3DPayload } from "relay-runtime"; +export type TestVariables = {}; +export type TestResponse = { + readonly node: { + readonly username?: string | null, + readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment">, + } | null, + readonly viewer: { + readonly actor: { + readonly name?: string | null, + readonly " $fragmentRefs": FragmentRefs<"AnotherNameRendererFragment">, + } | null + } | null, +}; +export type PlainUserNameRenderer_name = { + readonly plaintext: string | null, + readonly data: { + readonly text: string | null, + readonly id: string | null, + } | null, +}; +export type MarkdownUserNameRenderer_name = { + readonly markdown: string | null, + readonly data: { + readonly markup: string | null, + readonly id: string | null, + } | null, +}; +export type TestRawResponse = { + readonly node: { + readonly __typename: "User", + readonly id: string, + readonly username: string | null, + readonly nameRenderer: { + readonly __typename: "PlainUserNameRenderer", + readonly __module_operation_NameRendererFragment: any | null, + readonly __module_component_NameRendererFragment: any | null, + } | Local3DPayload<"NameRendererFragment", { + readonly __typename: "PlainUserNameRenderer", + }> | { + readonly __typename: "MarkdownUserNameRenderer", + readonly __module_operation_NameRendererFragment: any | null, + readonly __module_component_NameRendererFragment: any | null, + } | Local3DPayload<"NameRendererFragment", { + readonly __typename: "MarkdownUserNameRenderer", + }> | { + readonly __typename: string + } | null, + } | { + readonly __typename: string, + readonly id: string, + } | null, + readonly viewer: { + readonly actor: { + readonly __typename: "User", + readonly id: string, + readonly name: string | null, + readonly nameRenderer: { + readonly __typename: "PlainUserNameRenderer", + readonly __module_operation_AnotherNameRendererFragment: any | null, + readonly __module_component_AnotherNameRendererFragment: any | null, + } | Local3DPayload<"AnotherNameRendererFragment", { + readonly __typename: "PlainUserNameRenderer", + }> | { + readonly __typename: "MarkdownUserNameRenderer", + readonly __module_operation_AnotherNameRendererFragment: any | null, + readonly __module_component_AnotherNameRendererFragment: any | null, + } | Local3DPayload<"AnotherNameRendererFragment", { + readonly __typename: "MarkdownUserNameRenderer", + }> | { + readonly __typename: string + } | null, + } | { + readonly __typename: string, + readonly id: string, + } | null + } | null, +}; +export type Test = { + variables: TestVariables, + response: TestResponse, + rawResponse: TestRawResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type AnotherNameRendererFragment = { + readonly name: string | null, + readonly nameRenderer: { + readonly __fragmentPropName?: string | null, + readonly __module_component?: string | null, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, + } | null, + readonly " $refType": FragmentRefs<"AnotherNameRendererFragment">, +}; +export type AnotherNameRendererFragment$data = AnotherNameRendererFragment; +export type AnotherNameRendererFragment$key = { + readonly " $data"?: AnotherNameRendererFragment$data, + readonly " $fragmentRefs": FragmentRefs<"AnotherNameRendererFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type MarkdownUserNameRenderer_name = { + readonly markdown: string | null, + readonly data: { + readonly markup: string | null + } | null, + readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">, +}; +export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; +export type MarkdownUserNameRenderer_name$key = { + readonly " $data"?: MarkdownUserNameRenderer_name$data, + readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type NameRendererFragment = { + readonly id: string, + readonly nameRenderer: { + readonly __fragmentPropName?: string | null, + readonly __module_component?: string | null, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, + } | null, + readonly " $refType": FragmentRefs<"NameRendererFragment">, +}; +export type NameRendererFragment$data = NameRendererFragment; +export type NameRendererFragment$key = { + readonly " $data"?: NameRendererFragment$data, + readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type PlainUserNameRenderer_name = { + readonly plaintext: string | null, + readonly data: { + readonly text: string | null + } | null, + readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">, +}; +export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; +export type PlainUserNameRenderer_name$key = { + readonly " $data"?: PlainUserNameRenderer_name$data, + readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import { Local3DPayload } from "relay-runtime"; export type TestVariables = {}; export type TestResponse = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected index ee0bae98d057e..edca0f4806cef 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected @@ -16,6 +16,164 @@ fragment FriendFragment on User { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type ExampleQueryVariables = { + id: string, + condition: boolean, +}; +export type ExampleQueryResponse = { + readonly node: { + readonly " $fragmentRefs": FragmentRefs<"FriendFragment"> + } | null +}; +export type ExampleQueryRawResponse = { + readonly node: { + readonly __typename: "User", + readonly id: string, + readonly name: string | null, + readonly lastName: string | null, + readonly feedback: { + readonly id: string, + readonly name: string | null, + } | null, + } | { + readonly __typename: string, + readonly id: string, + } | null +}; +export type ExampleQuery = { + variables: ExampleQueryVariables, + response: ExampleQueryResponse, + rawResponse: ExampleQueryRawResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type FriendFragment = { + readonly name?: string | null, + readonly lastName?: string | null, + readonly feedback?: { + readonly id: string, + readonly name: string | null, + } | null, + readonly " $refType": FragmentRefs<"FriendFragment">, +}; +export type FriendFragment$data = FriendFragment; +export type FriendFragment$key = { + readonly " $data"?: FriendFragment$data, + readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type ExampleQueryVariables = { + id: string, + condition: boolean, +}; +export type ExampleQueryResponse = { + readonly node: { + readonly " $fragmentRefs": FragmentRefs<"FriendFragment"> + } | null +}; +export type ExampleQueryRawResponse = { + readonly node: { + readonly __typename: "User", + readonly id: string, + readonly name: string | null, + readonly lastName: string | null, + readonly feedback: { + readonly id: string, + readonly name: string | null, + } | null, + } | { + readonly __typename: string, + readonly id: string, + } | null +}; +export type ExampleQuery = { + variables: ExampleQueryVariables, + response: ExampleQueryResponse, + rawResponse: ExampleQueryRawResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type FriendFragment = { + readonly name?: string | null, + readonly lastName?: string | null, + readonly feedback?: { + readonly id: string, + readonly name: string | null, + } | null, + readonly " $refType": FragmentRefs<"FriendFragment">, +}; +export type FriendFragment$data = FriendFragment; +export type FriendFragment$key = { + readonly " $data"?: FriendFragment$data, + readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type ExampleQueryVariables = { + id: string, + condition: boolean, +}; +export type ExampleQueryResponse = { + readonly node: { + readonly " $fragmentRefs": FragmentRefs<"FriendFragment"> + } | null +}; +export type ExampleQueryRawResponse = { + readonly node: { + readonly __typename: "User", + readonly id: string, + readonly name: string | null, + readonly lastName: string | null, + readonly feedback: { + readonly id: string, + readonly name: string | null, + } | null, + } | { + readonly __typename: string, + readonly id: string, + } | null +}; +export type ExampleQuery = { + variables: ExampleQueryVariables, + response: ExampleQueryResponse, + rawResponse: ExampleQueryRawResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type FriendFragment = { + readonly name?: string | null, + readonly lastName?: string | null, + readonly feedback?: { + readonly id: string, + readonly name: string | null, + } | null, + readonly " $refType": FragmentRefs<"FriendFragment">, +}; +export type FriendFragment$data = FriendFragment; +export type FriendFragment$key = { + readonly " $data"?: FriendFragment$data, + readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type ExampleQueryVariables = { id: string, condition: boolean, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected index 50c980ed33975..1948f6a61fd76 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected @@ -22,6 +22,149 @@ fragment FriendFragment on User { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type ExampleQueryVariables = { + id: string +}; +export type ExampleQueryResponse = { + readonly node: { + readonly username: string | null, + readonly friends?: { + readonly count: number | null + } | null, + readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, + } | null +}; +export type ExampleQueryRawResponse = { + readonly node: { + readonly __typename: string, + readonly username: string | null, + readonly id: string, + } | null +}; +export type ExampleQuery = { + variables: ExampleQueryVariables, + response: ExampleQueryResponse, + rawResponse: ExampleQueryRawResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type FriendFragment = { + readonly name?: string | null, + readonly lastName?: string | null, + readonly feedback?: { + readonly id: string, + readonly name: string | null, + } | null, + readonly " $refType": FragmentRefs<"FriendFragment">, +}; +export type FriendFragment$data = FriendFragment; +export type FriendFragment$key = { + readonly " $data"?: FriendFragment$data, + readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type ExampleQueryVariables = { + id: string +}; +export type ExampleQueryResponse = { + readonly node: { + readonly username: string | null, + readonly friends?: { + readonly count: number | null + } | null, + readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, + } | null +}; +export type ExampleQueryRawResponse = { + readonly node: { + readonly __typename: string, + readonly username: string | null, + readonly id: string, + } | null +}; +export type ExampleQuery = { + variables: ExampleQueryVariables, + response: ExampleQueryResponse, + rawResponse: ExampleQueryRawResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type FriendFragment = { + readonly name?: string | null, + readonly lastName?: string | null, + readonly feedback?: { + readonly id: string, + readonly name: string | null, + } | null, + readonly " $refType": FragmentRefs<"FriendFragment">, +}; +export type FriendFragment$data = FriendFragment; +export type FriendFragment$key = { + readonly " $data"?: FriendFragment$data, + readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type ExampleQueryVariables = { + id: string +}; +export type ExampleQueryResponse = { + readonly node: { + readonly username: string | null, + readonly friends?: { + readonly count: number | null + } | null, + readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, + } | null +}; +export type ExampleQueryRawResponse = { + readonly node: { + readonly __typename: string, + readonly username: string | null, + readonly id: string, + } | null +}; +export type ExampleQuery = { + variables: ExampleQueryVariables, + response: ExampleQueryResponse, + rawResponse: ExampleQueryRawResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type FriendFragment = { + readonly name?: string | null, + readonly lastName?: string | null, + readonly feedback?: { + readonly id: string, + readonly name: string | null, + } | null, + readonly " $refType": FragmentRefs<"FriendFragment">, +}; +export type FriendFragment$data = FriendFragment; +export type FriendFragment$key = { + readonly " $data"?: FriendFragment$data, + readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type ExampleQueryVariables = { id: string }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream-connection.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream-connection.expected index 82ff2bfe6d861..f17d6b36ea182 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream-connection.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream-connection.expected @@ -17,6 +17,173 @@ query TestDefer @raw_response_type { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type TestDeferVariables = {}; +export type TestDeferResponse = { + readonly node: { + readonly name?: string | null, + readonly friends?: { + readonly edges: ReadonlyArray<{ + readonly node: { + readonly actor: { + readonly name: string | null + } | null + } | null + } | null> | null + } | null, + } | null +}; +export type TestDeferRawResponse = { + readonly node: { + readonly __typename: "User", + readonly id: string, + readonly name: string | null, + readonly friends: { + readonly edges: ReadonlyArray<{ + readonly node: { + readonly actor: { + readonly __typename: string, + readonly name: string | null, + readonly id: string, + } | null, + readonly id: string, + readonly __typename: "User", + } | null, + readonly cursor: string | null, + } | null> | null, + readonly pageInfo: { + readonly endCursor: string | null, + readonly hasNextPage: boolean | null, + } | null, + } | null, + } | { + readonly __typename: string, + readonly id: string, + } | null +}; +export type TestDefer = { + variables: TestDeferVariables, + response: TestDeferResponse, + rawResponse: TestDeferRawResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type TestDeferVariables = {}; +export type TestDeferResponse = { + readonly node: { + readonly name?: string | null, + readonly friends?: { + readonly edges: ReadonlyArray<{ + readonly node: { + readonly actor: { + readonly name: string | null + } | null + } | null + } | null> | null + } | null, + } | null +}; +export type TestDeferRawResponse = { + readonly node: { + readonly __typename: "User", + readonly id: string, + readonly name: string | null, + readonly friends: { + readonly edges: ReadonlyArray<{ + readonly node: { + readonly actor: { + readonly __typename: string, + readonly name: string | null, + readonly id: string, + } | null, + readonly id: string, + readonly __typename: "User", + } | null, + readonly cursor: string | null, + } | null> | null, + readonly pageInfo: { + readonly endCursor: string | null, + readonly hasNextPage: boolean | null, + } | null, + } | null, + } | { + readonly __typename: string, + readonly id: string, + } | null +}; +export type TestDefer = { + variables: TestDeferVariables, + response: TestDeferResponse, + rawResponse: TestDeferRawResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type TestDeferVariables = {}; +export type TestDeferResponse = { + readonly node: { + readonly name?: string | null, + readonly friends?: { + readonly edges: ReadonlyArray<{ + readonly node: { + readonly actor: { + readonly name: string | null + } | null + } | null + } | null> | null + } | null, + } | null +}; +export type TestDeferRawResponse = { + readonly node: { + readonly __typename: "User", + readonly id: string, + readonly name: string | null, + readonly friends: { + readonly edges: ReadonlyArray<{ + readonly node: { + readonly actor: { + readonly __typename: string, + readonly name: string | null, + readonly id: string, + } | null, + readonly id: string, + readonly __typename: "User", + } | null, + readonly cursor: string | null, + } | null> | null, + readonly pageInfo: { + readonly endCursor: string | null, + readonly hasNextPage: boolean | null, + } | null, + } | null, + } | { + readonly __typename: string, + readonly id: string, + } | null +}; +export type TestDefer = { + variables: TestDeferVariables, + response: TestDeferResponse, + rawResponse: TestDeferRawResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type TestDeferVariables = {}; export type TestDeferResponse = { readonly node: { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream.expected index 02344516afaf4..80845aabe0b2f 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream.expected @@ -18,6 +18,152 @@ query TestStream @raw_response_type { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type TestStreamVariables = {}; +export type TestStreamResponse = { + readonly node: { + readonly name?: string | null, + readonly friends?: { + readonly edges: ReadonlyArray<{ + readonly node: { + readonly id: string + } | null + } | null> | null + } | null, + } | null +}; +export type TestStreamRawResponse = { + readonly node: { + readonly __typename: "User", + readonly id: string, + readonly name: string | null, + readonly friends: { + readonly edges: ReadonlyArray<{ + readonly node: { + readonly id: string, + readonly __typename: "User", + } | null, + readonly cursor: string | null, + } | null> | null, + readonly pageInfo: { + readonly endCursor: string | null, + readonly hasNextPage: boolean | null, + } | null, + } | null, + } | { + readonly __typename: string, + readonly id: string, + } | null +}; +export type TestStream = { + variables: TestStreamVariables, + response: TestStreamResponse, + rawResponse: TestStreamRawResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type TestStreamVariables = {}; +export type TestStreamResponse = { + readonly node: { + readonly name?: string | null, + readonly friends?: { + readonly edges: ReadonlyArray<{ + readonly node: { + readonly id: string + } | null + } | null> | null + } | null, + } | null +}; +export type TestStreamRawResponse = { + readonly node: { + readonly __typename: "User", + readonly id: string, + readonly name: string | null, + readonly friends: { + readonly edges: ReadonlyArray<{ + readonly node: { + readonly id: string, + readonly __typename: "User", + } | null, + readonly cursor: string | null, + } | null> | null, + readonly pageInfo: { + readonly endCursor: string | null, + readonly hasNextPage: boolean | null, + } | null, + } | null, + } | { + readonly __typename: string, + readonly id: string, + } | null +}; +export type TestStream = { + variables: TestStreamVariables, + response: TestStreamResponse, + rawResponse: TestStreamRawResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type TestStreamVariables = {}; +export type TestStreamResponse = { + readonly node: { + readonly name?: string | null, + readonly friends?: { + readonly edges: ReadonlyArray<{ + readonly node: { + readonly id: string + } | null + } | null> | null + } | null, + } | null +}; +export type TestStreamRawResponse = { + readonly node: { + readonly __typename: "User", + readonly id: string, + readonly name: string | null, + readonly friends: { + readonly edges: ReadonlyArray<{ + readonly node: { + readonly id: string, + readonly __typename: "User", + } | null, + readonly cursor: string | null, + } | null> | null, + readonly pageInfo: { + readonly endCursor: string | null, + readonly hasNextPage: boolean | null, + } | null, + } | null, + } | { + readonly __typename: string, + readonly id: string, + } | null +}; +export type TestStream = { + variables: TestStreamVariables, + response: TestStreamResponse, + rawResponse: TestStreamRawResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type TestStreamVariables = {}; export type TestStreamResponse = { readonly node: { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/recursive-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/recursive-fragments.expected index 6186eb28510ea..48623d69d0ed3 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/recursive-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/recursive-fragments.expected @@ -6,6 +6,62 @@ fragment FragmentSpread on Node { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import { FragmentRefs } from "relay-runtime"; +export type FragmentSpread = { + readonly id: string, + readonly " $fragmentRefs": FragmentRefs<"FragmentSpread">, + readonly " $refType": FragmentRefs<"FragmentSpread">, +}; +export type FragmentSpread$data = FragmentSpread; +export type FragmentSpread$key = { + readonly " $data"?: FragmentSpread$data, + readonly " $fragmentRefs": FragmentRefs<"FragmentSpread">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import { FragmentRefs } from "relay-runtime"; +export type FragmentSpread = { + readonly id: string, + readonly " $fragmentRefs": FragmentRefs<"FragmentSpread">, + readonly " $refType": FragmentRefs<"FragmentSpread">, +}; +export type FragmentSpread$data = FragmentSpread; +export type FragmentSpread$key = { + readonly " $data"?: FragmentSpread$data, + readonly " $fragmentRefs": FragmentRefs<"FragmentSpread">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import { FragmentRefs } from "relay-runtime"; +export type FragmentSpread = { + readonly id: string, + readonly " $fragmentRefs": FragmentRefs<"FragmentSpread">, + readonly " $refType": FragmentRefs<"FragmentSpread">, +}; +export type FragmentSpread$data = FragmentSpread; +export type FragmentSpread$key = { + readonly " $data"?: FragmentSpread$data, + readonly " $fragmentRefs": FragmentRefs<"FragmentSpread">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import { FragmentRefs } from "relay-runtime"; export type FragmentSpread = { readonly id: string, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected index 092edbff12056..15cbca8c4a7a8 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected @@ -7,6 +7,110 @@ fragment RefetchableFragment on Node } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import { FragmentRefs } from "relay-runtime"; +export type RefetchableFragmentQueryVariables = { + id: string +}; +export type RefetchableFragmentQueryResponse = { + readonly node: { + readonly " $fragmentRefs": FragmentRefs<"RefetchableFragment"> + } | null +}; +export type RefetchableFragmentQuery = { + variables: RefetchableFragmentQueryVariables, + response: RefetchableFragmentQueryResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type RefetchableFragment = { + readonly id: string, + readonly fragAndField: { + readonly uri: string | null + } | null, + readonly " $refType": FragmentRefs<"RefetchableFragment">, +}; +export type RefetchableFragment$data = RefetchableFragment; +export type RefetchableFragment$key = { + readonly " $data"?: RefetchableFragment$data, + readonly " $fragmentRefs": FragmentRefs<"RefetchableFragment">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import { FragmentRefs } from "relay-runtime"; +export type RefetchableFragmentQueryVariables = { + id: string +}; +export type RefetchableFragmentQueryResponse = { + readonly node: { + readonly " $fragmentRefs": FragmentRefs<"RefetchableFragment"> + } | null +}; +export type RefetchableFragmentQuery = { + variables: RefetchableFragmentQueryVariables, + response: RefetchableFragmentQueryResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type RefetchableFragment = { + readonly id: string, + readonly fragAndField: { + readonly uri: string | null + } | null, + readonly " $refType": FragmentRefs<"RefetchableFragment">, +}; +export type RefetchableFragment$data = RefetchableFragment; +export type RefetchableFragment$key = { + readonly " $data"?: RefetchableFragment$data, + readonly " $fragmentRefs": FragmentRefs<"RefetchableFragment">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import { FragmentRefs } from "relay-runtime"; +export type RefetchableFragmentQueryVariables = { + id: string +}; +export type RefetchableFragmentQueryResponse = { + readonly node: { + readonly " $fragmentRefs": FragmentRefs<"RefetchableFragment"> + } | null +}; +export type RefetchableFragmentQuery = { + variables: RefetchableFragmentQueryVariables, + response: RefetchableFragmentQueryResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type RefetchableFragment = { + readonly id: string, + readonly fragAndField: { + readonly uri: string | null + } | null, + readonly " $refType": FragmentRefs<"RefetchableFragment">, +}; +export type RefetchableFragment$data = RefetchableFragment; +export type RefetchableFragment$key = { + readonly " $data"?: RefetchableFragment$data, + readonly " $fragmentRefs": FragmentRefs<"RefetchableFragment">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import { FragmentRefs } from "relay-runtime"; export type RefetchableFragmentQueryVariables = { id: string diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected index b128236bbe478..5621468aaa08a 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected @@ -7,6 +7,104 @@ fragment FlowRefetchableFragment on Node } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import { FragmentRefs } from "relay-runtime"; +export type FlowRefetchableFragmentQueryVariables = { + id: string +}; +export type FlowRefetchableFragmentQueryResponse = { + readonly node: { + readonly " $fragmentRefs": FragmentRefs<"FlowRefetchableFragment"> + } | null +}; +export type FlowRefetchableFragmentQuery = { + variables: FlowRefetchableFragmentQueryVariables, + response: FlowRefetchableFragmentQueryResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type FlowRefetchableFragment = { + readonly id: string, + readonly name?: string | null, + readonly " $refType": FragmentRefs<"FlowRefetchableFragment">, +}; +export type FlowRefetchableFragment$data = FlowRefetchableFragment; +export type FlowRefetchableFragment$key = { + readonly " $data"?: FlowRefetchableFragment$data, + readonly " $fragmentRefs": FragmentRefs<"FlowRefetchableFragment">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import { FragmentRefs } from "relay-runtime"; +export type FlowRefetchableFragmentQueryVariables = { + id: string +}; +export type FlowRefetchableFragmentQueryResponse = { + readonly node: { + readonly " $fragmentRefs": FragmentRefs<"FlowRefetchableFragment"> + } | null +}; +export type FlowRefetchableFragmentQuery = { + variables: FlowRefetchableFragmentQueryVariables, + response: FlowRefetchableFragmentQueryResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type FlowRefetchableFragment = { + readonly id: string, + readonly name?: string | null, + readonly " $refType": FragmentRefs<"FlowRefetchableFragment">, +}; +export type FlowRefetchableFragment$data = FlowRefetchableFragment; +export type FlowRefetchableFragment$key = { + readonly " $data"?: FlowRefetchableFragment$data, + readonly " $fragmentRefs": FragmentRefs<"FlowRefetchableFragment">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import { FragmentRefs } from "relay-runtime"; +export type FlowRefetchableFragmentQueryVariables = { + id: string +}; +export type FlowRefetchableFragmentQueryResponse = { + readonly node: { + readonly " $fragmentRefs": FragmentRefs<"FlowRefetchableFragment"> + } | null +}; +export type FlowRefetchableFragmentQuery = { + variables: FlowRefetchableFragmentQueryVariables, + response: FlowRefetchableFragmentQueryResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type FlowRefetchableFragment = { + readonly id: string, + readonly name?: string | null, + readonly " $refType": FragmentRefs<"FlowRefetchableFragment">, +}; +export type FlowRefetchableFragment$data = FlowRefetchableFragment; +export type FlowRefetchableFragment$key = { + readonly " $data"?: FlowRefetchableFragment$data, + readonly " $fragmentRefs": FragmentRefs<"FlowRefetchableFragment">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import { FragmentRefs } from "relay-runtime"; export type FlowRefetchableFragmentQueryVariables = { id: string diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected index c227b16247911..249338c265abd 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected @@ -27,6 +27,11 @@ query RelayClientIDFieldQuery($id: ID!) { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + export type RelayClientIDFieldQueryVariables = { id: string }; @@ -37,19 +42,160 @@ export type RelayClientIDFieldQueryResponse = { readonly __typename: string, readonly id: string, } | null, - readonly node: { + readonly node: ({ + readonly __typename: "Comment", + readonly commentBody: ({ + readonly __typename: "PlainCommentBody", + readonly __id: string, + readonly text: { + readonly __id: string, + readonly __typename: string, + readonly text: string | null, + } | null, + } | { + readonly __typename: "MarkdownCommentBody" + }) & { + readonly __id: string + } | null, + } | { + readonly __typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "User" + }) & { + readonly __id: string, + readonly id: string, + } | null, +}; +export type RelayClientIDFieldQuery = { + variables: RelayClientIDFieldQueryVariables, + response: RelayClientIDFieldQueryResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type RelayClientIDFieldQueryVariables = { + id: string +}; +export type RelayClientIDFieldQueryResponse = { + readonly __id: string, + readonly me: { readonly __id: string, readonly __typename: string, readonly id: string, - readonly commentBody?: { + } | null, + readonly node: ({ + readonly __typename: "Comment", + readonly commentBody: ({ + readonly __typename: "PlainCommentBody", readonly __id: string, - readonly __typename: string, - readonly text?: { + readonly text: { readonly __id: string, readonly __typename: string, readonly text: string | null, } | null, + } | { + readonly __typename: "MarkdownCommentBody" + }) & { + readonly __id: string } | null, + } | { + readonly __typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "User" + }) & { + readonly __id: string, + readonly id: string, + } | null, +}; +export type RelayClientIDFieldQuery = { + variables: RelayClientIDFieldQueryVariables, + response: RelayClientIDFieldQueryResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type RelayClientIDFieldQueryVariables = { + id: string +}; +export type RelayClientIDFieldQueryResponse = { + readonly __id: string, + readonly me: { + readonly __id: string, + readonly __typename: string, + readonly id: string, + } | null, + readonly node: ({ + readonly __typename: "Comment", + readonly commentBody: ({ + readonly __typename: "PlainCommentBody", + readonly __id: string, + readonly text: { + readonly __id: string, + readonly __typename: string, + readonly text: string | null, + } | null, + } | { + // This will never be '%other', but we need some + // value in case none of the concrete values match. + readonly __typename: "MarkdownCommentBody" | "%other" + }) & { + readonly __id: string + } | null, + } | { + // This will never be '%other', but we need some + // value in case none of the concrete values match. + readonly __typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "User" | "%other" + }) & { + readonly __id: string, + readonly id: string, + } | null, +}; +export type RelayClientIDFieldQuery = { + variables: RelayClientIDFieldQueryVariables, + response: RelayClientIDFieldQueryResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + +export type RelayClientIDFieldQueryVariables = { + id: string +}; +export type RelayClientIDFieldQueryResponse = { + readonly __id: string, + readonly me: { + readonly __id: string, + readonly __typename: string, + readonly id: string, + } | null, + readonly node: ({ + readonly __typename: "Comment", + readonly commentBody: ({ + readonly __typename: "PlainCommentBody", + readonly __id: string, + readonly text: { + readonly __id: string, + readonly __typename: string, + readonly text: string | null, + } | null, + } | { + // This will never be '%other', but we need some + // value in case none of the concrete values match. + readonly __typename: "MarkdownCommentBody" | "%other" + }) & { + readonly __id: string + } | null, + } | { + // This will never be '%other', but we need some + // value in case none of the concrete values match. + readonly __typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "User" | "%other" + }) & { + readonly __id: string, + readonly id: string, } | null, }; export type RelayClientIDFieldQuery = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected index 841019bfdc650..49a094aa82a7c 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected @@ -8,16 +8,83 @@ fragment Foo on Node { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + import { FragmentRefs } from "relay-runtime"; -export type Foo = { +export type Foo = ({ + readonly __typename: "User", + readonly name: string, +} | { + readonly __typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" +}) & { + readonly " $refType": FragmentRefs<"Foo"> +} | null; +export type Foo$data = Foo; +export type Foo$key = { + readonly " $data"?: Foo$data, + readonly " $fragmentRefs": FragmentRefs<"Foo">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import { FragmentRefs } from "relay-runtime"; +export type Foo = ({ + readonly __typename: "User", + readonly name: string, +} | { + readonly __typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" +}) & { + readonly " $refType": FragmentRefs<"Foo"> +} | null; +export type Foo$data = Foo; +export type Foo$key = { + readonly " $data"?: Foo$data, + readonly " $fragmentRefs": FragmentRefs<"Foo">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import { FragmentRefs } from "relay-runtime"; +export type Foo = ({ + readonly __typename: "User", + readonly name: string, +} | { + // This will never be '%other', but we need some + // value in case none of the concrete values match. + readonly __typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" | "%other" +}) & { + readonly " $refType": FragmentRefs<"Foo"> +} | null; +export type Foo$data = Foo; +export type Foo$key = { + readonly " $data"?: Foo$data, + readonly " $fragmentRefs": FragmentRefs<"Foo">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + +import { FragmentRefs } from "relay-runtime"; +export type Foo = ({ readonly __typename: "User", readonly name: string, - readonly " $refType": FragmentRefs<"Foo">, } | { // This will never be '%other', but we need some // value in case none of the concrete values match. - readonly __typename: "%other", - readonly " $refType": FragmentRefs<"Foo">, + readonly __typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" | "%other" +}) & { + readonly " $refType": FragmentRefs<"Foo"> } | null; export type Foo$data = Foo; export type Foo$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-fragment.expected index 526785ee64ecb..798b05224ad07 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-fragment.expected @@ -4,6 +4,62 @@ fragment NonNullFragment on User { lastName @required(action: NONE) } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import { FragmentRefs } from "relay-runtime"; +export type NonNullFragment = { + readonly firstName: string | null, + readonly lastName: string, + readonly " $refType": FragmentRefs<"NonNullFragment">, +} | null; +export type NonNullFragment$data = NonNullFragment; +export type NonNullFragment$key = { + readonly " $data"?: NonNullFragment$data, + readonly " $fragmentRefs": FragmentRefs<"NonNullFragment">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import { FragmentRefs } from "relay-runtime"; +export type NonNullFragment = { + readonly firstName: string | null, + readonly lastName: string, + readonly " $refType": FragmentRefs<"NonNullFragment">, +} | null; +export type NonNullFragment$data = NonNullFragment; +export type NonNullFragment$key = { + readonly " $data"?: NonNullFragment$data, + readonly " $fragmentRefs": FragmentRefs<"NonNullFragment">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import { FragmentRefs } from "relay-runtime"; +export type NonNullFragment = { + readonly firstName: string | null, + readonly lastName: string, + readonly " $refType": FragmentRefs<"NonNullFragment">, +} | null; +export type NonNullFragment$data = NonNullFragment; +export type NonNullFragment$key = { + readonly " $data"?: NonNullFragment$data, + readonly " $fragmentRefs": FragmentRefs<"NonNullFragment">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import { FragmentRefs } from "relay-runtime"; export type NonNullFragment = { readonly firstName: string | null, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected index 408ec1c6dba57..b2d41c07ff741 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected @@ -7,6 +7,71 @@ fragment NonNullFragment on User { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import { FragmentRefs } from "relay-runtime"; +export type NonNullFragment = { + readonly firstName: string | null, + readonly screennames: ReadonlyArray<{ + readonly name: string | null, + readonly service: string, + } | null> | null, + readonly " $refType": FragmentRefs<"NonNullFragment">, +}; +export type NonNullFragment$data = NonNullFragment; +export type NonNullFragment$key = { + readonly " $data"?: NonNullFragment$data, + readonly " $fragmentRefs": FragmentRefs<"NonNullFragment">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import { FragmentRefs } from "relay-runtime"; +export type NonNullFragment = { + readonly firstName: string | null, + readonly screennames: ReadonlyArray<{ + readonly name: string | null, + readonly service: string, + } | null> | null, + readonly " $refType": FragmentRefs<"NonNullFragment">, +}; +export type NonNullFragment$data = NonNullFragment; +export type NonNullFragment$key = { + readonly " $data"?: NonNullFragment$data, + readonly " $fragmentRefs": FragmentRefs<"NonNullFragment">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import { FragmentRefs } from "relay-runtime"; +export type NonNullFragment = { + readonly firstName: string | null, + readonly screennames: ReadonlyArray<{ + readonly name: string | null, + readonly service: string, + } | null> | null, + readonly " $refType": FragmentRefs<"NonNullFragment">, +}; +export type NonNullFragment$data = NonNullFragment; +export type NonNullFragment$key = { + readonly " $data"?: NonNullFragment$data, + readonly " $fragmentRefs": FragmentRefs<"NonNullFragment">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import { FragmentRefs } from "relay-runtime"; export type NonNullFragment = { readonly firstName: string | null, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-query.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-query.expected index e631795abe1fd..d5bbbd5dee61e 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-query.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-query.expected @@ -6,6 +6,62 @@ query FooQuery { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type FooQueryVariables = {}; +export type FooQueryResponse = { + readonly me: { + readonly firstName: string | null, + readonly lastName: string, + } +} | null; +export type FooQuery = { + variables: FooQueryVariables, + response: FooQueryResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type FooQueryVariables = {}; +export type FooQueryResponse = { + readonly me: { + readonly firstName: string | null, + readonly lastName: string, + } +} | null; +export type FooQuery = { + variables: FooQueryVariables, + response: FooQueryResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type FooQueryVariables = {}; +export type FooQueryResponse = { + readonly me: { + readonly firstName: string | null, + readonly lastName: string, + } +} | null; +export type FooQuery = { + variables: FooQueryVariables, + response: FooQueryResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type FooQueryVariables = {}; export type FooQueryResponse = { readonly me: { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-up-to-mutation-response.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-up-to-mutation-response.expected index b222fb5b789aa..41854d95800e0 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-up-to-mutation-response.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-up-to-mutation-response.expected @@ -7,6 +7,104 @@ mutation CommentCreateMutation($input: CommentCreateInput!) { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type CommentCreateInput = { + clientMutationId?: string | null, + feedbackId?: string | null, + feedback?: CommentfeedbackFeedback | null, +}; +export type CommentfeedbackFeedback = { + comment?: FeedbackcommentComment | null +}; +export type FeedbackcommentComment = { + feedback?: CommentfeedbackFeedback | null +}; +export type CommentCreateMutationVariables = { + input: CommentCreateInput +}; +export type CommentCreateMutationResponse = { + readonly commentCreate: { + readonly comment: { + readonly id: string + } + } +} | null; +export type CommentCreateMutation = { + variables: CommentCreateMutationVariables, + response: CommentCreateMutationResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type CommentCreateInput = { + clientMutationId?: string | null, + feedbackId?: string | null, + feedback?: CommentfeedbackFeedback | null, +}; +export type CommentfeedbackFeedback = { + comment?: FeedbackcommentComment | null +}; +export type FeedbackcommentComment = { + feedback?: CommentfeedbackFeedback | null +}; +export type CommentCreateMutationVariables = { + input: CommentCreateInput +}; +export type CommentCreateMutationResponse = { + readonly commentCreate: { + readonly comment: { + readonly id: string + } + } +} | null; +export type CommentCreateMutation = { + variables: CommentCreateMutationVariables, + response: CommentCreateMutationResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type CommentCreateInput = { + clientMutationId?: string | null, + feedbackId?: string | null, + feedback?: CommentfeedbackFeedback | null, +}; +export type CommentfeedbackFeedback = { + comment?: FeedbackcommentComment | null +}; +export type FeedbackcommentComment = { + feedback?: CommentfeedbackFeedback | null +}; +export type CommentCreateMutationVariables = { + input: CommentCreateInput +}; +export type CommentCreateMutationResponse = { + readonly commentCreate: { + readonly comment: { + readonly id: string + } + } +} | null; +export type CommentCreateMutation = { + variables: CommentCreateMutationVariables, + response: CommentCreateMutationResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type CommentCreateInput = { clientMutationId?: string | null, feedbackId?: string | null, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected index 8a3058c66ddb5..2df83f8e5aa07 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected @@ -28,6 +28,130 @@ fragment Foo on Node { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import { FragmentRefs } from "relay-runtime"; +export type Bar = { + readonly name?: string, + readonly body?: { + readonly text: string | null + } | null, + readonly " $refType": FragmentRefs<"Bar">, +} | null; +export type Bar$data = Bar; +export type Bar$key = { + readonly " $data"?: Bar$data, + readonly " $fragmentRefs": FragmentRefs<"Bar">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type Foo = ({ + readonly __typename: "User", + readonly name: string, +} | { + readonly __typename: "Comment", + readonly body: { + readonly text: string | null + } | null, +} | { + readonly __typename: "Feedback" | "Page" | "PhotoStory" | "Story" +}) & { + readonly " $refType": FragmentRefs<"Foo"> +} | null; +export type Foo$data = Foo; +export type Foo$key = { + readonly " $data"?: Foo$data, + readonly " $fragmentRefs": FragmentRefs<"Foo">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import { FragmentRefs } from "relay-runtime"; +export type Bar = { + readonly name?: string, + readonly body?: { + readonly text: string | null + } | null, + readonly " $refType": FragmentRefs<"Bar">, +} | null; +export type Bar$data = Bar; +export type Bar$key = { + readonly " $data"?: Bar$data, + readonly " $fragmentRefs": FragmentRefs<"Bar">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type Foo = ({ + readonly __typename: "User", + readonly name: string, +} | { + readonly __typename: "Comment", + readonly body: { + readonly text: string | null + } | null, +} | { + readonly __typename: "Feedback" | "Page" | "PhotoStory" | "Story" +}) & { + readonly " $refType": FragmentRefs<"Foo"> +} | null; +export type Foo$data = Foo; +export type Foo$key = { + readonly " $data"?: Foo$data, + readonly " $fragmentRefs": FragmentRefs<"Foo">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import { FragmentRefs } from "relay-runtime"; +export type Bar = { + readonly name?: string, + readonly body?: { + readonly text: string | null + } | null, + readonly " $refType": FragmentRefs<"Bar">, +} | null; +export type Bar$data = Bar; +export type Bar$key = { + readonly " $data"?: Bar$data, + readonly " $fragmentRefs": FragmentRefs<"Bar">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type Foo = ({ + readonly __typename: "User", + readonly name: string, +} | { + readonly __typename: "Comment", + readonly body: { + readonly text: string | null + } | null, +} | { + // This will never be '%other', but we need some + // value in case none of the concrete values match. + readonly __typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "%other" +}) & { + readonly " $refType": FragmentRefs<"Foo"> +} | null; +export type Foo$data = Foo; +export type Foo$key = { + readonly " $data"?: Foo$data, + readonly " $fragmentRefs": FragmentRefs<"Foo">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import { FragmentRefs } from "relay-runtime"; export type Bar = { readonly name?: string, @@ -43,21 +167,20 @@ export type Bar$key = { }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type Foo = { +export type Foo = ({ readonly __typename: "User", readonly name: string, - readonly " $refType": FragmentRefs<"Foo">, } | { readonly __typename: "Comment", readonly body: { readonly text: string | null } | null, - readonly " $refType": FragmentRefs<"Foo">, } | { // This will never be '%other', but we need some // value in case none of the concrete values match. - readonly __typename: "%other", - readonly " $refType": FragmentRefs<"Foo">, + readonly __typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "%other" +}) & { + readonly " $refType": FragmentRefs<"Foo"> } | null; export type Foo$data = Foo; export type Foo$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-raw-response-type.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-raw-response-type.expected index 7429fe51144c0..d0f8aa88cc472 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-raw-response-type.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-raw-response-type.expected @@ -6,6 +6,83 @@ query MyQuery @raw_response_type { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type MyQueryVariables = {}; +export type MyQueryResponse = { + readonly me: { + readonly id: string, + readonly name: string, + } +} | null; +export type MyQueryRawResponse = { + readonly me: { + readonly id: string, + readonly name: string | null, + } | null +}; +export type MyQuery = { + variables: MyQueryVariables, + response: MyQueryResponse, + rawResponse: MyQueryRawResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type MyQueryVariables = {}; +export type MyQueryResponse = { + readonly me: { + readonly id: string, + readonly name: string, + } +} | null; +export type MyQueryRawResponse = { + readonly me: { + readonly id: string, + readonly name: string | null, + } | null +}; +export type MyQuery = { + variables: MyQueryVariables, + response: MyQueryResponse, + rawResponse: MyQueryRawResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type MyQueryVariables = {}; +export type MyQueryResponse = { + readonly me: { + readonly id: string, + readonly name: string, + } +} | null; +export type MyQueryRawResponse = { + readonly me: { + readonly id: string, + readonly name: string | null, + } | null +}; +export type MyQuery = { + variables: MyQueryVariables, + response: MyQueryResponse, + rawResponse: MyQueryRawResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type MyQueryVariables = {}; export type MyQueryResponse = { readonly me: { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected index e5d0421c64c03..0bee3dd662c15 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected @@ -4,6 +4,62 @@ fragment NonNullFragment on User { lastName @required(action: THROW) } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import { FragmentRefs } from "relay-runtime"; +export type NonNullFragment = { + readonly firstName: string | null, + readonly lastName: string, + readonly " $refType": FragmentRefs<"NonNullFragment">, +}; +export type NonNullFragment$data = NonNullFragment; +export type NonNullFragment$key = { + readonly " $data"?: NonNullFragment$data, + readonly " $fragmentRefs": FragmentRefs<"NonNullFragment">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import { FragmentRefs } from "relay-runtime"; +export type NonNullFragment = { + readonly firstName: string | null, + readonly lastName: string, + readonly " $refType": FragmentRefs<"NonNullFragment">, +}; +export type NonNullFragment$data = NonNullFragment; +export type NonNullFragment$key = { + readonly " $data"?: NonNullFragment$data, + readonly " $fragmentRefs": FragmentRefs<"NonNullFragment">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import { FragmentRefs } from "relay-runtime"; +export type NonNullFragment = { + readonly firstName: string | null, + readonly lastName: string, + readonly " $refType": FragmentRefs<"NonNullFragment">, +}; +export type NonNullFragment$data = NonNullFragment; +export type NonNullFragment$key = { + readonly " $data"?: NonNullFragment$data, + readonly " $fragmentRefs": FragmentRefs<"NonNullFragment">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import { FragmentRefs } from "relay-runtime"; export type NonNullFragment = { readonly firstName: string | null, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-query.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-query.expected index 60509d2802b1e..18041e0b5d0b5 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-query.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-query.expected @@ -6,6 +6,62 @@ query FooQuery { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type FooQueryVariables = {}; +export type FooQueryResponse = { + readonly me: { + readonly firstName: string | null, + readonly lastName: string | null, + } +}; +export type FooQuery = { + variables: FooQueryVariables, + response: FooQueryResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type FooQueryVariables = {}; +export type FooQueryResponse = { + readonly me: { + readonly firstName: string | null, + readonly lastName: string | null, + } +}; +export type FooQuery = { + variables: FooQueryVariables, + response: FooQueryResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type FooQueryVariables = {}; +export type FooQueryResponse = { + readonly me: { + readonly firstName: string | null, + readonly lastName: string | null, + } +}; +export type FooQuery = { + variables: FooQueryVariables, + response: FooQueryResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type FooQueryVariables = {}; export type FooQueryResponse = { readonly me: { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throws-nested.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throws-nested.expected index fc4ab910867c0..3ce8cc0d4807c 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throws-nested.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throws-nested.expected @@ -6,6 +6,62 @@ query FooQuery { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type FooQueryVariables = {}; +export type FooQueryResponse = { + readonly me: { + readonly firstName: string | null, + readonly lastName: string, + } | null +}; +export type FooQuery = { + variables: FooQueryVariables, + response: FooQueryResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type FooQueryVariables = {}; +export type FooQueryResponse = { + readonly me: { + readonly firstName: string | null, + readonly lastName: string, + } | null +}; +export type FooQuery = { + variables: FooQueryVariables, + response: FooQueryResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type FooQueryVariables = {}; +export type FooQueryResponse = { + readonly me: { + readonly firstName: string | null, + readonly lastName: string, + } | null +}; +export type FooQuery = { + variables: FooQueryVariables, + response: FooQueryResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type FooQueryVariables = {}; export type FooQueryResponse = { readonly me: { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required.expected index 0167018244b99..15c0fc9aa6aa9 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required.expected @@ -6,6 +6,62 @@ query FooQuery { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type FooQueryVariables = {}; +export type FooQueryResponse = { + readonly me: { + readonly firstName: string | null, + readonly lastName: string, + } | null +}; +export type FooQuery = { + variables: FooQueryVariables, + response: FooQueryResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type FooQueryVariables = {}; +export type FooQueryResponse = { + readonly me: { + readonly firstName: string | null, + readonly lastName: string, + } | null +}; +export type FooQuery = { + variables: FooQueryVariables, + response: FooQueryResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type FooQueryVariables = {}; +export type FooQueryResponse = { + readonly me: { + readonly firstName: string | null, + readonly lastName: string, + } | null +}; +export type FooQuery = { + variables: FooQueryVariables, + response: FooQueryResponse, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type FooQueryVariables = {}; export type FooQueryResponse = { readonly me: { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected index 402317637da1c..f43d15f35057b 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected @@ -25,6 +25,233 @@ subscription TestSubscription($input: FeedbackLikeInput) { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type ExampleQueryVariables = { + id: string +}; +export type ExampleQueryResponse = { + readonly node: { + readonly id: string + } | null +}; +export type ExampleQuery = { + variables: ExampleQueryVariables, + response: ExampleQueryResponse, +}; +------------------------------------------------------------------------------- +export type CommentCreateInput = { + clientMutationId?: string | null, + feedbackId?: string | null, + feedback?: CommentfeedbackFeedback | null, +}; +export type CommentfeedbackFeedback = { + comment?: FeedbackcommentComment | null +}; +export type FeedbackcommentComment = { + feedback?: CommentfeedbackFeedback | null +}; +export type TestMutationVariables = { + input: CommentCreateInput +}; +export type TestMutationResponse = { + readonly commentCreate: { + readonly comment: { + readonly id: string + } | null + } | null +}; +export type TestMutation = { + variables: TestMutationVariables, + response: TestMutationResponse, +}; +------------------------------------------------------------------------------- +export type FeedbackLikeInput = { + clientMutationId?: string | null, + feedbackId?: string | null, +}; +export type TestSubscriptionVariables = { + input?: FeedbackLikeInput | null +}; +export type TestSubscriptionResponse = { + readonly feedbackLikeSubscribe: { + readonly feedback: { + readonly id: string + } | null + } | null +}; +export type TestSubscription = { + variables: TestSubscriptionVariables, + response: TestSubscriptionResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type ExampleFragment = { + readonly id: string, + readonly " $refType": FragmentRefs<"ExampleFragment">, +}; +export type ExampleFragment$data = ExampleFragment; +export type ExampleFragment$key = { + readonly " $data"?: ExampleFragment$data, + readonly " $fragmentRefs": FragmentRefs<"ExampleFragment">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type ExampleQueryVariables = { + id: string +}; +export type ExampleQueryResponse = { + readonly node: { + readonly id: string + } | null +}; +export type ExampleQuery = { + variables: ExampleQueryVariables, + response: ExampleQueryResponse, +}; +------------------------------------------------------------------------------- +export type CommentCreateInput = { + clientMutationId?: string | null, + feedbackId?: string | null, + feedback?: CommentfeedbackFeedback | null, +}; +export type CommentfeedbackFeedback = { + comment?: FeedbackcommentComment | null +}; +export type FeedbackcommentComment = { + feedback?: CommentfeedbackFeedback | null +}; +export type TestMutationVariables = { + input: CommentCreateInput +}; +export type TestMutationResponse = { + readonly commentCreate: { + readonly comment: { + readonly id: string + } | null + } | null +}; +export type TestMutation = { + variables: TestMutationVariables, + response: TestMutationResponse, +}; +------------------------------------------------------------------------------- +export type FeedbackLikeInput = { + clientMutationId?: string | null, + feedbackId?: string | null, +}; +export type TestSubscriptionVariables = { + input?: FeedbackLikeInput | null +}; +export type TestSubscriptionResponse = { + readonly feedbackLikeSubscribe: { + readonly feedback: { + readonly id: string + } | null + } | null +}; +export type TestSubscription = { + variables: TestSubscriptionVariables, + response: TestSubscriptionResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type ExampleFragment = { + readonly id: string, + readonly " $refType": FragmentRefs<"ExampleFragment">, +}; +export type ExampleFragment$data = ExampleFragment; +export type ExampleFragment$key = { + readonly " $data"?: ExampleFragment$data, + readonly " $fragmentRefs": FragmentRefs<"ExampleFragment">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type ExampleQueryVariables = { + id: string +}; +export type ExampleQueryResponse = { + readonly node: { + readonly id: string + } | null +}; +export type ExampleQuery = { + variables: ExampleQueryVariables, + response: ExampleQueryResponse, +}; +------------------------------------------------------------------------------- +export type CommentCreateInput = { + clientMutationId?: string | null, + feedbackId?: string | null, + feedback?: CommentfeedbackFeedback | null, +}; +export type CommentfeedbackFeedback = { + comment?: FeedbackcommentComment | null +}; +export type FeedbackcommentComment = { + feedback?: CommentfeedbackFeedback | null +}; +export type TestMutationVariables = { + input: CommentCreateInput +}; +export type TestMutationResponse = { + readonly commentCreate: { + readonly comment: { + readonly id: string + } | null + } | null +}; +export type TestMutation = { + variables: TestMutationVariables, + response: TestMutationResponse, +}; +------------------------------------------------------------------------------- +export type FeedbackLikeInput = { + clientMutationId?: string | null, + feedbackId?: string | null, +}; +export type TestSubscriptionVariables = { + input?: FeedbackLikeInput | null +}; +export type TestSubscriptionResponse = { + readonly feedbackLikeSubscribe: { + readonly feedback: { + readonly id: string + } | null + } | null +}; +export type TestSubscription = { + variables: TestSubscriptionVariables, + response: TestSubscriptionResponse, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type ExampleFragment = { + readonly id: string, + readonly " $refType": FragmentRefs<"ExampleFragment">, +}; +export type ExampleFragment$data = ExampleFragment; +export type ExampleFragment$key = { + readonly " $data"?: ExampleFragment$data, + readonly " $fragmentRefs": FragmentRefs<"ExampleFragment">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type ExampleQueryVariables = { id: string }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/scalar-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/scalar-field.expected index 601c3b4878f21..d08a0c5363c5f 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/scalar-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/scalar-field.expected @@ -13,6 +13,92 @@ fragment ScalarField on User { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +export type PersonalityTraits = "CHEERFUL" | "DERISIVE" | "HELPFUL" | "SNARKY"; +import { FragmentRefs } from "relay-runtime"; +export type ScalarField = { + readonly id: string, + readonly name: string | null, + readonly websites: ReadonlyArray | null, + readonly traits: ReadonlyArray | null, + readonly aliasedLinkedField: { + readonly aliasedField: number | null + } | null, + readonly screennames: ReadonlyArray<{ + readonly name: string | null, + readonly service: string | null, + } | null> | null, + readonly " $refType": FragmentRefs<"ScalarField">, +}; +export type ScalarField$data = ScalarField; +export type ScalarField$key = { + readonly " $data"?: ScalarField$data, + readonly " $fragmentRefs": FragmentRefs<"ScalarField">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +export type PersonalityTraits = "CHEERFUL" | "DERISIVE" | "HELPFUL" | "SNARKY" | "%future added value"; +import { FragmentRefs } from "relay-runtime"; +export type ScalarField = { + readonly id: string, + readonly name: string | null, + readonly websites: ReadonlyArray | null, + readonly traits: ReadonlyArray | null, + readonly aliasedLinkedField: { + readonly aliasedField: number | null + } | null, + readonly screennames: ReadonlyArray<{ + readonly name: string | null, + readonly service: string | null, + } | null> | null, + readonly " $refType": FragmentRefs<"ScalarField">, +}; +export type ScalarField$data = ScalarField; +export type ScalarField$key = { + readonly " $data"?: ScalarField$data, + readonly " $fragmentRefs": FragmentRefs<"ScalarField">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +export type PersonalityTraits = "CHEERFUL" | "DERISIVE" | "HELPFUL" | "SNARKY"; +import { FragmentRefs } from "relay-runtime"; +export type ScalarField = { + readonly id: string, + readonly name: string | null, + readonly websites: ReadonlyArray | null, + readonly traits: ReadonlyArray | null, + readonly aliasedLinkedField: { + readonly aliasedField: number | null + } | null, + readonly screennames: ReadonlyArray<{ + readonly name: string | null, + readonly service: string | null, + } | null> | null, + readonly " $refType": FragmentRefs<"ScalarField">, +}; +export type ScalarField$data = ScalarField; +export type ScalarField$key = { + readonly " $data"?: ScalarField$data, + readonly " $fragmentRefs": FragmentRefs<"ScalarField">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + export type PersonalityTraits = "CHEERFUL" | "DERISIVE" | "HELPFUL" | "SNARKY" | "%future added value"; import { FragmentRefs } from "relay-runtime"; export type ScalarField = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/simple.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/simple.expected index 5153945130434..54121afda2b4a 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/simple.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/simple.expected @@ -8,6 +8,74 @@ fragment LinkedField on User { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import { FragmentRefs } from "relay-runtime"; +export type LinkedField = { + readonly name: string | null, + readonly profilePicture: { + readonly uri: string | null, + readonly width: number | null, + readonly height: number | null, + } | null, + readonly " $refType": FragmentRefs<"LinkedField">, +}; +export type LinkedField$data = LinkedField; +export type LinkedField$key = { + readonly " $data"?: LinkedField$data, + readonly " $fragmentRefs": FragmentRefs<"LinkedField">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import { FragmentRefs } from "relay-runtime"; +export type LinkedField = { + readonly name: string | null, + readonly profilePicture: { + readonly uri: string | null, + readonly width: number | null, + readonly height: number | null, + } | null, + readonly " $refType": FragmentRefs<"LinkedField">, +}; +export type LinkedField$data = LinkedField; +export type LinkedField$key = { + readonly " $data"?: LinkedField$data, + readonly " $fragmentRefs": FragmentRefs<"LinkedField">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import { FragmentRefs } from "relay-runtime"; +export type LinkedField = { + readonly name: string | null, + readonly profilePicture: { + readonly uri: string | null, + readonly width: number | null, + readonly height: number | null, + } | null, + readonly " $refType": FragmentRefs<"LinkedField">, +}; +export type LinkedField$data = LinkedField; +export type LinkedField$key = { + readonly " $data"?: LinkedField$data, + readonly " $fragmentRefs": FragmentRefs<"LinkedField">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import { FragmentRefs } from "relay-runtime"; export type LinkedField = { readonly name: string | null, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected index 29ebfa9a2c8f7..d6840e4adb4ac 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected @@ -16,6 +16,96 @@ fragment TypenameInsideWithOverlappingFields on Viewer { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import { FragmentRefs } from "relay-runtime"; +export type TypenameInsideWithOverlappingFields = { + readonly actor: { + readonly __typename: "Page", + readonly id: string, + readonly name: string | null, + } | { + readonly __typename: "User", + readonly id: string, + readonly name: string | null, + readonly profile_picture: { + readonly uri: string | null + } | null, + } | null, + readonly " $refType": FragmentRefs<"TypenameInsideWithOverlappingFields">, +}; +export type TypenameInsideWithOverlappingFields$data = TypenameInsideWithOverlappingFields; +export type TypenameInsideWithOverlappingFields$key = { + readonly " $data"?: TypenameInsideWithOverlappingFields$data, + readonly " $fragmentRefs": FragmentRefs<"TypenameInsideWithOverlappingFields">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import { FragmentRefs } from "relay-runtime"; +export type TypenameInsideWithOverlappingFields = { + readonly actor: { + readonly __typename: "Page", + readonly id: string, + readonly name: string | null, + } | { + readonly __typename: "User", + readonly id: string, + readonly name: string | null, + readonly profile_picture: { + readonly uri: string | null + } | null, + } | null, + readonly " $refType": FragmentRefs<"TypenameInsideWithOverlappingFields">, +}; +export type TypenameInsideWithOverlappingFields$data = TypenameInsideWithOverlappingFields; +export type TypenameInsideWithOverlappingFields$key = { + readonly " $data"?: TypenameInsideWithOverlappingFields$data, + readonly " $fragmentRefs": FragmentRefs<"TypenameInsideWithOverlappingFields">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import { FragmentRefs } from "relay-runtime"; +export type TypenameInsideWithOverlappingFields = { + readonly actor: { + readonly __typename: "Page", + readonly id: string, + readonly name: string | null, + } | { + readonly __typename: "User", + readonly id: string, + readonly name: string | null, + readonly profile_picture: { + readonly uri: string | null + } | null, + } | { + // This will never be '%other', but we need some + // value in case none of the concrete values match. + readonly __typename: "%other" + } | null, + readonly " $refType": FragmentRefs<"TypenameInsideWithOverlappingFields">, +}; +export type TypenameInsideWithOverlappingFields$data = TypenameInsideWithOverlappingFields; +export type TypenameInsideWithOverlappingFields$key = { + readonly " $data"?: TypenameInsideWithOverlappingFields$data, + readonly " $fragmentRefs": FragmentRefs<"TypenameInsideWithOverlappingFields">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import { FragmentRefs } from "relay-runtime"; export type TypenameInsideWithOverlappingFields = { readonly actor: { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected index 457860be7f29a..7a590eda492b1 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected @@ -80,20 +80,296 @@ fragment TypenameAliases on Actor { } } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import { FragmentRefs } from "relay-runtime"; +export type TypenameAlias = ({ + readonly _typeAlias: "User", + readonly firstName: string | null, +} | { + readonly _typeAlias: "Page", + readonly username: string | null, +}) & { + readonly " $refType": FragmentRefs<"TypenameAlias"> +}; +export type TypenameAlias$data = TypenameAlias; +export type TypenameAlias$key = { + readonly " $data"?: TypenameAlias$data, + readonly " $fragmentRefs": FragmentRefs<"TypenameAlias">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type TypenameAliases = ({ + readonly _typeAlias1: "User", + readonly _typeAlias2: "User", + readonly firstName: string | null, +} | { + readonly _typeAlias1: "Page", + readonly _typeAlias2: "Page", + readonly username: string | null, +}) & { + readonly " $refType": FragmentRefs<"TypenameAliases"> +}; +export type TypenameAliases$data = TypenameAliases; +export type TypenameAliases$key = { + readonly " $data"?: TypenameAliases$data, + readonly " $fragmentRefs": FragmentRefs<"TypenameAliases">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type TypenameInside = ({ + readonly __typename: "User", + readonly firstName: string | null, +} | { + readonly __typename: "Page", + readonly username: string | null, +}) & { + readonly " $refType": FragmentRefs<"TypenameInside"> +}; +export type TypenameInside$data = TypenameInside; +export type TypenameInside$key = { + readonly " $data"?: TypenameInside$data, + readonly " $fragmentRefs": FragmentRefs<"TypenameInside">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type TypenameOutside = ({ + readonly __typename: "User", + readonly firstName: string | null, +} | { + readonly __typename: "Page", + readonly username: string | null, +}) & { + readonly " $refType": FragmentRefs<"TypenameOutside"> +}; +export type TypenameOutside$data = TypenameOutside; +export type TypenameOutside$key = { + readonly " $data"?: TypenameOutside$data, + readonly " $fragmentRefs": FragmentRefs<"TypenameOutside">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type TypenameOutsideWithAbstractType = ({ + readonly __typename: "User", + readonly firstName: string | null, + readonly address: { + readonly street: string | null, + readonly city: string | null, + } | null, +} | { + readonly __typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" +}) & { + readonly username?: string | null, + readonly address?: { + readonly city: string | null, + readonly country: string | null, + } | null, + readonly " $refType": FragmentRefs<"TypenameOutsideWithAbstractType">, +}; +export type TypenameOutsideWithAbstractType$data = TypenameOutsideWithAbstractType; +export type TypenameOutsideWithAbstractType$key = { + readonly " $data"?: TypenameOutsideWithAbstractType$data, + readonly " $fragmentRefs": FragmentRefs<"TypenameOutsideWithAbstractType">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type TypenameWithCommonSelections = ({ + readonly __typename: "User", + readonly firstName: string | null, +} | { + readonly __typename: "Page", + readonly username: string | null, +}) & { + readonly name: string | null, + readonly " $refType": FragmentRefs<"TypenameWithCommonSelections">, +}; +export type TypenameWithCommonSelections$data = TypenameWithCommonSelections; +export type TypenameWithCommonSelections$key = { + readonly " $data"?: TypenameWithCommonSelections$data, + readonly " $fragmentRefs": FragmentRefs<"TypenameWithCommonSelections">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type TypenameWithoutSpreads = { + readonly __typename: "User", + readonly firstName: string | null, + readonly " $refType": FragmentRefs<"TypenameWithoutSpreads">, +}; +export type TypenameWithoutSpreads$data = TypenameWithoutSpreads; +export type TypenameWithoutSpreads$key = { + readonly " $data"?: TypenameWithoutSpreads$data, + readonly " $fragmentRefs": FragmentRefs<"TypenameWithoutSpreads">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type TypenameWithoutSpreadsAbstractType = { + readonly __typename: string, + readonly id: string, + readonly " $refType": FragmentRefs<"TypenameWithoutSpreadsAbstractType">, +}; +export type TypenameWithoutSpreadsAbstractType$data = TypenameWithoutSpreadsAbstractType; +export type TypenameWithoutSpreadsAbstractType$key = { + readonly " $data"?: TypenameWithoutSpreadsAbstractType$data, + readonly " $fragmentRefs": FragmentRefs<"TypenameWithoutSpreadsAbstractType">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + import { FragmentRefs } from "relay-runtime"; -export type TypenameAlias = { +export type TypenameAlias = ({ + readonly _typeAlias: "User", + readonly firstName: string | null, +} | { + readonly _typeAlias: "Page", + readonly username: string | null, +}) & { + readonly " $refType": FragmentRefs<"TypenameAlias"> +}; +export type TypenameAlias$data = TypenameAlias; +export type TypenameAlias$key = { + readonly " $data"?: TypenameAlias$data, + readonly " $fragmentRefs": FragmentRefs<"TypenameAlias">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type TypenameAliases = ({ + readonly _typeAlias1: "User", + readonly _typeAlias2: "User", + readonly firstName: string | null, +} | { + readonly _typeAlias1: "Page", + readonly _typeAlias2: "Page", + readonly username: string | null, +}) & { + readonly " $refType": FragmentRefs<"TypenameAliases"> +}; +export type TypenameAliases$data = TypenameAliases; +export type TypenameAliases$key = { + readonly " $data"?: TypenameAliases$data, + readonly " $fragmentRefs": FragmentRefs<"TypenameAliases">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type TypenameInside = ({ + readonly __typename: "User", + readonly firstName: string | null, +} | { + readonly __typename: "Page", + readonly username: string | null, +}) & { + readonly " $refType": FragmentRefs<"TypenameInside"> +}; +export type TypenameInside$data = TypenameInside; +export type TypenameInside$key = { + readonly " $data"?: TypenameInside$data, + readonly " $fragmentRefs": FragmentRefs<"TypenameInside">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type TypenameOutside = ({ + readonly __typename: "User", + readonly firstName: string | null, +} | { + readonly __typename: "Page", + readonly username: string | null, +}) & { + readonly " $refType": FragmentRefs<"TypenameOutside"> +}; +export type TypenameOutside$data = TypenameOutside; +export type TypenameOutside$key = { + readonly " $data"?: TypenameOutside$data, + readonly " $fragmentRefs": FragmentRefs<"TypenameOutside">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type TypenameOutsideWithAbstractType = ({ + readonly __typename: "User", + readonly firstName: string | null, + readonly address: { + readonly street: string | null, + readonly city: string | null, + } | null, +} | { + readonly __typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" +}) & { + readonly username?: string | null, + readonly address?: { + readonly city: string | null, + readonly country: string | null, + } | null, + readonly " $refType": FragmentRefs<"TypenameOutsideWithAbstractType">, +}; +export type TypenameOutsideWithAbstractType$data = TypenameOutsideWithAbstractType; +export type TypenameOutsideWithAbstractType$key = { + readonly " $data"?: TypenameOutsideWithAbstractType$data, + readonly " $fragmentRefs": FragmentRefs<"TypenameOutsideWithAbstractType">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type TypenameWithCommonSelections = ({ + readonly __typename: "User", + readonly firstName: string | null, +} | { + readonly __typename: "Page", + readonly username: string | null, +}) & { + readonly name: string | null, + readonly " $refType": FragmentRefs<"TypenameWithCommonSelections">, +}; +export type TypenameWithCommonSelections$data = TypenameWithCommonSelections; +export type TypenameWithCommonSelections$key = { + readonly " $data"?: TypenameWithCommonSelections$data, + readonly " $fragmentRefs": FragmentRefs<"TypenameWithCommonSelections">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type TypenameWithoutSpreads = { + readonly __typename: "User", + readonly firstName: string | null, + readonly " $refType": FragmentRefs<"TypenameWithoutSpreads">, +}; +export type TypenameWithoutSpreads$data = TypenameWithoutSpreads; +export type TypenameWithoutSpreads$key = { + readonly " $data"?: TypenameWithoutSpreads$data, + readonly " $fragmentRefs": FragmentRefs<"TypenameWithoutSpreads">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type TypenameWithoutSpreadsAbstractType = { + readonly __typename: string, + readonly id: string, + readonly " $refType": FragmentRefs<"TypenameWithoutSpreadsAbstractType">, +}; +export type TypenameWithoutSpreadsAbstractType$data = TypenameWithoutSpreadsAbstractType; +export type TypenameWithoutSpreadsAbstractType$key = { + readonly " $data"?: TypenameWithoutSpreadsAbstractType$data, + readonly " $fragmentRefs": FragmentRefs<"TypenameWithoutSpreadsAbstractType">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import { FragmentRefs } from "relay-runtime"; +export type TypenameAlias = ({ readonly _typeAlias: "User", readonly firstName: string | null, - readonly " $refType": FragmentRefs<"TypenameAlias">, } | { readonly _typeAlias: "Page", readonly username: string | null, - readonly " $refType": FragmentRefs<"TypenameAlias">, } | { // This will never be '%other', but we need some // value in case none of the concrete values match. - readonly _typeAlias: "%other", - readonly " $refType": FragmentRefs<"TypenameAlias">, + readonly _typeAlias: "%other" +}) & { + readonly " $refType": FragmentRefs<"TypenameAlias"> }; export type TypenameAlias$data = TypenameAlias; export type TypenameAlias$key = { @@ -102,16 +378,14 @@ export type TypenameAlias$key = { }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type TypenameAliases = { +export type TypenameAliases = ({ readonly _typeAlias1: "User", readonly _typeAlias2: "User", readonly firstName: string | null, - readonly " $refType": FragmentRefs<"TypenameAliases">, } | { readonly _typeAlias1: "Page", readonly _typeAlias2: "Page", readonly username: string | null, - readonly " $refType": FragmentRefs<"TypenameAliases">, } | { // This will never be '%other', but we need some // value in case none of the concrete values match. @@ -119,7 +393,8 @@ export type TypenameAliases = { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly _typeAlias2: "%other", - readonly " $refType": FragmentRefs<"TypenameAliases">, +}) & { + readonly " $refType": FragmentRefs<"TypenameAliases"> }; export type TypenameAliases$data = TypenameAliases; export type TypenameAliases$key = { @@ -128,19 +403,18 @@ export type TypenameAliases$key = { }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type TypenameInside = { +export type TypenameInside = ({ readonly __typename: "User", readonly firstName: string | null, - readonly " $refType": FragmentRefs<"TypenameInside">, } | { readonly __typename: "Page", readonly username: string | null, - readonly " $refType": FragmentRefs<"TypenameInside">, } | { // This will never be '%other', but we need some // value in case none of the concrete values match. - readonly __typename: "%other", - readonly " $refType": FragmentRefs<"TypenameInside">, + readonly __typename: "%other" +}) & { + readonly " $refType": FragmentRefs<"TypenameInside"> }; export type TypenameInside$data = TypenameInside; export type TypenameInside$key = { @@ -149,19 +423,18 @@ export type TypenameInside$key = { }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type TypenameOutside = { +export type TypenameOutside = ({ readonly __typename: "User", readonly firstName: string | null, - readonly " $refType": FragmentRefs<"TypenameOutside">, } | { readonly __typename: "Page", readonly username: string | null, - readonly " $refType": FragmentRefs<"TypenameOutside">, } | { // This will never be '%other', but we need some // value in case none of the concrete values match. - readonly __typename: "%other", - readonly " $refType": FragmentRefs<"TypenameOutside">, + readonly __typename: "%other" +}) & { + readonly " $refType": FragmentRefs<"TypenameOutside"> }; export type TypenameOutside$data = TypenameOutside; export type TypenameOutside$key = { @@ -170,15 +443,23 @@ export type TypenameOutside$key = { }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type TypenameOutsideWithAbstractType = { - readonly __typename: string, +export type TypenameOutsideWithAbstractType = ({ + readonly __typename: "User", + readonly firstName: string | null, + readonly address: { + readonly street: string | null, + readonly city: string | null, + } | null, +} | { + // This will never be '%other', but we need some + // value in case none of the concrete values match. + readonly __typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" | "%other" +}) & { readonly username?: string | null, readonly address?: { readonly city: string | null, readonly country: string | null, - readonly street?: string | null, } | null, - readonly firstName?: string | null, readonly " $refType": FragmentRefs<"TypenameOutsideWithAbstractType">, }; export type TypenameOutsideWithAbstractType$data = TypenameOutsideWithAbstractType; @@ -188,11 +469,18 @@ export type TypenameOutsideWithAbstractType$key = { }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type TypenameWithCommonSelections = { - readonly __typename: string, +export type TypenameWithCommonSelections = ({ + readonly __typename: "User", + readonly firstName: string | null, +} | { + readonly __typename: "Page", + readonly username: string | null, +} | { + // This will never be '%other', but we need some + // value in case none of the concrete values match. + readonly __typename: "%other" +}) & { readonly name: string | null, - readonly firstName?: string | null, - readonly username?: string | null, readonly " $refType": FragmentRefs<"TypenameWithCommonSelections">, }; export type TypenameWithCommonSelections$data = TypenameWithCommonSelections; @@ -203,8 +491,169 @@ export type TypenameWithCommonSelections$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type TypenameWithoutSpreads = { + readonly __typename: "User", readonly firstName: string | null, + readonly " $refType": FragmentRefs<"TypenameWithoutSpreads">, +}; +export type TypenameWithoutSpreads$data = TypenameWithoutSpreads; +export type TypenameWithoutSpreads$key = { + readonly " $data"?: TypenameWithoutSpreads$data, + readonly " $fragmentRefs": FragmentRefs<"TypenameWithoutSpreads">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type TypenameWithoutSpreadsAbstractType = { + readonly __typename: string, + readonly id: string, + readonly " $refType": FragmentRefs<"TypenameWithoutSpreadsAbstractType">, +}; +export type TypenameWithoutSpreadsAbstractType$data = TypenameWithoutSpreadsAbstractType; +export type TypenameWithoutSpreadsAbstractType$key = { + readonly " $data"?: TypenameWithoutSpreadsAbstractType$data, + readonly " $fragmentRefs": FragmentRefs<"TypenameWithoutSpreadsAbstractType">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + +import { FragmentRefs } from "relay-runtime"; +export type TypenameAlias = ({ + readonly _typeAlias: "User", + readonly firstName: string | null, +} | { + readonly _typeAlias: "Page", + readonly username: string | null, +} | { + // This will never be '%other', but we need some + // value in case none of the concrete values match. + readonly _typeAlias: "%other" +}) & { + readonly " $refType": FragmentRefs<"TypenameAlias"> +}; +export type TypenameAlias$data = TypenameAlias; +export type TypenameAlias$key = { + readonly " $data"?: TypenameAlias$data, + readonly " $fragmentRefs": FragmentRefs<"TypenameAlias">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type TypenameAliases = ({ + readonly _typeAlias1: "User", + readonly _typeAlias2: "User", + readonly firstName: string | null, +} | { + readonly _typeAlias1: "Page", + readonly _typeAlias2: "Page", + readonly username: string | null, +} | { + // This will never be '%other', but we need some + // value in case none of the concrete values match. + readonly _typeAlias1: "%other", + // This will never be '%other', but we need some + // value in case none of the concrete values match. + readonly _typeAlias2: "%other", +}) & { + readonly " $refType": FragmentRefs<"TypenameAliases"> +}; +export type TypenameAliases$data = TypenameAliases; +export type TypenameAliases$key = { + readonly " $data"?: TypenameAliases$data, + readonly " $fragmentRefs": FragmentRefs<"TypenameAliases">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type TypenameInside = ({ + readonly __typename: "User", + readonly firstName: string | null, +} | { + readonly __typename: "Page", + readonly username: string | null, +} | { + // This will never be '%other', but we need some + // value in case none of the concrete values match. + readonly __typename: "%other" +}) & { + readonly " $refType": FragmentRefs<"TypenameInside"> +}; +export type TypenameInside$data = TypenameInside; +export type TypenameInside$key = { + readonly " $data"?: TypenameInside$data, + readonly " $fragmentRefs": FragmentRefs<"TypenameInside">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type TypenameOutside = ({ + readonly __typename: "User", + readonly firstName: string | null, +} | { + readonly __typename: "Page", + readonly username: string | null, +} | { + // This will never be '%other', but we need some + // value in case none of the concrete values match. + readonly __typename: "%other" +}) & { + readonly " $refType": FragmentRefs<"TypenameOutside"> +}; +export type TypenameOutside$data = TypenameOutside; +export type TypenameOutside$key = { + readonly " $data"?: TypenameOutside$data, + readonly " $fragmentRefs": FragmentRefs<"TypenameOutside">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type TypenameOutsideWithAbstractType = ({ readonly __typename: "User", + readonly firstName: string | null, + readonly address: { + readonly street: string | null, + readonly city: string | null, + } | null, +} | { + // This will never be '%other', but we need some + // value in case none of the concrete values match. + readonly __typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" | "%other" +}) & { + readonly username?: string | null, + readonly address?: { + readonly city: string | null, + readonly country: string | null, + } | null, + readonly " $refType": FragmentRefs<"TypenameOutsideWithAbstractType">, +}; +export type TypenameOutsideWithAbstractType$data = TypenameOutsideWithAbstractType; +export type TypenameOutsideWithAbstractType$key = { + readonly " $data"?: TypenameOutsideWithAbstractType$data, + readonly " $fragmentRefs": FragmentRefs<"TypenameOutsideWithAbstractType">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type TypenameWithCommonSelections = ({ + readonly __typename: "User", + readonly firstName: string | null, +} | { + readonly __typename: "Page", + readonly username: string | null, +} | { + // This will never be '%other', but we need some + // value in case none of the concrete values match. + readonly __typename: "%other" +}) & { + readonly name: string | null, + readonly " $refType": FragmentRefs<"TypenameWithCommonSelections">, +}; +export type TypenameWithCommonSelections$data = TypenameWithCommonSelections; +export type TypenameWithCommonSelections$key = { + readonly " $data"?: TypenameWithCommonSelections$data, + readonly " $fragmentRefs": FragmentRefs<"TypenameWithCommonSelections">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type TypenameWithoutSpreads = { + readonly __typename: "User", + readonly firstName: string | null, readonly " $refType": FragmentRefs<"TypenameWithoutSpreads">, }; export type TypenameWithoutSpreads$data = TypenameWithoutSpreads; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected index f6ec1b48338e3..8fcbfcbd06506 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected @@ -26,6 +26,179 @@ fragment AnotherRecursiveFragment on Image { height } ==================================== OUTPUT =================================== +/* + * future proof enums: false + * future proof abstract types: false + */ + +import { FragmentRefs } from "relay-runtime"; +export type AnotherRecursiveFragment = { + readonly uri: string | null, + readonly height: number | null, + readonly " $refType": FragmentRefs<"AnotherRecursiveFragment">, +}; +export type AnotherRecursiveFragment$data = AnotherRecursiveFragment; +export type AnotherRecursiveFragment$key = { + readonly " $data"?: AnotherRecursiveFragment$data, + readonly " $fragmentRefs": FragmentRefs<"AnotherRecursiveFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type PhotoFragment = { + readonly uri: string | null, + readonly width: number | null, + readonly " $refType": FragmentRefs<"PhotoFragment">, +}; +export type PhotoFragment$data = PhotoFragment; +export type PhotoFragment$key = { + readonly " $data"?: PhotoFragment$data, + readonly " $fragmentRefs": FragmentRefs<"PhotoFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type RecursiveFragment = { + readonly uri: string | null, + readonly width: number | null, +}; +export type RecursiveFragment$data = RecursiveFragment; +export type RecursiveFragment$key = { + readonly " $data"?: RecursiveFragment$data, + readonly " $fragmentRefs": FragmentRefs<"RecursiveFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type UserProfile = { + readonly profilePicture: { + readonly uri: string | null, + readonly width: number | null, + readonly height: number | null, + readonly " $fragmentRefs": FragmentRefs<"PhotoFragment">, + } | null, + readonly " $refType": FragmentRefs<"UserProfile">, +}; +export type UserProfile$data = UserProfile; +export type UserProfile$key = { + readonly " $data"?: UserProfile$data, + readonly " $fragmentRefs": FragmentRefs<"UserProfile">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: false + */ + +import { FragmentRefs } from "relay-runtime"; +export type AnotherRecursiveFragment = { + readonly uri: string | null, + readonly height: number | null, + readonly " $refType": FragmentRefs<"AnotherRecursiveFragment">, +}; +export type AnotherRecursiveFragment$data = AnotherRecursiveFragment; +export type AnotherRecursiveFragment$key = { + readonly " $data"?: AnotherRecursiveFragment$data, + readonly " $fragmentRefs": FragmentRefs<"AnotherRecursiveFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type PhotoFragment = { + readonly uri: string | null, + readonly width: number | null, + readonly " $refType": FragmentRefs<"PhotoFragment">, +}; +export type PhotoFragment$data = PhotoFragment; +export type PhotoFragment$key = { + readonly " $data"?: PhotoFragment$data, + readonly " $fragmentRefs": FragmentRefs<"PhotoFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type RecursiveFragment = { + readonly uri: string | null, + readonly width: number | null, +}; +export type RecursiveFragment$data = RecursiveFragment; +export type RecursiveFragment$key = { + readonly " $data"?: RecursiveFragment$data, + readonly " $fragmentRefs": FragmentRefs<"RecursiveFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type UserProfile = { + readonly profilePicture: { + readonly uri: string | null, + readonly width: number | null, + readonly height: number | null, + readonly " $fragmentRefs": FragmentRefs<"PhotoFragment">, + } | null, + readonly " $refType": FragmentRefs<"UserProfile">, +}; +export type UserProfile$data = UserProfile; +export type UserProfile$key = { + readonly " $data"?: UserProfile$data, + readonly " $fragmentRefs": FragmentRefs<"UserProfile">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: false + * future proof abstract types: true + */ + +import { FragmentRefs } from "relay-runtime"; +export type AnotherRecursiveFragment = { + readonly uri: string | null, + readonly height: number | null, + readonly " $refType": FragmentRefs<"AnotherRecursiveFragment">, +}; +export type AnotherRecursiveFragment$data = AnotherRecursiveFragment; +export type AnotherRecursiveFragment$key = { + readonly " $data"?: AnotherRecursiveFragment$data, + readonly " $fragmentRefs": FragmentRefs<"AnotherRecursiveFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type PhotoFragment = { + readonly uri: string | null, + readonly width: number | null, + readonly " $refType": FragmentRefs<"PhotoFragment">, +}; +export type PhotoFragment$data = PhotoFragment; +export type PhotoFragment$key = { + readonly " $data"?: PhotoFragment$data, + readonly " $fragmentRefs": FragmentRefs<"PhotoFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type RecursiveFragment = { + readonly uri: string | null, + readonly width: number | null, +}; +export type RecursiveFragment$data = RecursiveFragment; +export type RecursiveFragment$key = { + readonly " $data"?: RecursiveFragment$data, + readonly " $fragmentRefs": FragmentRefs<"RecursiveFragment">, +}; +------------------------------------------------------------------------------- +import { FragmentRefs } from "relay-runtime"; +export type UserProfile = { + readonly profilePicture: { + readonly uri: string | null, + readonly width: number | null, + readonly height: number | null, + readonly " $fragmentRefs": FragmentRefs<"PhotoFragment">, + } | null, + readonly " $refType": FragmentRefs<"UserProfile">, +}; +export type UserProfile$data = UserProfile; +export type UserProfile$key = { + readonly " $data"?: UserProfile$data, + readonly " $fragmentRefs": FragmentRefs<"UserProfile">, +}; +------------------------------------------------------------------------------- +/* + * future proof enums: true + * future proof abstract types: true + */ + import { FragmentRefs } from "relay-runtime"; export type AnotherRecursiveFragment = { readonly uri: string | null, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/mod.rs b/compiler/crates/relay-typegen/tests/generate_typescript/mod.rs index 8bf1af96878d2..8aae8825514fa 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/mod.rs +++ b/compiler/crates/relay-typegen/tests/generate_typescript/mod.rs @@ -45,35 +45,51 @@ pub fn transform_fixture(fixture: &Fixture<'_>) -> Result { ) .unwrap(); - let typegen_config = TypegenConfig { - language: TypegenLanguage::TypeScript, - haste: true, - ..Default::default() - }; + let separator = + "-------------------------------------------------------------------------------\n"; + Ok(vec![false, false, true, false, false, true, true, true] + .chunks(2) + .map(|bools| (bools[0], bools[1])) + .map(|(future_proof_enums, future_proof_abstract_types)| { + let typegen_config = TypegenConfig { + language: TypegenLanguage::TypeScript, + haste: true, + future_proof_abstract_types, + future_proof_enums, + ..Default::default() + }; + + let mut operations: Vec<_> = programs.typegen.operations().collect(); + operations.sort_by_key(|op| op.name.item); + let operation_strings = operations.into_iter().map(|typegen_operation| { + let normalization_operation = programs + .normalization + .operation(typegen_operation.name.item) + .unwrap(); + relay_typegen::generate_operation_type( + typegen_operation, + normalization_operation, + &schema, + &typegen_config, + ) + }); - let mut operations: Vec<_> = programs.typegen.operations().collect(); - operations.sort_by_key(|op| op.name.item); - let operation_strings = operations.into_iter().map(|typegen_operation| { - let normalization_operation = programs - .normalization - .operation(typegen_operation.name.item) - .unwrap(); - relay_typegen::generate_operation_type( - typegen_operation, - normalization_operation, - &schema, - &typegen_config, - ) - }); + let mut fragments: Vec<_> = programs.typegen.fragments().collect(); + fragments.sort_by_key(|frag| frag.name.item); + let fragment_strings = fragments + .into_iter() + .map(|frag| relay_typegen::generate_fragment_type(frag, &schema, &typegen_config)); - let mut fragments: Vec<_> = programs.typegen.fragments().collect(); - fragments.sort_by_key(|frag| frag.name.item); - let fragment_strings = fragments - .into_iter() - .map(|frag| relay_typegen::generate_fragment_type(frag, &schema, &typegen_config)); + let mut result: Vec = operation_strings.collect(); + result.extend(fragment_strings); - let mut result: Vec = operation_strings.collect(); - result.extend(fragment_strings); - Ok(result - .join("-------------------------------------------------------------------------------\n")) + format!( + "/*\n * future proof enums: {}\n * future proof abstract types: {}\n */\n\n{}", + future_proof_enums, + future_proof_abstract_types, + result.join(separator) + ) + }) + .collect::>() + .join(separator)) } From 69e281162e131d78645cbd40dc9ffbbdc463651c Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Sun, 27 Dec 2020 15:40:34 +0100 Subject: [PATCH 18/41] s/babel/ast --- compiler/crates/relay-typegen/src/lib.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/compiler/crates/relay-typegen/src/lib.rs b/compiler/crates/relay-typegen/src/lib.rs index 18ba94f8ea1e0..8700f63d6f3eb 100644 --- a/compiler/crates/relay-typegen/src/lib.rs +++ b/compiler/crates/relay-typegen/src/lib.rs @@ -150,7 +150,7 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { let selections = self.visit_selections(&typegen_operation.selections); let mut response_type = - self.selections_to_babel(Some(typegen_operation.type_), selections, false, None); + self.selections_to_ast(Some(typegen_operation.type_), selections, false, None); response_type = match typegen_operation .directives @@ -163,7 +163,7 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { let raw_response_type = if has_raw_response_type_directive(normalization_operation) { let raw_response_selections = self.raw_response_visit_selections(&normalization_operation.selections); - Some(self.raw_response_selections_to_babel(raw_response_selections, None)) + Some(self.raw_response_selections_to_ast(raw_response_selections, None)) } else { None }; @@ -286,7 +286,7 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { let unmasked = RelayDirective::is_unmasked_fragment_definition(&node); - let base_type = self.selections_to_babel( + let base_type = self.selections_to_ast( Some(node.type_condition), selections, unmasked, @@ -518,7 +518,7 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { */ if !self.match_fields.contains_key(&directive_arg_name) { - let match_field = self.raw_response_selections_to_babel( + let match_field = self.raw_response_selections_to_ast( selections .iter() .cloned() @@ -620,7 +620,7 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { type_selections.append(&mut selections); } - fn selections_to_babel( + fn selections_to_ast( &mut self, node_type: Option, selections: Vec, @@ -881,7 +881,7 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { } } - fn raw_response_selections_to_babel( + fn raw_response_selections_to_ast( &mut self, selections: Vec, concrete_type: Option, @@ -979,7 +979,7 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { .. } = type_selection; let value = if let Some(node_type) = node_type { - let object_props = self.selections_to_babel( + let object_props = self.selections_to_ast( Some(node_type.inner()), hashmap_into_value_vec(node_selections.unwrap()), unmasked, @@ -1046,7 +1046,7 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { } else { Some(node_type.inner()) }; - let object_props = self.raw_response_selections_to_babel( + let object_props = self.raw_response_selections_to_ast( hashmap_into_value_vec(node_selections.unwrap()), inner_concrete_type, ); From 8d191169bfd3f69a14a147f1971ed24bae36ca6c Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Sun, 27 Dec 2020 16:11:54 +0100 Subject: [PATCH 19/41] Fix incorrect merge/rebase: don't use intermediate String for writing AST. --- compiler/crates/relay-typegen/src/flow.rs | 34 +++++----- compiler/crates/relay-typegen/src/lib.rs | 9 +-- .../crates/relay-typegen/src/typescript.rs | 62 ++++++++++--------- compiler/crates/relay-typegen/src/writer.rs | 3 +- 4 files changed, 53 insertions(+), 55 deletions(-) diff --git a/compiler/crates/relay-typegen/src/flow.rs b/compiler/crates/relay-typegen/src/flow.rs index 5e5657159aa9e..81ad328f268b0 100644 --- a/compiler/crates/relay-typegen/src/flow.rs +++ b/compiler/crates/relay-typegen/src/flow.rs @@ -14,20 +14,6 @@ pub struct FlowPrinter { } impl Writer for FlowPrinter { - fn write_ast(&mut self, ast: &AST) -> String { - let mut writer = String::new(); - self.write(&mut writer, ast) - .expect("Expected Ok result from writing Flow code"); - - writer - } -} - -impl FlowPrinter { - pub fn new() -> Self { - Self { indentation: 0 } - } - fn write(&mut self, writer: &mut dyn Write, ast: &AST) -> Result { match ast { AST::Any => write!(writer, "any"), @@ -75,6 +61,12 @@ impl FlowPrinter { ), } } +} + +impl FlowPrinter { + pub fn new() -> Self { + Self { indentation: 0 } + } fn write_indentation(&mut self, writer: &mut dyn Write) -> Result { writer.write_str(&" ".repeat(self.indentation)) @@ -225,7 +217,7 @@ impl FlowPrinter { types: &[StringKey], from: &StringKey, ) -> Result { - write!( + writeln!( writer, "import type {{ {} }} from \"{}\";", types @@ -243,7 +235,7 @@ impl FlowPrinter { alias: &StringKey, value: &StringKey, ) -> Result { - write!(writer, "declare export opaque type {}: {};", alias, value) + writeln!(writer, "declare export opaque type {}: {};", alias, value) } fn write_export_type_equals( @@ -252,7 +244,9 @@ impl FlowPrinter { name: &StringKey, value: &AST, ) -> Result { - write!(writer, "export type {} = {};", name, self.write_ast(value)) + write!(writer, "export type {} = ", name)?; + self.write(writer, value)?; + writeln!(writer, ";") } fn write_type_definition( @@ -261,11 +255,13 @@ impl FlowPrinter { name: &StringKey, value: &AST, ) -> Result { - write!(writer, "type {} = {};", name, self.write_ast(value)) + write!(writer, "type {} = ", name)?; + self.write(writer, value)?; + writeln!(writer, ";") } fn write_export_list(&mut self, writer: &mut dyn Write, names: &[StringKey]) -> Result { - write!( + writeln!( writer, "export type {{ {} }};", names diff --git a/compiler/crates/relay-typegen/src/lib.rs b/compiler/crates/relay-typegen/src/lib.rs index 8700f63d6f3eb..1f2cd6f9113f9 100644 --- a/compiler/crates/relay-typegen/src/lib.rs +++ b/compiler/crates/relay-typegen/src/lib.rs @@ -33,7 +33,7 @@ use relay_transforms::{ REQUIRED_METADATA_KEY, }; use schema::{EnumID, Object, ScalarID, Schema, Type, TypeReference, Union}; -use std::fmt::{Result, Write}; +use std::fmt::Result; use std::hash::Hash; use writer::{Prop, AST, SPREAD_KEY}; @@ -59,12 +59,7 @@ lazy_static! { macro_rules! write_ast { ($self:ident, $ast:expr) => {{ - let output = $self.writer.write_ast(&$ast); - if output.is_empty() { - Ok(()) - } else { - ::std::writeln!($self.result, "{}", output) - } + $self.writer.write(&mut $self.result, &$ast) }}; } diff --git a/compiler/crates/relay-typegen/src/typescript.rs b/compiler/crates/relay-typegen/src/typescript.rs index c19eeee1d48db..61b98edb99771 100644 --- a/compiler/crates/relay-typegen/src/typescript.rs +++ b/compiler/crates/relay-typegen/src/typescript.rs @@ -21,23 +21,6 @@ impl Writer for TypeScriptPrinter { "FragmentRefs".intern() } - fn write_ast(&mut self, ast: &AST) -> String { - let mut writer = String::new(); - self.write(&mut writer, ast) - .expect("Expected Ok result from writing TypeScript code"); - - writer - } -} - -impl TypeScriptPrinter { - pub fn new(config: &TypegenConfig) -> Self { - Self { - indentation: 0, - use_import_type_syntax: config.use_import_type_syntax, - } - } - fn write(&mut self, writer: &mut dyn Write, ast: &AST) -> Result { match ast { AST::Any => write!(writer, "any"), @@ -70,6 +53,15 @@ impl TypeScriptPrinter { AST::ImportFragmentType(_, _) => Ok(()), } } +} + +impl TypeScriptPrinter { + pub fn new(config: &TypegenConfig) -> Self { + Self { + indentation: 0, + use_import_type_syntax: config.use_import_type_syntax, + } + } fn write_indentation(&mut self, writer: &mut dyn Write) -> Result { writer.write_str(&" ".repeat(self.indentation)) @@ -246,7 +238,7 @@ impl TypeScriptPrinter { types: &[StringKey], from: &StringKey, ) -> Result { - write!( + writeln!( writer, "import {}{{ {} }} from \"{}\";", if self.use_import_type_syntax { @@ -269,7 +261,9 @@ impl TypeScriptPrinter { name: &StringKey, value: &AST, ) -> Result { - write!(writer, "type {} = {};", name, self.write_ast(value)) + write!(writer, "type {} = ", name)?; + self.write(writer, value)?; + writeln!(writer, ";") } fn write_export_type_equals( @@ -278,7 +272,9 @@ impl TypeScriptPrinter { name: &StringKey, value: &AST, ) -> Result { - write!(writer, "export type {} = {};", name, self.write_ast(value)) + write!(writer, "export type {} = ", name)?; + self.write(writer, value)?; + writeln!(writer, ";") } } @@ -288,7 +284,15 @@ mod tests { use interner::Intern; fn print_type(ast: &AST) -> String { - TypeScriptPrinter::new(&Default::default()).write_ast(ast) + print_type_with_config(ast, &Default::default()) + } + + fn print_type_with_config(ast: &AST, config: &TypegenConfig) -> String { + let mut result = String::new(); + TypeScriptPrinter::new(config) + .write(&mut result, ast) + .unwrap(); + result } #[test] @@ -535,16 +539,18 @@ mod tests { vec!["A".intern(), "B".intern()], "module".intern() )), - "import { A, B } from \"module\";" + "import { A, B } from \"module\";\n" ); assert_eq!( - TypeScriptPrinter::new(&TypegenConfig { - use_import_type_syntax: true, - ..Default::default() - }) - .write_ast(&AST::ImportType(vec!["C".intern()], "./foo".intern())), - "import type { C } from \"./foo\";" + self::print_type_with_config( + &AST::ImportType(vec!["C".intern()], "./foo".intern()), + &TypegenConfig { + use_import_type_syntax: true, + ..Default::default() + } + ), + "import type { C } from \"./foo\";\n" ); } } diff --git a/compiler/crates/relay-typegen/src/writer.rs b/compiler/crates/relay-typegen/src/writer.rs index 44b5151fb0236..f111f685acbe9 100644 --- a/compiler/crates/relay-typegen/src/writer.rs +++ b/compiler/crates/relay-typegen/src/writer.rs @@ -7,6 +7,7 @@ use interner::{Intern, StringKey}; use lazy_static::lazy_static; +use std::fmt::{Result, Write}; #[derive(Debug, Clone)] pub enum AST { @@ -68,5 +69,5 @@ pub trait Writer { "FragmentReference".intern() } - fn write_ast(&mut self, ast: &AST) -> String; + fn write(&mut self, writer: &mut dyn Write, ast: &AST) -> Result; } From 455d3deddcd7acff0511958d2d2a86d9d20ac310 Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Sun, 27 Dec 2020 16:43:56 +0100 Subject: [PATCH 20/41] Wrap nullable intersections in parentheses as well as unions. --- compiler/crates/relay-typegen/src/flow.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/crates/relay-typegen/src/flow.rs b/compiler/crates/relay-typegen/src/flow.rs index 81ad328f268b0..1f0f1c17c2bd9 100644 --- a/compiler/crates/relay-typegen/src/flow.rs +++ b/compiler/crates/relay-typegen/src/flow.rs @@ -115,7 +115,7 @@ impl FlowPrinter { fn write_nullable(&mut self, writer: &mut dyn Write, of_type: &AST) -> Result { write!(writer, "?")?; match of_type { - AST::Union(members) if members.len() > 1 => { + AST::Union(members) | AST::Intersection(members) if members.len() > 1 => { write!(writer, "(")?; self.write(writer, of_type)?; write!(writer, ")")?; From c28af7b40f5cda9dd6755658b073c5fe114f54c5 Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Sun, 27 Dec 2020 16:46:18 +0100 Subject: [PATCH 21/41] Prevent intersections of exact objects, which would not make sense. --- compiler/crates/relay-typegen/src/lib.rs | 17 ++- .../crates/relay-typegen/src/typescript.rs | 4 + compiler/crates/relay-typegen/src/writer.rs | 4 + .../fixtures/relay-client-id-field.expected | 76 +++++----- ...ough-inline-fragments-to-fragment.expected | 40 ++--- ...solates-concrete-inline-fragments.expected | 44 +++--- .../fixtures/typename-on-union.expected | 140 +++++++++++------- 7 files changed, 194 insertions(+), 131 deletions(-) diff --git a/compiler/crates/relay-typegen/src/lib.rs b/compiler/crates/relay-typegen/src/lib.rs index 1f2cd6f9113f9..a1236943626be 100644 --- a/compiler/crates/relay-typegen/src/lib.rs +++ b/compiler/crates/relay-typegen/src/lib.rs @@ -863,14 +863,25 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { }; let base_type_props_not_empty = !base_type_props.is_empty(); - let base_type = props_to_object(base_type_props); if concrete_types.is_empty() { - return base_type; + return props_to_object(base_type_props); + } + + if base_type_props_not_empty && self.writer.supports_exact_objects() { + return AST::Union( + concrete_types + .into_iter() + .map(|mut props: Vec| { + props.extend(base_type_props.iter().cloned()); + props_to_object(props) + }) + .collect(), + ); } let union_type = AST::Union(concrete_types.into_iter().map(props_to_object).collect()); if base_type_props_not_empty { - AST::Intersection(vec![union_type, base_type]) + AST::Intersection(vec![union_type, props_to_object(base_type_props)]) } else { union_type } diff --git a/compiler/crates/relay-typegen/src/typescript.rs b/compiler/crates/relay-typegen/src/typescript.rs index 61b98edb99771..1900757f0f1c8 100644 --- a/compiler/crates/relay-typegen/src/typescript.rs +++ b/compiler/crates/relay-typegen/src/typescript.rs @@ -21,6 +21,10 @@ impl Writer for TypeScriptPrinter { "FragmentRefs".intern() } + fn supports_exact_objects(&self) -> bool { + false + } + fn write(&mut self, writer: &mut dyn Write, ast: &AST) -> Result { match ast { AST::Any => write!(writer, "any"), diff --git a/compiler/crates/relay-typegen/src/writer.rs b/compiler/crates/relay-typegen/src/writer.rs index f111f685acbe9..b87a38e9d4f52 100644 --- a/compiler/crates/relay-typegen/src/writer.rs +++ b/compiler/crates/relay-typegen/src/writer.rs @@ -69,5 +69,9 @@ pub trait Writer { "FragmentReference".intern() } + fn supports_exact_objects(&self) -> bool { + true + } + fn write(&mut self, writer: &mut dyn Write, ast: &AST) -> Result; } diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.expected index b537d2fb5a774..3785caf0e58cf 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.expected @@ -42,9 +42,9 @@ export type RelayClientIDFieldQueryResponse = {| +__typename: string, +id: string, |}, - +node: ?{| + +node: ?({| +__typename: "Comment", - +commentBody: ?{| + +commentBody: ?({| +__typename: "PlainCommentBody", +__id: string, +text: ?{| @@ -52,17 +52,18 @@ export type RelayClientIDFieldQueryResponse = {| +__typename: string, +text: ?string, |}, + +__id: string, |} | {| - +__typename: "MarkdownCommentBody" - |} & {| - +__id: string - |}, + +__typename: "MarkdownCommentBody", + +__id: string, + |}), + +__id: string, + +id: string, |} | {| - +__typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "User" - |} & {| + +__typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "User", +__id: string, +id: string, - |}, + |}), |}; export type RelayClientIDFieldQuery = {| variables: RelayClientIDFieldQueryVariables, @@ -84,9 +85,9 @@ export type RelayClientIDFieldQueryResponse = {| +__typename: string, +id: string, |}, - +node: ?{| + +node: ?({| +__typename: "Comment", - +commentBody: ?{| + +commentBody: ?({| +__typename: "PlainCommentBody", +__id: string, +text: ?{| @@ -94,17 +95,18 @@ export type RelayClientIDFieldQueryResponse = {| +__typename: string, +text: ?string, |}, + +__id: string, |} | {| - +__typename: "MarkdownCommentBody" - |} & {| - +__id: string - |}, + +__typename: "MarkdownCommentBody", + +__id: string, + |}), + +__id: string, + +id: string, |} | {| - +__typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "User" - |} & {| + +__typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "User", +__id: string, +id: string, - |}, + |}), |}; export type RelayClientIDFieldQuery = {| variables: RelayClientIDFieldQueryVariables, @@ -126,9 +128,9 @@ export type RelayClientIDFieldQueryResponse = {| +__typename: string, +id: string, |}, - +node: ?{| + +node: ?({| +__typename: "Comment", - +commentBody: ?{| + +commentBody: ?({| +__typename: "PlainCommentBody", +__id: string, +text: ?{| @@ -136,21 +138,22 @@ export type RelayClientIDFieldQueryResponse = {| +__typename: string, +text: ?string, |}, + +__id: string, |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +__typename: "MarkdownCommentBody" | "%other" - |} & {| - +__id: string - |}, + +__typename: "MarkdownCommentBody" | "%other", + +__id: string, + |}), + +__id: string, + +id: string, |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +__typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "User" | "%other" - |} & {| + +__typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "User" | "%other", +__id: string, +id: string, - |}, + |}), |}; export type RelayClientIDFieldQuery = {| variables: RelayClientIDFieldQueryVariables, @@ -172,9 +175,9 @@ export type RelayClientIDFieldQueryResponse = {| +__typename: string, +id: string, |}, - +node: ?{| + +node: ?({| +__typename: "Comment", - +commentBody: ?{| + +commentBody: ?({| +__typename: "PlainCommentBody", +__id: string, +text: ?{| @@ -182,21 +185,22 @@ export type RelayClientIDFieldQueryResponse = {| +__typename: string, +text: ?string, |}, + +__id: string, |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +__typename: "MarkdownCommentBody" | "%other" - |} & {| - +__id: string - |}, + +__typename: "MarkdownCommentBody" | "%other", + +__id: string, + |}), + +__id: string, + +id: string, |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +__typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "User" | "%other" - |} & {| + +__typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "User" | "%other", +__id: string, +id: string, - |}, + |}), |}; export type RelayClientIDFieldQuery = {| variables: RelayClientIDFieldQueryVariables, diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected index 17706bb896d2d..5d9a79a5d8e32 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected @@ -16,14 +16,14 @@ fragment Foo on Node { import type { FragmentReference } from "relay-runtime"; declare export opaque type Foo$ref: FragmentReference; declare export opaque type Foo$fragmentType: Foo$ref; -export type Foo = ?{| +export type Foo = ?({| +__typename: "User", +name: string, + +$refType: Foo$ref, |} | {| - +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" -|} & {| - +$refType: Foo$ref -|}; + +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story", + +$refType: Foo$ref, +|}); export type Foo$data = Foo; export type Foo$key = { +$data?: Foo$data, @@ -39,14 +39,14 @@ export type Foo$key = { import type { FragmentReference } from "relay-runtime"; declare export opaque type Foo$ref: FragmentReference; declare export opaque type Foo$fragmentType: Foo$ref; -export type Foo = ?{| +export type Foo = ?({| +__typename: "User", +name: string, + +$refType: Foo$ref, |} | {| - +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" -|} & {| - +$refType: Foo$ref -|}; + +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story", + +$refType: Foo$ref, +|}); export type Foo$data = Foo; export type Foo$key = { +$data?: Foo$data, @@ -62,16 +62,16 @@ export type Foo$key = { import type { FragmentReference } from "relay-runtime"; declare export opaque type Foo$ref: FragmentReference; declare export opaque type Foo$fragmentType: Foo$ref; -export type Foo = ?{| +export type Foo = ?({| +__typename: "User", +name: string, + +$refType: Foo$ref, |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" | "%other" -|} & {| - +$refType: Foo$ref -|}; + +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" | "%other", + +$refType: Foo$ref, +|}); export type Foo$data = Foo; export type Foo$key = { +$data?: Foo$data, @@ -87,16 +87,16 @@ export type Foo$key = { import type { FragmentReference } from "relay-runtime"; declare export opaque type Foo$ref: FragmentReference; declare export opaque type Foo$fragmentType: Foo$ref; -export type Foo = ?{| +export type Foo = ?({| +__typename: "User", +name: string, + +$refType: Foo$ref, |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" | "%other" -|} & {| - +$refType: Foo$ref -|}; + +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" | "%other", + +$refType: Foo$ref, +|}); export type Foo$data = Foo; export type Foo$key = { +$data?: Foo$data, diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-isolates-concrete-inline-fragments.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-isolates-concrete-inline-fragments.expected index 2c490b08ccbe9..8139ee7e7332c 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-isolates-concrete-inline-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-isolates-concrete-inline-fragments.expected @@ -53,19 +53,20 @@ export type Bar$key = { import type { FragmentReference } from "relay-runtime"; declare export opaque type Foo$ref: FragmentReference; declare export opaque type Foo$fragmentType: Foo$ref; -export type Foo = ?{| +export type Foo = ?({| +__typename: "User", +name: string, + +$refType: Foo$ref, |} | {| +__typename: "Comment", +body: ?{| +text: ?string |}, + +$refType: Foo$ref, |} | {| - +__typename: "Feedback" | "Page" | "PhotoStory" | "Story" -|} & {| - +$refType: Foo$ref -|}; + +__typename: "Feedback" | "Page" | "PhotoStory" | "Story", + +$refType: Foo$ref, +|}); export type Foo$data = Foo; export type Foo$key = { +$data?: Foo$data, @@ -98,19 +99,20 @@ export type Bar$key = { import type { FragmentReference } from "relay-runtime"; declare export opaque type Foo$ref: FragmentReference; declare export opaque type Foo$fragmentType: Foo$ref; -export type Foo = ?{| +export type Foo = ?({| +__typename: "User", +name: string, + +$refType: Foo$ref, |} | {| +__typename: "Comment", +body: ?{| +text: ?string |}, + +$refType: Foo$ref, |} | {| - +__typename: "Feedback" | "Page" | "PhotoStory" | "Story" -|} & {| - +$refType: Foo$ref -|}; + +__typename: "Feedback" | "Page" | "PhotoStory" | "Story", + +$refType: Foo$ref, +|}); export type Foo$data = Foo; export type Foo$key = { +$data?: Foo$data, @@ -143,21 +145,22 @@ export type Bar$key = { import type { FragmentReference } from "relay-runtime"; declare export opaque type Foo$ref: FragmentReference; declare export opaque type Foo$fragmentType: Foo$ref; -export type Foo = ?{| +export type Foo = ?({| +__typename: "User", +name: string, + +$refType: Foo$ref, |} | {| +__typename: "Comment", +body: ?{| +text: ?string |}, + +$refType: Foo$ref, |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +__typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "%other" -|} & {| - +$refType: Foo$ref -|}; + +__typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "%other", + +$refType: Foo$ref, +|}); export type Foo$data = Foo; export type Foo$key = { +$data?: Foo$data, @@ -190,21 +193,22 @@ export type Bar$key = { import type { FragmentReference } from "relay-runtime"; declare export opaque type Foo$ref: FragmentReference; declare export opaque type Foo$fragmentType: Foo$ref; -export type Foo = ?{| +export type Foo = ?({| +__typename: "User", +name: string, + +$refType: Foo$ref, |} | {| +__typename: "Comment", +body: ?{| +text: ?string |}, + +$refType: Foo$ref, |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +__typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "%other" -|} & {| - +$refType: Foo$ref -|}; + +__typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "%other", + +$refType: Foo$ref, +|}); export type Foo$data = Foo; export type Foo$key = { +$data?: Foo$data, diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected index f7c8ffce47323..19dce6c6069b5 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected @@ -91,11 +91,11 @@ declare export opaque type TypenameAlias$fragmentType: TypenameAlias$ref; export type TypenameAlias = {| +_typeAlias: "User", +firstName: ?string, + +$refType: TypenameAlias$ref, |} | {| +_typeAlias: "Page", +username: ?string, -|} & {| - +$refType: TypenameAlias$ref + +$refType: TypenameAlias$ref, |}; export type TypenameAlias$data = TypenameAlias; export type TypenameAlias$key = { @@ -111,12 +111,12 @@ export type TypenameAliases = {| +_typeAlias1: "User", +_typeAlias2: "User", +firstName: ?string, + +$refType: TypenameAliases$ref, |} | {| +_typeAlias1: "Page", +_typeAlias2: "Page", +username: ?string, -|} & {| - +$refType: TypenameAliases$ref + +$refType: TypenameAliases$ref, |}; export type TypenameAliases$data = TypenameAliases; export type TypenameAliases$key = { @@ -131,11 +131,11 @@ declare export opaque type TypenameInside$fragmentType: TypenameInside$ref; export type TypenameInside = {| +__typename: "User", +firstName: ?string, + +$refType: TypenameInside$ref, |} | {| +__typename: "Page", +username: ?string, -|} & {| - +$refType: TypenameInside$ref + +$refType: TypenameInside$ref, |}; export type TypenameInside$data = TypenameInside; export type TypenameInside$key = { @@ -150,11 +150,11 @@ declare export opaque type TypenameOutside$fragmentType: TypenameOutside$ref; export type TypenameOutside = {| +__typename: "User", +firstName: ?string, + +$refType: TypenameOutside$ref, |} | {| +__typename: "Page", +username: ?string, -|} & {| - +$refType: TypenameOutside$ref + +$refType: TypenameOutside$ref, |}; export type TypenameOutside$data = TypenameOutside; export type TypenameOutside$key = { @@ -173,9 +173,14 @@ export type TypenameOutsideWithAbstractType = {| +street: ?string, +city: ?string, |}, + +username?: ?string, + +address?: ?{| + +city: ?string, + +country: ?string, + |}, + +$refType: TypenameOutsideWithAbstractType$ref, |} | {| - +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" -|} & {| + +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story", +username?: ?string, +address?: ?{| +city: ?string, @@ -196,10 +201,11 @@ declare export opaque type TypenameWithCommonSelections$fragmentType: TypenameWi export type TypenameWithCommonSelections = {| +__typename: "User", +firstName: ?string, + +name: ?string, + +$refType: TypenameWithCommonSelections$ref, |} | {| +__typename: "Page", +username: ?string, -|} & {| +name: ?string, +$refType: TypenameWithCommonSelections$ref, |}; @@ -251,11 +257,11 @@ declare export opaque type TypenameAlias$fragmentType: TypenameAlias$ref; export type TypenameAlias = {| +_typeAlias: "User", +firstName: ?string, + +$refType: TypenameAlias$ref, |} | {| +_typeAlias: "Page", +username: ?string, -|} & {| - +$refType: TypenameAlias$ref + +$refType: TypenameAlias$ref, |}; export type TypenameAlias$data = TypenameAlias; export type TypenameAlias$key = { @@ -271,12 +277,12 @@ export type TypenameAliases = {| +_typeAlias1: "User", +_typeAlias2: "User", +firstName: ?string, + +$refType: TypenameAliases$ref, |} | {| +_typeAlias1: "Page", +_typeAlias2: "Page", +username: ?string, -|} & {| - +$refType: TypenameAliases$ref + +$refType: TypenameAliases$ref, |}; export type TypenameAliases$data = TypenameAliases; export type TypenameAliases$key = { @@ -291,11 +297,11 @@ declare export opaque type TypenameInside$fragmentType: TypenameInside$ref; export type TypenameInside = {| +__typename: "User", +firstName: ?string, + +$refType: TypenameInside$ref, |} | {| +__typename: "Page", +username: ?string, -|} & {| - +$refType: TypenameInside$ref + +$refType: TypenameInside$ref, |}; export type TypenameInside$data = TypenameInside; export type TypenameInside$key = { @@ -310,11 +316,11 @@ declare export opaque type TypenameOutside$fragmentType: TypenameOutside$ref; export type TypenameOutside = {| +__typename: "User", +firstName: ?string, + +$refType: TypenameOutside$ref, |} | {| +__typename: "Page", +username: ?string, -|} & {| - +$refType: TypenameOutside$ref + +$refType: TypenameOutside$ref, |}; export type TypenameOutside$data = TypenameOutside; export type TypenameOutside$key = { @@ -333,9 +339,14 @@ export type TypenameOutsideWithAbstractType = {| +street: ?string, +city: ?string, |}, + +username?: ?string, + +address?: ?{| + +city: ?string, + +country: ?string, + |}, + +$refType: TypenameOutsideWithAbstractType$ref, |} | {| - +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" -|} & {| + +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story", +username?: ?string, +address?: ?{| +city: ?string, @@ -356,10 +367,11 @@ declare export opaque type TypenameWithCommonSelections$fragmentType: TypenameWi export type TypenameWithCommonSelections = {| +__typename: "User", +firstName: ?string, + +name: ?string, + +$refType: TypenameWithCommonSelections$ref, |} | {| +__typename: "Page", +username: ?string, -|} & {| +name: ?string, +$refType: TypenameWithCommonSelections$ref, |}; @@ -411,15 +423,16 @@ declare export opaque type TypenameAlias$fragmentType: TypenameAlias$ref; export type TypenameAlias = {| +_typeAlias: "User", +firstName: ?string, + +$refType: TypenameAlias$ref, |} | {| +_typeAlias: "Page", +username: ?string, + +$refType: TypenameAlias$ref, |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +_typeAlias: "%other" -|} & {| - +$refType: TypenameAlias$ref + +_typeAlias: "%other", + +$refType: TypenameAlias$ref, |}; export type TypenameAlias$data = TypenameAlias; export type TypenameAlias$key = { @@ -435,10 +448,12 @@ export type TypenameAliases = {| +_typeAlias1: "User", +_typeAlias2: "User", +firstName: ?string, + +$refType: TypenameAliases$ref, |} | {| +_typeAlias1: "Page", +_typeAlias2: "Page", +username: ?string, + +$refType: TypenameAliases$ref, |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. @@ -446,8 +461,7 @@ export type TypenameAliases = {| // This will never be '%other', but we need some // value in case none of the concrete values match. +_typeAlias2: "%other", -|} & {| - +$refType: TypenameAliases$ref + +$refType: TypenameAliases$ref, |}; export type TypenameAliases$data = TypenameAliases; export type TypenameAliases$key = { @@ -462,15 +476,16 @@ declare export opaque type TypenameInside$fragmentType: TypenameInside$ref; export type TypenameInside = {| +__typename: "User", +firstName: ?string, + +$refType: TypenameInside$ref, |} | {| +__typename: "Page", +username: ?string, + +$refType: TypenameInside$ref, |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +__typename: "%other" -|} & {| - +$refType: TypenameInside$ref + +__typename: "%other", + +$refType: TypenameInside$ref, |}; export type TypenameInside$data = TypenameInside; export type TypenameInside$key = { @@ -485,15 +500,16 @@ declare export opaque type TypenameOutside$fragmentType: TypenameOutside$ref; export type TypenameOutside = {| +__typename: "User", +firstName: ?string, + +$refType: TypenameOutside$ref, |} | {| +__typename: "Page", +username: ?string, + +$refType: TypenameOutside$ref, |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +__typename: "%other" -|} & {| - +$refType: TypenameOutside$ref + +__typename: "%other", + +$refType: TypenameOutside$ref, |}; export type TypenameOutside$data = TypenameOutside; export type TypenameOutside$key = { @@ -512,11 +528,16 @@ export type TypenameOutsideWithAbstractType = {| +street: ?string, +city: ?string, |}, + +username?: ?string, + +address?: ?{| + +city: ?string, + +country: ?string, + |}, + +$refType: TypenameOutsideWithAbstractType$ref, |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" | "%other" -|} & {| + +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" | "%other", +username?: ?string, +address?: ?{| +city: ?string, @@ -537,14 +558,17 @@ declare export opaque type TypenameWithCommonSelections$fragmentType: TypenameWi export type TypenameWithCommonSelections = {| +__typename: "User", +firstName: ?string, + +name: ?string, + +$refType: TypenameWithCommonSelections$ref, |} | {| +__typename: "Page", +username: ?string, + +name: ?string, + +$refType: TypenameWithCommonSelections$ref, |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +__typename: "%other" -|} & {| + +__typename: "%other", +name: ?string, +$refType: TypenameWithCommonSelections$ref, |}; @@ -596,15 +620,16 @@ declare export opaque type TypenameAlias$fragmentType: TypenameAlias$ref; export type TypenameAlias = {| +_typeAlias: "User", +firstName: ?string, + +$refType: TypenameAlias$ref, |} | {| +_typeAlias: "Page", +username: ?string, + +$refType: TypenameAlias$ref, |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +_typeAlias: "%other" -|} & {| - +$refType: TypenameAlias$ref + +_typeAlias: "%other", + +$refType: TypenameAlias$ref, |}; export type TypenameAlias$data = TypenameAlias; export type TypenameAlias$key = { @@ -620,10 +645,12 @@ export type TypenameAliases = {| +_typeAlias1: "User", +_typeAlias2: "User", +firstName: ?string, + +$refType: TypenameAliases$ref, |} | {| +_typeAlias1: "Page", +_typeAlias2: "Page", +username: ?string, + +$refType: TypenameAliases$ref, |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. @@ -631,8 +658,7 @@ export type TypenameAliases = {| // This will never be '%other', but we need some // value in case none of the concrete values match. +_typeAlias2: "%other", -|} & {| - +$refType: TypenameAliases$ref + +$refType: TypenameAliases$ref, |}; export type TypenameAliases$data = TypenameAliases; export type TypenameAliases$key = { @@ -647,15 +673,16 @@ declare export opaque type TypenameInside$fragmentType: TypenameInside$ref; export type TypenameInside = {| +__typename: "User", +firstName: ?string, + +$refType: TypenameInside$ref, |} | {| +__typename: "Page", +username: ?string, + +$refType: TypenameInside$ref, |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +__typename: "%other" -|} & {| - +$refType: TypenameInside$ref + +__typename: "%other", + +$refType: TypenameInside$ref, |}; export type TypenameInside$data = TypenameInside; export type TypenameInside$key = { @@ -670,15 +697,16 @@ declare export opaque type TypenameOutside$fragmentType: TypenameOutside$ref; export type TypenameOutside = {| +__typename: "User", +firstName: ?string, + +$refType: TypenameOutside$ref, |} | {| +__typename: "Page", +username: ?string, + +$refType: TypenameOutside$ref, |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +__typename: "%other" -|} & {| - +$refType: TypenameOutside$ref + +__typename: "%other", + +$refType: TypenameOutside$ref, |}; export type TypenameOutside$data = TypenameOutside; export type TypenameOutside$key = { @@ -697,11 +725,16 @@ export type TypenameOutsideWithAbstractType = {| +street: ?string, +city: ?string, |}, + +username?: ?string, + +address?: ?{| + +city: ?string, + +country: ?string, + |}, + +$refType: TypenameOutsideWithAbstractType$ref, |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" | "%other" -|} & {| + +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" | "%other", +username?: ?string, +address?: ?{| +city: ?string, @@ -722,14 +755,17 @@ declare export opaque type TypenameWithCommonSelections$fragmentType: TypenameWi export type TypenameWithCommonSelections = {| +__typename: "User", +firstName: ?string, + +name: ?string, + +$refType: TypenameWithCommonSelections$ref, |} | {| +__typename: "Page", +username: ?string, + +name: ?string, + +$refType: TypenameWithCommonSelections$ref, |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +__typename: "%other" -|} & {| + +__typename: "%other", +name: ?string, +$refType: TypenameWithCommonSelections$ref, |}; From 573d12d3803c429db15b2fea40b3e80fc58074e3 Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Sun, 27 Dec 2020 17:11:52 +0100 Subject: [PATCH 22/41] Either list possible type names or "%other", but not a combination of the two. --- compiler/crates/relay-typegen/src/lib.rs | 103 +++++++++--------- .../fixtures/linked-field.expected | 4 +- .../fixtures/relay-client-id-field.expected | 8 +- ...ough-inline-fragments-to-fragment.expected | 4 +- ...solates-concrete-inline-fragments.expected | 4 +- .../fixtures/typename-on-union.expected | 4 +- .../fixtures/linked-field.expected | 4 +- .../fixtures/relay-client-id-field.expected | 8 +- ...ough-inline-fragments-to-fragment.expected | 4 +- ...solates-concrete-inline-fragments.expected | 4 +- .../fixtures/typename-on-union.expected | 4 +- 11 files changed, 75 insertions(+), 76 deletions(-) diff --git a/compiler/crates/relay-typegen/src/lib.rs b/compiler/crates/relay-typegen/src/lib.rs index a1236943626be..438925496eaa7 100644 --- a/compiler/crates/relay-typegen/src/lib.rs +++ b/compiler/crates/relay-typegen/src/lib.rs @@ -728,33 +728,8 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { ); } - // It might be some other type then the listed concrete types. We try to - // figure out which types remain here. - let possible_types_left: Option> = if let Some(node_type) = node_type { - if let Some(possible_types) = self.schema.get_possible_types(node_type) { - let types_seen = by_concrete_type - .keys() - .map(|type_| self.schema.get_type_name(*type_)) - .collect::>(); - Some( - possible_types - .into_iter() - .filter(|possible_type| !types_seen.contains(&possible_type.name)) - .collect(), - ) - } else { - None - } - } else { - None - }; - - if self.typegen_config.future_proof_abstract_types - || match &possible_types_left { - Some(types) => !types.is_empty(), - None => true, - } - { + if self.typegen_config.future_proof_abstract_types { + // concrete_types.push(AST::OtherTypename); concrete_types.push( typename_aliases .iter() @@ -762,34 +737,58 @@ impl<'schema, 'config> TypeGenerator<'schema, 'config> { key: *typename_alias, read_only: true, optional: false, - value: possible_types_left - .as_ref() - .map(|types| { - AST::Union( - types - .iter() - .map(|type_| AST::StringLiteral(type_.name)) - .chain( - // Would be nicer to chain() with iter::once or iter::empty, but then - // the if and else branch have incompatible return types. - std::iter::repeat(AST::OtherTypename).take( - if self - .typegen_config - .future_proof_abstract_types - { - 1 - } else { - 0 - }, - ), - ) - .collect(), - ) - }) - .unwrap_or(AST::OtherTypename), + value: AST::OtherTypename, }) .collect(), ); + } else { + // It might be some other type then the listed concrete types. We try to + // figure out which types remain here. + let possible_types_left: Option> = if let Some(node_type) = node_type { + if let Some(possible_types) = self.schema.get_possible_types(node_type) { + let types_seen = by_concrete_type + .keys() + .map(|type_| self.schema.get_type_name(*type_)) + .collect::>(); + Some( + possible_types + .into_iter() + .filter(|possible_type| !types_seen.contains(&possible_type.name)) + .collect(), + ) + } else { + None + } + } else { + None + }; + + if match &possible_types_left { + Some(types) => !types.is_empty(), + None => true, + } { + concrete_types.push( + typename_aliases + .iter() + .map(|typename_alias| Prop { + key: *typename_alias, + read_only: true, + optional: false, + value: possible_types_left + .as_ref() + .map(|types| { + AST::Union( + types + .iter() + .map(|type_| AST::StringLiteral(type_.name)) + .collect(), + ) + }) + .unwrap_or(AST::OtherTypename), + }) + .collect(), + ); + } } } diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/linked-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/linked-field.expected index 76a392cffae41..257dc71fc55a7 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/linked-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/linked-field.expected @@ -132,7 +132,7 @@ export type UnionTypeTestResponse = {| |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +__typename: "NonNode" | "%other" + +__typename: "%other" |}) |}; export type UnionTypeTest = {| @@ -180,7 +180,7 @@ export type UnionTypeTestResponse = {| |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +__typename: "NonNode" | "%other" + +__typename: "%other" |}) |}; export type UnionTypeTest = {| diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.expected index 3785caf0e58cf..bea5fe2db6e3e 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.expected @@ -142,7 +142,7 @@ export type RelayClientIDFieldQueryResponse = {| |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +__typename: "MarkdownCommentBody" | "%other", + +__typename: "%other", +__id: string, |}), +__id: string, @@ -150,7 +150,7 @@ export type RelayClientIDFieldQueryResponse = {| |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +__typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "User" | "%other", + +__typename: "%other", +__id: string, +id: string, |}), @@ -189,7 +189,7 @@ export type RelayClientIDFieldQueryResponse = {| |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +__typename: "MarkdownCommentBody" | "%other", + +__typename: "%other", +__id: string, |}), +__id: string, @@ -197,7 +197,7 @@ export type RelayClientIDFieldQueryResponse = {| |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +__typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "User" | "%other", + +__typename: "%other", +__id: string, +id: string, |}), diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected index 5d9a79a5d8e32..37d8e1f56fa68 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected @@ -69,7 +69,7 @@ export type Foo = ?({| |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" | "%other", + +__typename: "%other", +$refType: Foo$ref, |}); export type Foo$data = Foo; @@ -94,7 +94,7 @@ export type Foo = ?({| |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" | "%other", + +__typename: "%other", +$refType: Foo$ref, |}); export type Foo$data = Foo; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-isolates-concrete-inline-fragments.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-isolates-concrete-inline-fragments.expected index 8139ee7e7332c..cc73eaf1b8b9d 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-isolates-concrete-inline-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-isolates-concrete-inline-fragments.expected @@ -158,7 +158,7 @@ export type Foo = ?({| |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +__typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "%other", + +__typename: "%other", +$refType: Foo$ref, |}); export type Foo$data = Foo; @@ -206,7 +206,7 @@ export type Foo = ?({| |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +__typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "%other", + +__typename: "%other", +$refType: Foo$ref, |}); export type Foo$data = Foo; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected index 19dce6c6069b5..3a568585a4fe6 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected @@ -537,7 +537,7 @@ export type TypenameOutsideWithAbstractType = {| |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" | "%other", + +__typename: "%other", +username?: ?string, +address?: ?{| +city: ?string, @@ -734,7 +734,7 @@ export type TypenameOutsideWithAbstractType = {| |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. - +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" | "%other", + +__typename: "%other", +username?: ?string, +address?: ?{| +city: ?string, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected index a31c3c795245d..d36a8e4a9eb8e 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected @@ -126,7 +126,7 @@ export type UnionTypeTestResponse = { } | { // This will never be '%other', but we need some // value in case none of the concrete values match. - readonly __typename: "NonNode" | "%other" + readonly __typename: "%other" } | null }; export type UnionTypeTest = { @@ -171,7 +171,7 @@ export type UnionTypeTestResponse = { } | { // This will never be '%other', but we need some // value in case none of the concrete values match. - readonly __typename: "NonNode" | "%other" + readonly __typename: "%other" } | null }; export type UnionTypeTest = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected index 249338c265abd..4921970b5f81b 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected @@ -139,14 +139,14 @@ export type RelayClientIDFieldQueryResponse = { } | { // This will never be '%other', but we need some // value in case none of the concrete values match. - readonly __typename: "MarkdownCommentBody" | "%other" + readonly __typename: "%other" }) & { readonly __id: string } | null, } | { // This will never be '%other', but we need some // value in case none of the concrete values match. - readonly __typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "User" | "%other" + readonly __typename: "%other" }) & { readonly __id: string, readonly id: string, @@ -185,14 +185,14 @@ export type RelayClientIDFieldQueryResponse = { } | { // This will never be '%other', but we need some // value in case none of the concrete values match. - readonly __typename: "MarkdownCommentBody" | "%other" + readonly __typename: "%other" }) & { readonly __id: string } | null, } | { // This will never be '%other', but we need some // value in case none of the concrete values match. - readonly __typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "User" | "%other" + readonly __typename: "%other" }) & { readonly __id: string, readonly id: string, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected index 49a094aa82a7c..702559b5333b7 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected @@ -60,7 +60,7 @@ export type Foo = ({ } | { // This will never be '%other', but we need some // value in case none of the concrete values match. - readonly __typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" | "%other" + readonly __typename: "%other" }) & { readonly " $refType": FragmentRefs<"Foo"> } | null; @@ -82,7 +82,7 @@ export type Foo = ({ } | { // This will never be '%other', but we need some // value in case none of the concrete values match. - readonly __typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" | "%other" + readonly __typename: "%other" }) & { readonly " $refType": FragmentRefs<"Foo"> } | null; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected index 2df83f8e5aa07..1ea7befb69e15 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected @@ -137,7 +137,7 @@ export type Foo = ({ } | { // This will never be '%other', but we need some // value in case none of the concrete values match. - readonly __typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "%other" + readonly __typename: "%other" }) & { readonly " $refType": FragmentRefs<"Foo"> } | null; @@ -178,7 +178,7 @@ export type Foo = ({ } | { // This will never be '%other', but we need some // value in case none of the concrete values match. - readonly __typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "%other" + readonly __typename: "%other" }) & { readonly " $refType": FragmentRefs<"Foo"> } | null; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected index 7a590eda492b1..769dc9ce93cf1 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected @@ -453,7 +453,7 @@ export type TypenameOutsideWithAbstractType = ({ } | { // This will never be '%other', but we need some // value in case none of the concrete values match. - readonly __typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" | "%other" + readonly __typename: "%other" }) & { readonly username?: string | null, readonly address?: { @@ -614,7 +614,7 @@ export type TypenameOutsideWithAbstractType = ({ } | { // This will never be '%other', but we need some // value in case none of the concrete values match. - readonly __typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" | "%other" + readonly __typename: "%other" }) & { readonly username?: string | null, readonly address?: { From a125a396b80b3c1dcaddecad80c6796d054adeeb Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Sun, 27 Dec 2020 17:24:50 +0100 Subject: [PATCH 23/41] Prevent combinational test fixture output. --- .../fixtures/conditional.expected | 104 ---- .../fixtures/fragment-spread.expected | 378 ------------- .../fixtures/inline-fragment.expected | 296 ---------- .../fixtures/linked-field.expected | 145 ----- .../fixtures/match-field-in-query.expected | 173 ------ .../fixtures/match-field.expected | 185 ------ .../mutation-input-has-array.expected | 104 ---- .../mutation-with-client-extension.expected | 116 ---- .../mutation-with-enums-on-fragment.expected | 254 --------- .../mutation-with-nested-fragments.expected | 293 ---------- ...with-response-on-inline-fragments.expected | 263 --------- .../generate_flow/fixtures/mutation.expected | 116 ---- .../fixtures/plural-fragment.expected | 62 -- .../fixtures/query-with-handles.expected | 176 ------ .../fixtures/query-with-match-fields.expected | 353 ------------ .../fixtures/query-with-module-field.expected | 230 -------- .../query-with-multiple-match-fields.expected | 530 ----------------- ...-with-raw-response-on-conditional.expected | 170 ------ ...w-response-on-literal-conditional.expected | 155 ----- .../query-with-stream-connection.expected | 167 ------ .../fixtures/query-with-stream.expected | 146 ----- .../fixtures/recursive-fragments.expected | 65 --- .../fixtures/refetchable-fragment.expected | 119 ---- .../fixtures/refetchable.expected | 113 ---- .../fixtures/relay-client-id-field.expected | 138 ----- ...ough-inline-fragments-to-fragment.expected | 76 --- .../required-bubbles-to-fragment.expected | 65 --- ...d-bubbles-to-item-in-plural-field.expected | 74 --- ...m-in-non-null-plural-linked-field.expected | 68 --- ...ked-field-through-inline-fragment.expected | 68 --- ...-bubbles-to-non-null-linked-field.expected | 68 --- ...s-to-non-null-plural-linked-field.expected | 68 --- .../required-bubbles-to-query.expected | 56 -- ...d-bubbles-up-to-mutation-response.expected | 98 ---- ...ked-field-through-inline-fragment.expected | 74 --- ...solates-concrete-inline-fragments.expected | 145 ----- .../required-raw-response-type.expected | 77 --- ...-throw-doesnt-bubbles-to-fragment.expected | 65 --- ...red-throw-doesnt-bubbles-to-query.expected | 56 -- .../fixtures/required-throws-nested.expected | 56 -- ...rows-within-non-null-linked-field.expected | 68 --- ...thin-non-null-plural-linked-field.expected | 68 --- .../generate_flow/fixtures/required.expected | 56 -- .../generate_flow/fixtures/roots.expected | 236 -------- .../fixtures/scalar-field.expected | 95 ---- .../generate_flow/fixtures/simple.expected | 77 --- ...me-inside-with-overlapping-fields.expected | 99 ---- .../fixtures/typename-on-union.expected | 534 ------------------ .../unmasked-fragment-spreads.expected | 215 ------- .../relay-typegen/tests/generate_flow/mod.rs | 71 +-- .../fixtures/conditional.expected | 86 --- .../fixtures/fragment-spread.expected | 300 ---------- .../fixtures/inline-fragment.expected | 248 -------- .../fixtures/linked-field.expected | 136 ----- .../fixtures/match-field-in-query.expected | 149 ----- .../fixtures/match-field.expected | 152 ----- .../mutation-input-has-array.expected | 104 ---- .../mutation-with-client-extension.expected | 116 ---- .../mutation-with-enums-on-fragment.expected | 242 -------- .../mutation-with-nested-fragments.expected | 269 --------- ...with-response-on-inline-fragments.expected | 251 -------- .../fixtures/mutation.expected | 116 ---- .../fixtures/plural-fragment.expected | 53 -- .../fixtures/query-with-handles.expected | 176 ------ .../fixtures/query-with-match-fields.expected | 305 ---------- .../fixtures/query-with-module-field.expected | 200 ------- .../query-with-multiple-match-fields.expected | 452 --------------- ...-with-raw-response-on-conditional.expected | 158 ------ ...w-response-on-literal-conditional.expected | 143 ----- .../query-with-stream-connection.expected | 167 ------ .../fixtures/query-with-stream.expected | 146 ----- .../fixtures/recursive-fragments.expected | 56 -- .../fixtures/refetchable-fragment.expected | 104 ---- .../fixtures/refetchable.expected | 98 ---- .../fixtures/relay-client-id-field.expected | 135 ----- ...ough-inline-fragments-to-fragment.expected | 67 --- .../required-bubbles-to-fragment.expected | 56 -- ...d-bubbles-to-item-in-plural-field.expected | 65 --- .../required-bubbles-to-query.expected | 56 -- ...d-bubbles-up-to-mutation-response.expected | 98 ---- ...solates-concrete-inline-fragments.expected | 124 ---- .../required-raw-response-type.expected | 77 --- ...-throw-doesnt-bubbles-to-fragment.expected | 56 -- ...red-throw-doesnt-bubbles-to-query.expected | 56 -- .../fixtures/required-throws-nested.expected | 56 -- .../fixtures/required.expected | 56 -- .../fixtures/roots.expected | 227 -------- .../fixtures/scalar-field.expected | 86 --- .../fixtures/simple.expected | 68 --- ...me-inside-with-overlapping-fields.expected | 90 --- .../fixtures/typename-on-union.expected | 438 -------------- .../unmasked-fragment-spreads.expected | 173 ------ .../tests/generate_typescript/mod.rs | 72 +-- 93 files changed, 56 insertions(+), 13711 deletions(-) diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/conditional.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/conditional.expected index 1ec810862bcae..0ddc4e0be0181 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/conditional.expected @@ -9,110 +9,6 @@ fragment NestedCondition on Node { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type ConditionField$ref: FragmentReference; -declare export opaque type ConditionField$fragmentType: ConditionField$ref; -export type ConditionField = {| - +id?: string, - +$refType: ConditionField$ref, -|}; -export type ConditionField$data = ConditionField; -export type ConditionField$key = { - +$data?: ConditionField$data, - +$fragmentRefs: ConditionField$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type NestedCondition$ref: FragmentReference; -declare export opaque type NestedCondition$fragmentType: NestedCondition$ref; -export type NestedCondition = {| - +id?: string, - +$refType: NestedCondition$ref, -|}; -export type NestedCondition$data = NestedCondition; -export type NestedCondition$key = { - +$data?: NestedCondition$data, - +$fragmentRefs: NestedCondition$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type ConditionField$ref: FragmentReference; -declare export opaque type ConditionField$fragmentType: ConditionField$ref; -export type ConditionField = {| - +id?: string, - +$refType: ConditionField$ref, -|}; -export type ConditionField$data = ConditionField; -export type ConditionField$key = { - +$data?: ConditionField$data, - +$fragmentRefs: ConditionField$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type NestedCondition$ref: FragmentReference; -declare export opaque type NestedCondition$fragmentType: NestedCondition$ref; -export type NestedCondition = {| - +id?: string, - +$refType: NestedCondition$ref, -|}; -export type NestedCondition$data = NestedCondition; -export type NestedCondition$key = { - +$data?: NestedCondition$data, - +$fragmentRefs: NestedCondition$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type ConditionField$ref: FragmentReference; -declare export opaque type ConditionField$fragmentType: ConditionField$ref; -export type ConditionField = {| - +id?: string, - +$refType: ConditionField$ref, -|}; -export type ConditionField$data = ConditionField; -export type ConditionField$key = { - +$data?: ConditionField$data, - +$fragmentRefs: ConditionField$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type NestedCondition$ref: FragmentReference; -declare export opaque type NestedCondition$fragmentType: NestedCondition$ref; -export type NestedCondition = {| - +id?: string, - +$refType: NestedCondition$ref, -|}; -export type NestedCondition$data = NestedCondition; -export type NestedCondition$key = { - +$data?: NestedCondition$data, - +$fragmentRefs: NestedCondition$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import type { FragmentReference } from "relay-runtime"; declare export opaque type ConditionField$ref: FragmentReference; declare export opaque type ConditionField$fragmentType: ConditionField$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/fragment-spread.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/fragment-spread.expected index 3d1191423bd26..903246ce32b77 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/fragment-spread.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/fragment-spread.expected @@ -48,384 +48,6 @@ fragment UserFrag2 on User { __typename } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import type { PageFragment$ref } from "PageFragment.graphql"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type ConcreateTypes$ref: FragmentReference; -declare export opaque type ConcreateTypes$fragmentType: ConcreateTypes$ref; -export type ConcreateTypes = {| - +actor: ?({| - +__typename: "Page", - +id: string, - +$fragmentRefs: PageFragment$ref, - |} | {| - +__typename: "User", - +name: ?string, - |}), - +$refType: ConcreateTypes$ref, -|}; -export type ConcreateTypes$data = ConcreateTypes; -export type ConcreateTypes$key = { - +$data?: ConcreateTypes$data, - +$fragmentRefs: ConcreateTypes$ref, - ... -}; -------------------------------------------------------------------------------- -import type { OtherFragment$ref } from "OtherFragment.graphql"; -import type { PictureFragment$ref } from "PictureFragment.graphql"; -import type { UserFrag1$ref } from "UserFrag1.graphql"; -import type { UserFrag2$ref } from "UserFrag2.graphql"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type FragmentSpread$ref: FragmentReference; -declare export opaque type FragmentSpread$fragmentType: FragmentSpread$ref; -export type FragmentSpread = {| - +id: string, - +justFrag: ?{| - +$fragmentRefs: PictureFragment$ref - |}, - +fragAndField: ?{| - +uri: ?string, - +$fragmentRefs: PictureFragment$ref, - |}, - +$fragmentRefs: OtherFragment$ref & UserFrag1$ref & UserFrag2$ref, - +$refType: FragmentSpread$ref, -|}; -export type FragmentSpread$data = FragmentSpread; -export type FragmentSpread$key = { - +$data?: FragmentSpread$data, - +$fragmentRefs: FragmentSpread$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type OtherFragment$ref: FragmentReference; -declare export opaque type OtherFragment$fragmentType: OtherFragment$ref; -export type OtherFragment = {| - +__typename: string, - +$refType: OtherFragment$ref, -|}; -export type OtherFragment$data = OtherFragment; -export type OtherFragment$key = { - +$data?: OtherFragment$data, - +$fragmentRefs: OtherFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type PageFragment$ref: FragmentReference; -declare export opaque type PageFragment$fragmentType: PageFragment$ref; -export type PageFragment = {| - +__typename: "Page", - +$refType: PageFragment$ref, -|}; -export type PageFragment$data = PageFragment; -export type PageFragment$key = { - +$data?: PageFragment$data, - +$fragmentRefs: PageFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type PictureFragment$ref: FragmentReference; -declare export opaque type PictureFragment$fragmentType: PictureFragment$ref; -export type PictureFragment = {| - +__typename: "Image", - +$refType: PictureFragment$ref, -|}; -export type PictureFragment$data = PictureFragment; -export type PictureFragment$key = { - +$data?: PictureFragment$data, - +$fragmentRefs: PictureFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type UserFrag1$ref: FragmentReference; -declare export opaque type UserFrag1$fragmentType: UserFrag1$ref; -export type UserFrag1 = {| - +__typename: "User", - +$refType: UserFrag1$ref, -|}; -export type UserFrag1$data = UserFrag1; -export type UserFrag1$key = { - +$data?: UserFrag1$data, - +$fragmentRefs: UserFrag1$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type UserFrag2$ref: FragmentReference; -declare export opaque type UserFrag2$fragmentType: UserFrag2$ref; -export type UserFrag2 = {| - +__typename: "User", - +$refType: UserFrag2$ref, -|}; -export type UserFrag2$data = UserFrag2; -export type UserFrag2$key = { - +$data?: UserFrag2$data, - +$fragmentRefs: UserFrag2$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import type { PageFragment$ref } from "PageFragment.graphql"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type ConcreateTypes$ref: FragmentReference; -declare export opaque type ConcreateTypes$fragmentType: ConcreateTypes$ref; -export type ConcreateTypes = {| - +actor: ?({| - +__typename: "Page", - +id: string, - +$fragmentRefs: PageFragment$ref, - |} | {| - +__typename: "User", - +name: ?string, - |}), - +$refType: ConcreateTypes$ref, -|}; -export type ConcreateTypes$data = ConcreateTypes; -export type ConcreateTypes$key = { - +$data?: ConcreateTypes$data, - +$fragmentRefs: ConcreateTypes$ref, - ... -}; -------------------------------------------------------------------------------- -import type { OtherFragment$ref } from "OtherFragment.graphql"; -import type { PictureFragment$ref } from "PictureFragment.graphql"; -import type { UserFrag1$ref } from "UserFrag1.graphql"; -import type { UserFrag2$ref } from "UserFrag2.graphql"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type FragmentSpread$ref: FragmentReference; -declare export opaque type FragmentSpread$fragmentType: FragmentSpread$ref; -export type FragmentSpread = {| - +id: string, - +justFrag: ?{| - +$fragmentRefs: PictureFragment$ref - |}, - +fragAndField: ?{| - +uri: ?string, - +$fragmentRefs: PictureFragment$ref, - |}, - +$fragmentRefs: OtherFragment$ref & UserFrag1$ref & UserFrag2$ref, - +$refType: FragmentSpread$ref, -|}; -export type FragmentSpread$data = FragmentSpread; -export type FragmentSpread$key = { - +$data?: FragmentSpread$data, - +$fragmentRefs: FragmentSpread$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type OtherFragment$ref: FragmentReference; -declare export opaque type OtherFragment$fragmentType: OtherFragment$ref; -export type OtherFragment = {| - +__typename: string, - +$refType: OtherFragment$ref, -|}; -export type OtherFragment$data = OtherFragment; -export type OtherFragment$key = { - +$data?: OtherFragment$data, - +$fragmentRefs: OtherFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type PageFragment$ref: FragmentReference; -declare export opaque type PageFragment$fragmentType: PageFragment$ref; -export type PageFragment = {| - +__typename: "Page", - +$refType: PageFragment$ref, -|}; -export type PageFragment$data = PageFragment; -export type PageFragment$key = { - +$data?: PageFragment$data, - +$fragmentRefs: PageFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type PictureFragment$ref: FragmentReference; -declare export opaque type PictureFragment$fragmentType: PictureFragment$ref; -export type PictureFragment = {| - +__typename: "Image", - +$refType: PictureFragment$ref, -|}; -export type PictureFragment$data = PictureFragment; -export type PictureFragment$key = { - +$data?: PictureFragment$data, - +$fragmentRefs: PictureFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type UserFrag1$ref: FragmentReference; -declare export opaque type UserFrag1$fragmentType: UserFrag1$ref; -export type UserFrag1 = {| - +__typename: "User", - +$refType: UserFrag1$ref, -|}; -export type UserFrag1$data = UserFrag1; -export type UserFrag1$key = { - +$data?: UserFrag1$data, - +$fragmentRefs: UserFrag1$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type UserFrag2$ref: FragmentReference; -declare export opaque type UserFrag2$fragmentType: UserFrag2$ref; -export type UserFrag2 = {| - +__typename: "User", - +$refType: UserFrag2$ref, -|}; -export type UserFrag2$data = UserFrag2; -export type UserFrag2$key = { - +$data?: UserFrag2$data, - +$fragmentRefs: UserFrag2$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import type { PageFragment$ref } from "PageFragment.graphql"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type ConcreateTypes$ref: FragmentReference; -declare export opaque type ConcreateTypes$fragmentType: ConcreateTypes$ref; -export type ConcreateTypes = {| - +actor: ?({| - +__typename: "Page", - +id: string, - +$fragmentRefs: PageFragment$ref, - |} | {| - +__typename: "User", - +name: ?string, - |} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +__typename: "%other" - |}), - +$refType: ConcreateTypes$ref, -|}; -export type ConcreateTypes$data = ConcreateTypes; -export type ConcreateTypes$key = { - +$data?: ConcreateTypes$data, - +$fragmentRefs: ConcreateTypes$ref, - ... -}; -------------------------------------------------------------------------------- -import type { OtherFragment$ref } from "OtherFragment.graphql"; -import type { PictureFragment$ref } from "PictureFragment.graphql"; -import type { UserFrag1$ref } from "UserFrag1.graphql"; -import type { UserFrag2$ref } from "UserFrag2.graphql"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type FragmentSpread$ref: FragmentReference; -declare export opaque type FragmentSpread$fragmentType: FragmentSpread$ref; -export type FragmentSpread = {| - +id: string, - +justFrag: ?{| - +$fragmentRefs: PictureFragment$ref - |}, - +fragAndField: ?{| - +uri: ?string, - +$fragmentRefs: PictureFragment$ref, - |}, - +$fragmentRefs: OtherFragment$ref & UserFrag1$ref & UserFrag2$ref, - +$refType: FragmentSpread$ref, -|}; -export type FragmentSpread$data = FragmentSpread; -export type FragmentSpread$key = { - +$data?: FragmentSpread$data, - +$fragmentRefs: FragmentSpread$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type OtherFragment$ref: FragmentReference; -declare export opaque type OtherFragment$fragmentType: OtherFragment$ref; -export type OtherFragment = {| - +__typename: string, - +$refType: OtherFragment$ref, -|}; -export type OtherFragment$data = OtherFragment; -export type OtherFragment$key = { - +$data?: OtherFragment$data, - +$fragmentRefs: OtherFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type PageFragment$ref: FragmentReference; -declare export opaque type PageFragment$fragmentType: PageFragment$ref; -export type PageFragment = {| - +__typename: "Page", - +$refType: PageFragment$ref, -|}; -export type PageFragment$data = PageFragment; -export type PageFragment$key = { - +$data?: PageFragment$data, - +$fragmentRefs: PageFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type PictureFragment$ref: FragmentReference; -declare export opaque type PictureFragment$fragmentType: PictureFragment$ref; -export type PictureFragment = {| - +__typename: "Image", - +$refType: PictureFragment$ref, -|}; -export type PictureFragment$data = PictureFragment; -export type PictureFragment$key = { - +$data?: PictureFragment$data, - +$fragmentRefs: PictureFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type UserFrag1$ref: FragmentReference; -declare export opaque type UserFrag1$fragmentType: UserFrag1$ref; -export type UserFrag1 = {| - +__typename: "User", - +$refType: UserFrag1$ref, -|}; -export type UserFrag1$data = UserFrag1; -export type UserFrag1$key = { - +$data?: UserFrag1$data, - +$fragmentRefs: UserFrag1$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type UserFrag2$ref: FragmentReference; -declare export opaque type UserFrag2$fragmentType: UserFrag2$ref; -export type UserFrag2 = {| - +__typename: "User", - +$refType: UserFrag2$ref, -|}; -export type UserFrag2$data = UserFrag2; -export type UserFrag2$key = { - +$data?: UserFrag2$data, - +$fragmentRefs: UserFrag2$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import type { PageFragment$ref } from "PageFragment.graphql"; import type { FragmentReference } from "relay-runtime"; declare export opaque type ConcreateTypes$ref: FragmentReference; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/inline-fragment.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/inline-fragment.expected index 701a2116d7198..de1ea5b1eade3 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/inline-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/inline-fragment.expected @@ -64,302 +64,6 @@ fragment SomeFragment on User { __typename } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type InlineFragment$ref: FragmentReference; -declare export opaque type InlineFragment$fragmentType: InlineFragment$ref; -export type InlineFragment = {| - +id: string, - +name?: ?string, - +message?: ?{| - +text: ?string - |}, - +$refType: InlineFragment$ref, -|}; -export type InlineFragment$data = InlineFragment; -export type InlineFragment$key = { - +$data?: InlineFragment$data, - +$fragmentRefs: InlineFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type InlineFragmentConditionalID$ref: FragmentReference; -declare export opaque type InlineFragmentConditionalID$fragmentType: InlineFragmentConditionalID$ref; -export type InlineFragmentConditionalID = {| - +id?: string, - +name?: ?string, - +$refType: InlineFragmentConditionalID$ref, -|}; -export type InlineFragmentConditionalID$data = InlineFragmentConditionalID; -export type InlineFragmentConditionalID$key = { - +$data?: InlineFragmentConditionalID$data, - +$fragmentRefs: InlineFragmentConditionalID$ref, - ... -}; -------------------------------------------------------------------------------- -import type { SomeFragment$ref } from "SomeFragment.graphql"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type InlineFragmentKitchenSink$ref: FragmentReference; -declare export opaque type InlineFragmentKitchenSink$fragmentType: InlineFragmentKitchenSink$ref; -export type InlineFragmentKitchenSink = {| - +actor: ?{| - +id: string, - +profilePicture: ?{| - +uri: ?string, - +width?: ?number, - +height?: ?number, - |}, - +name?: ?string, - +$fragmentRefs: SomeFragment$ref, - |}, - +$refType: InlineFragmentKitchenSink$ref, -|}; -export type InlineFragmentKitchenSink$data = InlineFragmentKitchenSink; -export type InlineFragmentKitchenSink$key = { - +$data?: InlineFragmentKitchenSink$data, - +$fragmentRefs: InlineFragmentKitchenSink$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type InlineFragmentWithOverlappingFields$ref: FragmentReference; -declare export opaque type InlineFragmentWithOverlappingFields$fragmentType: InlineFragmentWithOverlappingFields$ref; -export type InlineFragmentWithOverlappingFields = {| - +hometown?: ?{| - +id: string, - +name: ?string, - +message?: ?{| - +text: ?string - |}, - |}, - +name?: ?string, - +$refType: InlineFragmentWithOverlappingFields$ref, -|}; -export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; -export type InlineFragmentWithOverlappingFields$key = { - +$data?: InlineFragmentWithOverlappingFields$data, - +$fragmentRefs: InlineFragmentWithOverlappingFields$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type SomeFragment$ref: FragmentReference; -declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; -export type SomeFragment = {| - +__typename: "User", - +$refType: SomeFragment$ref, -|}; -export type SomeFragment$data = SomeFragment; -export type SomeFragment$key = { - +$data?: SomeFragment$data, - +$fragmentRefs: SomeFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type InlineFragment$ref: FragmentReference; -declare export opaque type InlineFragment$fragmentType: InlineFragment$ref; -export type InlineFragment = {| - +id: string, - +name?: ?string, - +message?: ?{| - +text: ?string - |}, - +$refType: InlineFragment$ref, -|}; -export type InlineFragment$data = InlineFragment; -export type InlineFragment$key = { - +$data?: InlineFragment$data, - +$fragmentRefs: InlineFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type InlineFragmentConditionalID$ref: FragmentReference; -declare export opaque type InlineFragmentConditionalID$fragmentType: InlineFragmentConditionalID$ref; -export type InlineFragmentConditionalID = {| - +id?: string, - +name?: ?string, - +$refType: InlineFragmentConditionalID$ref, -|}; -export type InlineFragmentConditionalID$data = InlineFragmentConditionalID; -export type InlineFragmentConditionalID$key = { - +$data?: InlineFragmentConditionalID$data, - +$fragmentRefs: InlineFragmentConditionalID$ref, - ... -}; -------------------------------------------------------------------------------- -import type { SomeFragment$ref } from "SomeFragment.graphql"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type InlineFragmentKitchenSink$ref: FragmentReference; -declare export opaque type InlineFragmentKitchenSink$fragmentType: InlineFragmentKitchenSink$ref; -export type InlineFragmentKitchenSink = {| - +actor: ?{| - +id: string, - +profilePicture: ?{| - +uri: ?string, - +width?: ?number, - +height?: ?number, - |}, - +name?: ?string, - +$fragmentRefs: SomeFragment$ref, - |}, - +$refType: InlineFragmentKitchenSink$ref, -|}; -export type InlineFragmentKitchenSink$data = InlineFragmentKitchenSink; -export type InlineFragmentKitchenSink$key = { - +$data?: InlineFragmentKitchenSink$data, - +$fragmentRefs: InlineFragmentKitchenSink$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type InlineFragmentWithOverlappingFields$ref: FragmentReference; -declare export opaque type InlineFragmentWithOverlappingFields$fragmentType: InlineFragmentWithOverlappingFields$ref; -export type InlineFragmentWithOverlappingFields = {| - +hometown?: ?{| - +id: string, - +name: ?string, - +message?: ?{| - +text: ?string - |}, - |}, - +name?: ?string, - +$refType: InlineFragmentWithOverlappingFields$ref, -|}; -export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; -export type InlineFragmentWithOverlappingFields$key = { - +$data?: InlineFragmentWithOverlappingFields$data, - +$fragmentRefs: InlineFragmentWithOverlappingFields$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type SomeFragment$ref: FragmentReference; -declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; -export type SomeFragment = {| - +__typename: "User", - +$refType: SomeFragment$ref, -|}; -export type SomeFragment$data = SomeFragment; -export type SomeFragment$key = { - +$data?: SomeFragment$data, - +$fragmentRefs: SomeFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type InlineFragment$ref: FragmentReference; -declare export opaque type InlineFragment$fragmentType: InlineFragment$ref; -export type InlineFragment = {| - +id: string, - +name?: ?string, - +message?: ?{| - +text: ?string - |}, - +$refType: InlineFragment$ref, -|}; -export type InlineFragment$data = InlineFragment; -export type InlineFragment$key = { - +$data?: InlineFragment$data, - +$fragmentRefs: InlineFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type InlineFragmentConditionalID$ref: FragmentReference; -declare export opaque type InlineFragmentConditionalID$fragmentType: InlineFragmentConditionalID$ref; -export type InlineFragmentConditionalID = {| - +id?: string, - +name?: ?string, - +$refType: InlineFragmentConditionalID$ref, -|}; -export type InlineFragmentConditionalID$data = InlineFragmentConditionalID; -export type InlineFragmentConditionalID$key = { - +$data?: InlineFragmentConditionalID$data, - +$fragmentRefs: InlineFragmentConditionalID$ref, - ... -}; -------------------------------------------------------------------------------- -import type { SomeFragment$ref } from "SomeFragment.graphql"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type InlineFragmentKitchenSink$ref: FragmentReference; -declare export opaque type InlineFragmentKitchenSink$fragmentType: InlineFragmentKitchenSink$ref; -export type InlineFragmentKitchenSink = {| - +actor: ?{| - +id: string, - +profilePicture: ?{| - +uri: ?string, - +width?: ?number, - +height?: ?number, - |}, - +name?: ?string, - +$fragmentRefs: SomeFragment$ref, - |}, - +$refType: InlineFragmentKitchenSink$ref, -|}; -export type InlineFragmentKitchenSink$data = InlineFragmentKitchenSink; -export type InlineFragmentKitchenSink$key = { - +$data?: InlineFragmentKitchenSink$data, - +$fragmentRefs: InlineFragmentKitchenSink$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type InlineFragmentWithOverlappingFields$ref: FragmentReference; -declare export opaque type InlineFragmentWithOverlappingFields$fragmentType: InlineFragmentWithOverlappingFields$ref; -export type InlineFragmentWithOverlappingFields = {| - +hometown?: ?{| - +id: string, - +name: ?string, - +message?: ?{| - +text: ?string - |}, - |}, - +name?: ?string, - +$refType: InlineFragmentWithOverlappingFields$ref, -|}; -export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; -export type InlineFragmentWithOverlappingFields$key = { - +$data?: InlineFragmentWithOverlappingFields$data, - +$fragmentRefs: InlineFragmentWithOverlappingFields$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type SomeFragment$ref: FragmentReference; -declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; -export type SomeFragment = {| - +__typename: "User", - +$refType: SomeFragment$ref, -|}; -export type SomeFragment$data = SomeFragment; -export type SomeFragment$key = { - +$data?: SomeFragment$data, - +$fragmentRefs: SomeFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import type { FragmentReference } from "relay-runtime"; declare export opaque type InlineFragment$ref: FragmentReference; declare export opaque type InlineFragment$fragmentType: InlineFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/linked-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/linked-field.expected index 257dc71fc55a7..38bb3583ed53b 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/linked-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/linked-field.expected @@ -27,151 +27,6 @@ query UnionTypeTest { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type UnionTypeTestVariables = {||}; -export type UnionTypeTestResponse = {| - +neverNode: ?({| - +__typename: "FakeNode", - +id: string, - |} | {| - +__typename: "NonNode" - |}) -|}; -export type UnionTypeTest = {| - variables: UnionTypeTestVariables, - response: UnionTypeTestResponse, -|}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type LinkedField$ref: FragmentReference; -declare export opaque type LinkedField$fragmentType: LinkedField$ref; -export type LinkedField = {| - +profilePicture: ?{| - +uri: ?string, - +width: ?number, - +height: ?number, - |}, - +hometown: ?{| - +id: string, - +profilePicture: ?{| - +uri: ?string - |}, - |}, - +actor: ?{| - +id: string - |}, - +$refType: LinkedField$ref, -|}; -export type LinkedField$data = LinkedField; -export type LinkedField$key = { - +$data?: LinkedField$data, - +$fragmentRefs: LinkedField$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type UnionTypeTestVariables = {||}; -export type UnionTypeTestResponse = {| - +neverNode: ?({| - +__typename: "FakeNode", - +id: string, - |} | {| - +__typename: "NonNode" - |}) -|}; -export type UnionTypeTest = {| - variables: UnionTypeTestVariables, - response: UnionTypeTestResponse, -|}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type LinkedField$ref: FragmentReference; -declare export opaque type LinkedField$fragmentType: LinkedField$ref; -export type LinkedField = {| - +profilePicture: ?{| - +uri: ?string, - +width: ?number, - +height: ?number, - |}, - +hometown: ?{| - +id: string, - +profilePicture: ?{| - +uri: ?string - |}, - |}, - +actor: ?{| - +id: string - |}, - +$refType: LinkedField$ref, -|}; -export type LinkedField$data = LinkedField; -export type LinkedField$key = { - +$data?: LinkedField$data, - +$fragmentRefs: LinkedField$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type UnionTypeTestVariables = {||}; -export type UnionTypeTestResponse = {| - +neverNode: ?({| - +__typename: "FakeNode", - +id: string, - |} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +__typename: "%other" - |}) -|}; -export type UnionTypeTest = {| - variables: UnionTypeTestVariables, - response: UnionTypeTestResponse, -|}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type LinkedField$ref: FragmentReference; -declare export opaque type LinkedField$fragmentType: LinkedField$ref; -export type LinkedField = {| - +profilePicture: ?{| - +uri: ?string, - +width: ?number, - +height: ?number, - |}, - +hometown: ?{| - +id: string, - +profilePicture: ?{| - +uri: ?string - |}, - |}, - +actor: ?{| - +id: string - |}, - +$refType: LinkedField$ref, -|}; -export type LinkedField$data = LinkedField; -export type LinkedField$key = { - +$data?: LinkedField$data, - +$fragmentRefs: LinkedField$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type UnionTypeTestVariables = {||}; export type UnionTypeTestResponse = {| +neverNode: ?({| diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/match-field-in-query.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/match-field-in-query.expected index 4b6e35f7dba66..b05cd7f52e50f 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/match-field-in-query.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/match-field-in-query.expected @@ -23,179 +23,6 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; -import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; -export type NameRendererQueryVariables = {||}; -export type NameRendererQueryResponse = {| - +me: ?{| - +nameRenderer: ?{| - +__fragmentPropName?: ?string, - +__module_component?: ?string, - +$fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, - |} - |} -|}; -export type NameRendererQuery = {| - variables: NameRendererQueryVariables, - response: NameRendererQueryResponse, -|}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type MarkdownUserNameRenderer_name$ref: FragmentReference; -declare export opaque type MarkdownUserNameRenderer_name$fragmentType: MarkdownUserNameRenderer_name$ref; -export type MarkdownUserNameRenderer_name = {| - +markdown: ?string, - +data: ?{| - +markup: ?string - |}, - +$refType: MarkdownUserNameRenderer_name$ref, -|}; -export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; -export type MarkdownUserNameRenderer_name$key = { - +$data?: MarkdownUserNameRenderer_name$data, - +$fragmentRefs: MarkdownUserNameRenderer_name$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type PlainUserNameRenderer_name$ref: FragmentReference; -declare export opaque type PlainUserNameRenderer_name$fragmentType: PlainUserNameRenderer_name$ref; -export type PlainUserNameRenderer_name = {| - +plaintext: ?string, - +data: ?{| - +text: ?string - |}, - +$refType: PlainUserNameRenderer_name$ref, -|}; -export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; -export type PlainUserNameRenderer_name$key = { - +$data?: PlainUserNameRenderer_name$data, - +$fragmentRefs: PlainUserNameRenderer_name$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; -import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; -export type NameRendererQueryVariables = {||}; -export type NameRendererQueryResponse = {| - +me: ?{| - +nameRenderer: ?{| - +__fragmentPropName?: ?string, - +__module_component?: ?string, - +$fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, - |} - |} -|}; -export type NameRendererQuery = {| - variables: NameRendererQueryVariables, - response: NameRendererQueryResponse, -|}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type MarkdownUserNameRenderer_name$ref: FragmentReference; -declare export opaque type MarkdownUserNameRenderer_name$fragmentType: MarkdownUserNameRenderer_name$ref; -export type MarkdownUserNameRenderer_name = {| - +markdown: ?string, - +data: ?{| - +markup: ?string - |}, - +$refType: MarkdownUserNameRenderer_name$ref, -|}; -export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; -export type MarkdownUserNameRenderer_name$key = { - +$data?: MarkdownUserNameRenderer_name$data, - +$fragmentRefs: MarkdownUserNameRenderer_name$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type PlainUserNameRenderer_name$ref: FragmentReference; -declare export opaque type PlainUserNameRenderer_name$fragmentType: PlainUserNameRenderer_name$ref; -export type PlainUserNameRenderer_name = {| - +plaintext: ?string, - +data: ?{| - +text: ?string - |}, - +$refType: PlainUserNameRenderer_name$ref, -|}; -export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; -export type PlainUserNameRenderer_name$key = { - +$data?: PlainUserNameRenderer_name$data, - +$fragmentRefs: PlainUserNameRenderer_name$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; -import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; -export type NameRendererQueryVariables = {||}; -export type NameRendererQueryResponse = {| - +me: ?{| - +nameRenderer: ?{| - +__fragmentPropName?: ?string, - +__module_component?: ?string, - +$fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, - |} - |} -|}; -export type NameRendererQuery = {| - variables: NameRendererQueryVariables, - response: NameRendererQueryResponse, -|}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type MarkdownUserNameRenderer_name$ref: FragmentReference; -declare export opaque type MarkdownUserNameRenderer_name$fragmentType: MarkdownUserNameRenderer_name$ref; -export type MarkdownUserNameRenderer_name = {| - +markdown: ?string, - +data: ?{| - +markup: ?string - |}, - +$refType: MarkdownUserNameRenderer_name$ref, -|}; -export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; -export type MarkdownUserNameRenderer_name$key = { - +$data?: MarkdownUserNameRenderer_name$data, - +$fragmentRefs: MarkdownUserNameRenderer_name$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type PlainUserNameRenderer_name$ref: FragmentReference; -declare export opaque type PlainUserNameRenderer_name$fragmentType: PlainUserNameRenderer_name$ref; -export type PlainUserNameRenderer_name = {| - +plaintext: ?string, - +data: ?{| - +text: ?string - |}, - +$refType: PlainUserNameRenderer_name$ref, -|}; -export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; -export type PlainUserNameRenderer_name$key = { - +$data?: PlainUserNameRenderer_name$data, - +$fragmentRefs: PlainUserNameRenderer_name$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; export type NameRendererQueryVariables = {||}; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/match-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/match-field.expected index 004ad90cedff7..85b4148c28bcd 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/match-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/match-field.expected @@ -22,191 +22,6 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type MarkdownUserNameRenderer_name$ref: FragmentReference; -declare export opaque type MarkdownUserNameRenderer_name$fragmentType: MarkdownUserNameRenderer_name$ref; -export type MarkdownUserNameRenderer_name = {| - +markdown: ?string, - +data: ?{| - +markup: ?string - |}, - +$refType: MarkdownUserNameRenderer_name$ref, -|}; -export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; -export type MarkdownUserNameRenderer_name$key = { - +$data?: MarkdownUserNameRenderer_name$data, - +$fragmentRefs: MarkdownUserNameRenderer_name$ref, - ... -}; -------------------------------------------------------------------------------- -import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; -import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type NameRendererFragment$ref: FragmentReference; -declare export opaque type NameRendererFragment$fragmentType: NameRendererFragment$ref; -export type NameRendererFragment = {| - +id: string, - +nameRenderer: ?{| - +__fragmentPropName?: ?string, - +__module_component?: ?string, - +$fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, - |}, - +$refType: NameRendererFragment$ref, -|}; -export type NameRendererFragment$data = NameRendererFragment; -export type NameRendererFragment$key = { - +$data?: NameRendererFragment$data, - +$fragmentRefs: NameRendererFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type PlainUserNameRenderer_name$ref: FragmentReference; -declare export opaque type PlainUserNameRenderer_name$fragmentType: PlainUserNameRenderer_name$ref; -export type PlainUserNameRenderer_name = {| - +plaintext: ?string, - +data: ?{| - +text: ?string - |}, - +$refType: PlainUserNameRenderer_name$ref, -|}; -export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; -export type PlainUserNameRenderer_name$key = { - +$data?: PlainUserNameRenderer_name$data, - +$fragmentRefs: PlainUserNameRenderer_name$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type MarkdownUserNameRenderer_name$ref: FragmentReference; -declare export opaque type MarkdownUserNameRenderer_name$fragmentType: MarkdownUserNameRenderer_name$ref; -export type MarkdownUserNameRenderer_name = {| - +markdown: ?string, - +data: ?{| - +markup: ?string - |}, - +$refType: MarkdownUserNameRenderer_name$ref, -|}; -export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; -export type MarkdownUserNameRenderer_name$key = { - +$data?: MarkdownUserNameRenderer_name$data, - +$fragmentRefs: MarkdownUserNameRenderer_name$ref, - ... -}; -------------------------------------------------------------------------------- -import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; -import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type NameRendererFragment$ref: FragmentReference; -declare export opaque type NameRendererFragment$fragmentType: NameRendererFragment$ref; -export type NameRendererFragment = {| - +id: string, - +nameRenderer: ?{| - +__fragmentPropName?: ?string, - +__module_component?: ?string, - +$fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, - |}, - +$refType: NameRendererFragment$ref, -|}; -export type NameRendererFragment$data = NameRendererFragment; -export type NameRendererFragment$key = { - +$data?: NameRendererFragment$data, - +$fragmentRefs: NameRendererFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type PlainUserNameRenderer_name$ref: FragmentReference; -declare export opaque type PlainUserNameRenderer_name$fragmentType: PlainUserNameRenderer_name$ref; -export type PlainUserNameRenderer_name = {| - +plaintext: ?string, - +data: ?{| - +text: ?string - |}, - +$refType: PlainUserNameRenderer_name$ref, -|}; -export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; -export type PlainUserNameRenderer_name$key = { - +$data?: PlainUserNameRenderer_name$data, - +$fragmentRefs: PlainUserNameRenderer_name$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type MarkdownUserNameRenderer_name$ref: FragmentReference; -declare export opaque type MarkdownUserNameRenderer_name$fragmentType: MarkdownUserNameRenderer_name$ref; -export type MarkdownUserNameRenderer_name = {| - +markdown: ?string, - +data: ?{| - +markup: ?string - |}, - +$refType: MarkdownUserNameRenderer_name$ref, -|}; -export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; -export type MarkdownUserNameRenderer_name$key = { - +$data?: MarkdownUserNameRenderer_name$data, - +$fragmentRefs: MarkdownUserNameRenderer_name$ref, - ... -}; -------------------------------------------------------------------------------- -import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; -import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type NameRendererFragment$ref: FragmentReference; -declare export opaque type NameRendererFragment$fragmentType: NameRendererFragment$ref; -export type NameRendererFragment = {| - +id: string, - +nameRenderer: ?{| - +__fragmentPropName?: ?string, - +__module_component?: ?string, - +$fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, - |}, - +$refType: NameRendererFragment$ref, -|}; -export type NameRendererFragment$data = NameRendererFragment; -export type NameRendererFragment$key = { - +$data?: NameRendererFragment$data, - +$fragmentRefs: NameRendererFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type PlainUserNameRenderer_name$ref: FragmentReference; -declare export opaque type PlainUserNameRenderer_name$fragmentType: PlainUserNameRenderer_name$ref; -export type PlainUserNameRenderer_name = {| - +plaintext: ?string, - +data: ?{| - +text: ?string - |}, - +$refType: PlainUserNameRenderer_name$ref, -|}; -export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; -export type PlainUserNameRenderer_name$key = { - +$data?: PlainUserNameRenderer_name$data, - +$fragmentRefs: PlainUserNameRenderer_name$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import type { FragmentReference } from "relay-runtime"; declare export opaque type MarkdownUserNameRenderer_name$ref: FragmentReference; declare export opaque type MarkdownUserNameRenderer_name$fragmentType: MarkdownUserNameRenderer_name$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-input-has-array.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-input-has-array.expected index 09fe473a92923..6a3454c07951e 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-input-has-array.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-input-has-array.expected @@ -7,110 +7,6 @@ mutation InputHasArray($input: UpdateAllSeenStateInput) @raw_response_type { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type UpdateAllSeenStateInput = {| - clientMutationId?: ?string, - storyIds?: ?$ReadOnlyArray, -|}; -export type InputHasArrayVariables = {| - input?: ?UpdateAllSeenStateInput -|}; -export type InputHasArrayResponse = {| - +viewerNotificationsUpdateAllSeenState: ?{| - +stories: ?$ReadOnlyArray - |} -|}; -export type InputHasArrayRawResponse = {| - +viewerNotificationsUpdateAllSeenState: ?{| - +stories: ?$ReadOnlyArray - |} -|}; -export type InputHasArray = {| - variables: InputHasArrayVariables, - response: InputHasArrayResponse, - rawResponse: InputHasArrayRawResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type UpdateAllSeenStateInput = {| - clientMutationId?: ?string, - storyIds?: ?$ReadOnlyArray, -|}; -export type InputHasArrayVariables = {| - input?: ?UpdateAllSeenStateInput -|}; -export type InputHasArrayResponse = {| - +viewerNotificationsUpdateAllSeenState: ?{| - +stories: ?$ReadOnlyArray - |} -|}; -export type InputHasArrayRawResponse = {| - +viewerNotificationsUpdateAllSeenState: ?{| - +stories: ?$ReadOnlyArray - |} -|}; -export type InputHasArray = {| - variables: InputHasArrayVariables, - response: InputHasArrayResponse, - rawResponse: InputHasArrayRawResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type UpdateAllSeenStateInput = {| - clientMutationId?: ?string, - storyIds?: ?$ReadOnlyArray, -|}; -export type InputHasArrayVariables = {| - input?: ?UpdateAllSeenStateInput -|}; -export type InputHasArrayResponse = {| - +viewerNotificationsUpdateAllSeenState: ?{| - +stories: ?$ReadOnlyArray - |} -|}; -export type InputHasArrayRawResponse = {| - +viewerNotificationsUpdateAllSeenState: ?{| - +stories: ?$ReadOnlyArray - |} -|}; -export type InputHasArray = {| - variables: InputHasArrayVariables, - response: InputHasArrayResponse, - rawResponse: InputHasArrayRawResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type UpdateAllSeenStateInput = {| clientMutationId?: ?string, storyIds?: ?$ReadOnlyArray, diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-client-extension.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-client-extension.expected index e7ddf22d15ab8..19a6626bbbe1c 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-client-extension.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-client-extension.expected @@ -19,122 +19,6 @@ type Foo { bar: String } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type UpdateAllSeenStateInput = {| - clientMutationId?: ?string, - storyIds?: ?$ReadOnlyArray, -|}; -export type TestVariables = {| - input?: ?UpdateAllSeenStateInput -|}; -export type TestResponse = {| - +viewerNotificationsUpdateAllSeenState: ?{| - +stories: ?$ReadOnlyArray - |}> - |} -|}; -export type TestRawResponse = {| - +viewerNotificationsUpdateAllSeenState: ?{| - +stories: ?$ReadOnlyArray, - |}> - |} -|}; -export type Test = {| - variables: TestVariables, - response: TestResponse, - rawResponse: TestRawResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type UpdateAllSeenStateInput = {| - clientMutationId?: ?string, - storyIds?: ?$ReadOnlyArray, -|}; -export type TestVariables = {| - input?: ?UpdateAllSeenStateInput -|}; -export type TestResponse = {| - +viewerNotificationsUpdateAllSeenState: ?{| - +stories: ?$ReadOnlyArray - |}> - |} -|}; -export type TestRawResponse = {| - +viewerNotificationsUpdateAllSeenState: ?{| - +stories: ?$ReadOnlyArray, - |}> - |} -|}; -export type Test = {| - variables: TestVariables, - response: TestResponse, - rawResponse: TestRawResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type UpdateAllSeenStateInput = {| - clientMutationId?: ?string, - storyIds?: ?$ReadOnlyArray, -|}; -export type TestVariables = {| - input?: ?UpdateAllSeenStateInput -|}; -export type TestResponse = {| - +viewerNotificationsUpdateAllSeenState: ?{| - +stories: ?$ReadOnlyArray - |}> - |} -|}; -export type TestRawResponse = {| - +viewerNotificationsUpdateAllSeenState: ?{| - +stories: ?$ReadOnlyArray, - |}> - |} -|}; -export type Test = {| - variables: TestVariables, - response: TestResponse, - rawResponse: TestRawResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type UpdateAllSeenStateInput = {| clientMutationId?: ?string, storyIds?: ?$ReadOnlyArray, diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-enums-on-fragment.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-enums-on-fragment.expected index 7ae582ac1e81a..9b0709bf2da7d 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-enums-on-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-enums-on-fragment.expected @@ -27,260 +27,6 @@ fragment FriendFragment on User { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import type { FriendFragment$ref } from "FriendFragment.graphql"; -export type TestEnums = "mark" | "zuck"; -export type CommentCreateInput = {| - clientMutationId?: ?string, - feedbackId?: ?string, - feedback?: ?CommentfeedbackFeedback, -|}; -export type CommentfeedbackFeedback = {| - comment?: ?FeedbackcommentComment -|}; -export type FeedbackcommentComment = {| - feedback?: ?CommentfeedbackFeedback -|}; -export type CommentCreateMutationVariables = {| - input: CommentCreateInput, - first?: ?number, - orderBy?: ?$ReadOnlyArray, -|}; -export type CommentCreateMutationResponse = {| - +commentCreate: ?{| - +comment: ?{| - +friends: ?{| - +edges: ?$ReadOnlyArray - |} - |} - |} -|}; -export type CommentCreateMutationRawResponse = {| - +commentCreate: ?{| - +comment: ?{| - +friends: ?{| - +edges: ?$ReadOnlyArray - |}, - +id: string, - |} - |} -|}; -export type CommentCreateMutation = {| - variables: CommentCreateMutationVariables, - response: CommentCreateMutationResponse, - rawResponse: CommentCreateMutationRawResponse, -|}; -------------------------------------------------------------------------------- -export type TestEnums = "mark" | "zuck"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type FriendFragment$ref: FragmentReference; -declare export opaque type FriendFragment$fragmentType: FriendFragment$ref; -export type FriendFragment = {| - +name: ?string, - +lastName: ?string, - +profilePicture2: ?{| - +test_enums: ?TestEnums - |}, - +$refType: FriendFragment$ref, -|}; -export type FriendFragment$data = FriendFragment; -export type FriendFragment$key = { - +$data?: FriendFragment$data, - +$fragmentRefs: FriendFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import type { FriendFragment$ref } from "FriendFragment.graphql"; -export type TestEnums = "mark" | "zuck" | "%future added value"; -export type CommentCreateInput = {| - clientMutationId?: ?string, - feedbackId?: ?string, - feedback?: ?CommentfeedbackFeedback, -|}; -export type CommentfeedbackFeedback = {| - comment?: ?FeedbackcommentComment -|}; -export type FeedbackcommentComment = {| - feedback?: ?CommentfeedbackFeedback -|}; -export type CommentCreateMutationVariables = {| - input: CommentCreateInput, - first?: ?number, - orderBy?: ?$ReadOnlyArray, -|}; -export type CommentCreateMutationResponse = {| - +commentCreate: ?{| - +comment: ?{| - +friends: ?{| - +edges: ?$ReadOnlyArray - |} - |} - |} -|}; -export type CommentCreateMutationRawResponse = {| - +commentCreate: ?{| - +comment: ?{| - +friends: ?{| - +edges: ?$ReadOnlyArray - |}, - +id: string, - |} - |} -|}; -export type CommentCreateMutation = {| - variables: CommentCreateMutationVariables, - response: CommentCreateMutationResponse, - rawResponse: CommentCreateMutationRawResponse, -|}; -------------------------------------------------------------------------------- -export type TestEnums = "mark" | "zuck" | "%future added value"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type FriendFragment$ref: FragmentReference; -declare export opaque type FriendFragment$fragmentType: FriendFragment$ref; -export type FriendFragment = {| - +name: ?string, - +lastName: ?string, - +profilePicture2: ?{| - +test_enums: ?TestEnums - |}, - +$refType: FriendFragment$ref, -|}; -export type FriendFragment$data = FriendFragment; -export type FriendFragment$key = { - +$data?: FriendFragment$data, - +$fragmentRefs: FriendFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import type { FriendFragment$ref } from "FriendFragment.graphql"; -export type TestEnums = "mark" | "zuck"; -export type CommentCreateInput = {| - clientMutationId?: ?string, - feedbackId?: ?string, - feedback?: ?CommentfeedbackFeedback, -|}; -export type CommentfeedbackFeedback = {| - comment?: ?FeedbackcommentComment -|}; -export type FeedbackcommentComment = {| - feedback?: ?CommentfeedbackFeedback -|}; -export type CommentCreateMutationVariables = {| - input: CommentCreateInput, - first?: ?number, - orderBy?: ?$ReadOnlyArray, -|}; -export type CommentCreateMutationResponse = {| - +commentCreate: ?{| - +comment: ?{| - +friends: ?{| - +edges: ?$ReadOnlyArray - |} - |} - |} -|}; -export type CommentCreateMutationRawResponse = {| - +commentCreate: ?{| - +comment: ?{| - +friends: ?{| - +edges: ?$ReadOnlyArray - |}, - +id: string, - |} - |} -|}; -export type CommentCreateMutation = {| - variables: CommentCreateMutationVariables, - response: CommentCreateMutationResponse, - rawResponse: CommentCreateMutationRawResponse, -|}; -------------------------------------------------------------------------------- -export type TestEnums = "mark" | "zuck"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type FriendFragment$ref: FragmentReference; -declare export opaque type FriendFragment$fragmentType: FriendFragment$ref; -export type FriendFragment = {| - +name: ?string, - +lastName: ?string, - +profilePicture2: ?{| - +test_enums: ?TestEnums - |}, - +$refType: FriendFragment$ref, -|}; -export type FriendFragment$data = FriendFragment; -export type FriendFragment$key = { - +$data?: FriendFragment$data, - +$fragmentRefs: FriendFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import type { FriendFragment$ref } from "FriendFragment.graphql"; export type TestEnums = "mark" | "zuck" | "%future added value"; export type CommentCreateInput = {| diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-nested-fragments.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-nested-fragments.expected index 4bad28674aaca..9439a4b045a62 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-nested-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-nested-fragments.expected @@ -31,299 +31,6 @@ fragment FeedbackFragment on Feedback { name } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import type { FriendFragment$ref } from "FriendFragment.graphql"; -export type CommentCreateInput = {| - clientMutationId?: ?string, - feedbackId?: ?string, - feedback?: ?CommentfeedbackFeedback, -|}; -export type CommentfeedbackFeedback = {| - comment?: ?FeedbackcommentComment -|}; -export type FeedbackcommentComment = {| - feedback?: ?CommentfeedbackFeedback -|}; -export type CommentCreateMutationVariables = {| - input: CommentCreateInput, - first?: ?number, - orderBy?: ?$ReadOnlyArray, -|}; -export type CommentCreateMutationResponse = {| - +commentCreate: ?{| - +comment: ?{| - +friends: ?{| - +edges: ?$ReadOnlyArray - |} - |} - |} -|}; -export type CommentCreateMutationRawResponse = {| - +commentCreate: ?{| - +comment: ?{| - +friends: ?{| - +edges: ?$ReadOnlyArray - |}, - +id: string, - |} - |} -|}; -export type CommentCreateMutation = {| - variables: CommentCreateMutationVariables, - response: CommentCreateMutationResponse, - rawResponse: CommentCreateMutationRawResponse, -|}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type FeedbackFragment$ref: FragmentReference; -declare export opaque type FeedbackFragment$fragmentType: FeedbackFragment$ref; -export type FeedbackFragment = {| - +id: string, - +name: ?string, - +$refType: FeedbackFragment$ref, -|}; -export type FeedbackFragment$data = FeedbackFragment; -export type FeedbackFragment$key = { - +$data?: FeedbackFragment$data, - +$fragmentRefs: FeedbackFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FeedbackFragment$ref } from "FeedbackFragment.graphql"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type FriendFragment$ref: FragmentReference; -declare export opaque type FriendFragment$fragmentType: FriendFragment$ref; -export type FriendFragment = {| - +name: ?string, - +lastName: ?string, - +feedback: ?{| - +$fragmentRefs: FeedbackFragment$ref - |}, - +$refType: FriendFragment$ref, -|}; -export type FriendFragment$data = FriendFragment; -export type FriendFragment$key = { - +$data?: FriendFragment$data, - +$fragmentRefs: FriendFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import type { FriendFragment$ref } from "FriendFragment.graphql"; -export type CommentCreateInput = {| - clientMutationId?: ?string, - feedbackId?: ?string, - feedback?: ?CommentfeedbackFeedback, -|}; -export type CommentfeedbackFeedback = {| - comment?: ?FeedbackcommentComment -|}; -export type FeedbackcommentComment = {| - feedback?: ?CommentfeedbackFeedback -|}; -export type CommentCreateMutationVariables = {| - input: CommentCreateInput, - first?: ?number, - orderBy?: ?$ReadOnlyArray, -|}; -export type CommentCreateMutationResponse = {| - +commentCreate: ?{| - +comment: ?{| - +friends: ?{| - +edges: ?$ReadOnlyArray - |} - |} - |} -|}; -export type CommentCreateMutationRawResponse = {| - +commentCreate: ?{| - +comment: ?{| - +friends: ?{| - +edges: ?$ReadOnlyArray - |}, - +id: string, - |} - |} -|}; -export type CommentCreateMutation = {| - variables: CommentCreateMutationVariables, - response: CommentCreateMutationResponse, - rawResponse: CommentCreateMutationRawResponse, -|}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type FeedbackFragment$ref: FragmentReference; -declare export opaque type FeedbackFragment$fragmentType: FeedbackFragment$ref; -export type FeedbackFragment = {| - +id: string, - +name: ?string, - +$refType: FeedbackFragment$ref, -|}; -export type FeedbackFragment$data = FeedbackFragment; -export type FeedbackFragment$key = { - +$data?: FeedbackFragment$data, - +$fragmentRefs: FeedbackFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FeedbackFragment$ref } from "FeedbackFragment.graphql"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type FriendFragment$ref: FragmentReference; -declare export opaque type FriendFragment$fragmentType: FriendFragment$ref; -export type FriendFragment = {| - +name: ?string, - +lastName: ?string, - +feedback: ?{| - +$fragmentRefs: FeedbackFragment$ref - |}, - +$refType: FriendFragment$ref, -|}; -export type FriendFragment$data = FriendFragment; -export type FriendFragment$key = { - +$data?: FriendFragment$data, - +$fragmentRefs: FriendFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import type { FriendFragment$ref } from "FriendFragment.graphql"; -export type CommentCreateInput = {| - clientMutationId?: ?string, - feedbackId?: ?string, - feedback?: ?CommentfeedbackFeedback, -|}; -export type CommentfeedbackFeedback = {| - comment?: ?FeedbackcommentComment -|}; -export type FeedbackcommentComment = {| - feedback?: ?CommentfeedbackFeedback -|}; -export type CommentCreateMutationVariables = {| - input: CommentCreateInput, - first?: ?number, - orderBy?: ?$ReadOnlyArray, -|}; -export type CommentCreateMutationResponse = {| - +commentCreate: ?{| - +comment: ?{| - +friends: ?{| - +edges: ?$ReadOnlyArray - |} - |} - |} -|}; -export type CommentCreateMutationRawResponse = {| - +commentCreate: ?{| - +comment: ?{| - +friends: ?{| - +edges: ?$ReadOnlyArray - |}, - +id: string, - |} - |} -|}; -export type CommentCreateMutation = {| - variables: CommentCreateMutationVariables, - response: CommentCreateMutationResponse, - rawResponse: CommentCreateMutationRawResponse, -|}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type FeedbackFragment$ref: FragmentReference; -declare export opaque type FeedbackFragment$fragmentType: FeedbackFragment$ref; -export type FeedbackFragment = {| - +id: string, - +name: ?string, - +$refType: FeedbackFragment$ref, -|}; -export type FeedbackFragment$data = FeedbackFragment; -export type FeedbackFragment$key = { - +$data?: FeedbackFragment$data, - +$fragmentRefs: FeedbackFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FeedbackFragment$ref } from "FeedbackFragment.graphql"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type FriendFragment$ref: FragmentReference; -declare export opaque type FriendFragment$fragmentType: FriendFragment$ref; -export type FriendFragment = {| - +name: ?string, - +lastName: ?string, - +feedback: ?{| - +$fragmentRefs: FeedbackFragment$ref - |}, - +$refType: FriendFragment$ref, -|}; -export type FriendFragment$data = FriendFragment; -export type FriendFragment$key = { - +$data?: FriendFragment$data, - +$fragmentRefs: FriendFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import type { FriendFragment$ref } from "FriendFragment.graphql"; export type CommentCreateInput = {| clientMutationId?: ?string, diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-response-on-inline-fragments.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-response-on-inline-fragments.expected index f9f2eb2c36465..39e9f4467e901 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-response-on-inline-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-response-on-inline-fragments.expected @@ -27,269 +27,6 @@ fragment InlineFragmentWithOverlappingFields on Actor { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import type { InlineFragmentWithOverlappingFields$ref } from "InlineFragmentWithOverlappingFields.graphql"; -export type CommentCreateInput = {| - clientMutationId?: ?string, - feedbackId?: ?string, - feedback?: ?CommentfeedbackFeedback, -|}; -export type CommentfeedbackFeedback = {| - comment?: ?FeedbackcommentComment -|}; -export type FeedbackcommentComment = {| - feedback?: ?CommentfeedbackFeedback -|}; -export type TestMutationVariables = {| - input: CommentCreateInput -|}; -export type TestMutationResponse = {| - +commentCreate: ?{| - +viewer: ?{| - +actor: ?{| - +$fragmentRefs: InlineFragmentWithOverlappingFields$ref - |} - |} - |} -|}; -export type TestMutationRawResponse = {| - +commentCreate: ?{| - +viewer: ?{| - +actor: ?({| - +__typename: "User", - +__isActor: "User", - +id: string, - +hometown: ?{| - +id: string, - +name: ?string, - |}, - |} | {| - +__typename: "Page", - +__isActor: "Page", - +id: string, - +name: ?string, - +hometown: ?{| - +id: string, - +message: ?{| - +text: ?string - |}, - |}, - |} | {| - +__typename: string, - +__isActor: string, - +id: string, - |}) - |} - |} -|}; -export type TestMutation = {| - variables: TestMutationVariables, - response: TestMutationResponse, - rawResponse: TestMutationRawResponse, -|}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type InlineFragmentWithOverlappingFields$ref: FragmentReference; -declare export opaque type InlineFragmentWithOverlappingFields$fragmentType: InlineFragmentWithOverlappingFields$ref; -export type InlineFragmentWithOverlappingFields = {| - +hometown?: ?{| - +id: string, - +name: ?string, - +message?: ?{| - +text: ?string - |}, - |}, - +name?: ?string, - +$refType: InlineFragmentWithOverlappingFields$ref, -|}; -export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; -export type InlineFragmentWithOverlappingFields$key = { - +$data?: InlineFragmentWithOverlappingFields$data, - +$fragmentRefs: InlineFragmentWithOverlappingFields$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import type { InlineFragmentWithOverlappingFields$ref } from "InlineFragmentWithOverlappingFields.graphql"; -export type CommentCreateInput = {| - clientMutationId?: ?string, - feedbackId?: ?string, - feedback?: ?CommentfeedbackFeedback, -|}; -export type CommentfeedbackFeedback = {| - comment?: ?FeedbackcommentComment -|}; -export type FeedbackcommentComment = {| - feedback?: ?CommentfeedbackFeedback -|}; -export type TestMutationVariables = {| - input: CommentCreateInput -|}; -export type TestMutationResponse = {| - +commentCreate: ?{| - +viewer: ?{| - +actor: ?{| - +$fragmentRefs: InlineFragmentWithOverlappingFields$ref - |} - |} - |} -|}; -export type TestMutationRawResponse = {| - +commentCreate: ?{| - +viewer: ?{| - +actor: ?({| - +__typename: "User", - +__isActor: "User", - +id: string, - +hometown: ?{| - +id: string, - +name: ?string, - |}, - |} | {| - +__typename: "Page", - +__isActor: "Page", - +id: string, - +name: ?string, - +hometown: ?{| - +id: string, - +message: ?{| - +text: ?string - |}, - |}, - |} | {| - +__typename: string, - +__isActor: string, - +id: string, - |}) - |} - |} -|}; -export type TestMutation = {| - variables: TestMutationVariables, - response: TestMutationResponse, - rawResponse: TestMutationRawResponse, -|}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type InlineFragmentWithOverlappingFields$ref: FragmentReference; -declare export opaque type InlineFragmentWithOverlappingFields$fragmentType: InlineFragmentWithOverlappingFields$ref; -export type InlineFragmentWithOverlappingFields = {| - +hometown?: ?{| - +id: string, - +name: ?string, - +message?: ?{| - +text: ?string - |}, - |}, - +name?: ?string, - +$refType: InlineFragmentWithOverlappingFields$ref, -|}; -export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; -export type InlineFragmentWithOverlappingFields$key = { - +$data?: InlineFragmentWithOverlappingFields$data, - +$fragmentRefs: InlineFragmentWithOverlappingFields$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import type { InlineFragmentWithOverlappingFields$ref } from "InlineFragmentWithOverlappingFields.graphql"; -export type CommentCreateInput = {| - clientMutationId?: ?string, - feedbackId?: ?string, - feedback?: ?CommentfeedbackFeedback, -|}; -export type CommentfeedbackFeedback = {| - comment?: ?FeedbackcommentComment -|}; -export type FeedbackcommentComment = {| - feedback?: ?CommentfeedbackFeedback -|}; -export type TestMutationVariables = {| - input: CommentCreateInput -|}; -export type TestMutationResponse = {| - +commentCreate: ?{| - +viewer: ?{| - +actor: ?{| - +$fragmentRefs: InlineFragmentWithOverlappingFields$ref - |} - |} - |} -|}; -export type TestMutationRawResponse = {| - +commentCreate: ?{| - +viewer: ?{| - +actor: ?({| - +__typename: "User", - +__isActor: "User", - +id: string, - +hometown: ?{| - +id: string, - +name: ?string, - |}, - |} | {| - +__typename: "Page", - +__isActor: "Page", - +id: string, - +name: ?string, - +hometown: ?{| - +id: string, - +message: ?{| - +text: ?string - |}, - |}, - |} | {| - +__typename: string, - +__isActor: string, - +id: string, - |}) - |} - |} -|}; -export type TestMutation = {| - variables: TestMutationVariables, - response: TestMutationResponse, - rawResponse: TestMutationRawResponse, -|}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type InlineFragmentWithOverlappingFields$ref: FragmentReference; -declare export opaque type InlineFragmentWithOverlappingFields$fragmentType: InlineFragmentWithOverlappingFields$ref; -export type InlineFragmentWithOverlappingFields = {| - +hometown?: ?{| - +id: string, - +name: ?string, - +message?: ?{| - +text: ?string - |}, - |}, - +name?: ?string, - +$refType: InlineFragmentWithOverlappingFields$ref, -|}; -export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; -export type InlineFragmentWithOverlappingFields$key = { - +$data?: InlineFragmentWithOverlappingFields$data, - +$fragmentRefs: InlineFragmentWithOverlappingFields$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import type { InlineFragmentWithOverlappingFields$ref } from "InlineFragmentWithOverlappingFields.graphql"; export type CommentCreateInput = {| clientMutationId?: ?string, diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation.expected index eb5043a8a1a7b..73dfff5c2df67 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation.expected @@ -15,122 +15,6 @@ mutation CommentCreateMutation( } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type CommentCreateInput = {| - clientMutationId?: ?string, - feedbackId?: ?string, - feedback?: ?CommentfeedbackFeedback, -|}; -export type CommentfeedbackFeedback = {| - comment?: ?FeedbackcommentComment -|}; -export type FeedbackcommentComment = {| - feedback?: ?CommentfeedbackFeedback -|}; -export type CommentCreateMutationVariables = {| - input: CommentCreateInput, - first?: ?number, - orderBy?: ?$ReadOnlyArray, -|}; -export type CommentCreateMutationResponse = {| - +commentCreate: ?{| - +comment: ?{| - +id: string, - +name: ?string, - +friends: ?{| - +count: ?number - |}, - |} - |} -|}; -export type CommentCreateMutation = {| - variables: CommentCreateMutationVariables, - response: CommentCreateMutationResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type CommentCreateInput = {| - clientMutationId?: ?string, - feedbackId?: ?string, - feedback?: ?CommentfeedbackFeedback, -|}; -export type CommentfeedbackFeedback = {| - comment?: ?FeedbackcommentComment -|}; -export type FeedbackcommentComment = {| - feedback?: ?CommentfeedbackFeedback -|}; -export type CommentCreateMutationVariables = {| - input: CommentCreateInput, - first?: ?number, - orderBy?: ?$ReadOnlyArray, -|}; -export type CommentCreateMutationResponse = {| - +commentCreate: ?{| - +comment: ?{| - +id: string, - +name: ?string, - +friends: ?{| - +count: ?number - |}, - |} - |} -|}; -export type CommentCreateMutation = {| - variables: CommentCreateMutationVariables, - response: CommentCreateMutationResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type CommentCreateInput = {| - clientMutationId?: ?string, - feedbackId?: ?string, - feedback?: ?CommentfeedbackFeedback, -|}; -export type CommentfeedbackFeedback = {| - comment?: ?FeedbackcommentComment -|}; -export type FeedbackcommentComment = {| - feedback?: ?CommentfeedbackFeedback -|}; -export type CommentCreateMutationVariables = {| - input: CommentCreateInput, - first?: ?number, - orderBy?: ?$ReadOnlyArray, -|}; -export type CommentCreateMutationResponse = {| - +commentCreate: ?{| - +comment: ?{| - +id: string, - +name: ?string, - +friends: ?{| - +count: ?number - |}, - |} - |} -|}; -export type CommentCreateMutation = {| - variables: CommentCreateMutationVariables, - response: CommentCreateMutationResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type CommentCreateInput = {| clientMutationId?: ?string, feedbackId?: ?string, diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/plural-fragment.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/plural-fragment.expected index f1d8853d4f1fc..fdae8055b13dd 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/plural-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/plural-fragment.expected @@ -3,68 +3,6 @@ fragment PluralFragment on Node @relay(plural: true) { id } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type PluralFragment$ref: FragmentReference; -declare export opaque type PluralFragment$fragmentType: PluralFragment$ref; -export type PluralFragment = $ReadOnlyArray<{| - +id: string, - +$refType: PluralFragment$ref, -|}>; -export type PluralFragment$data = PluralFragment; -export type PluralFragment$key = $ReadOnlyArray<{ - +$data?: PluralFragment$data, - +$fragmentRefs: PluralFragment$ref, - ... -}>; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type PluralFragment$ref: FragmentReference; -declare export opaque type PluralFragment$fragmentType: PluralFragment$ref; -export type PluralFragment = $ReadOnlyArray<{| - +id: string, - +$refType: PluralFragment$ref, -|}>; -export type PluralFragment$data = PluralFragment; -export type PluralFragment$key = $ReadOnlyArray<{ - +$data?: PluralFragment$data, - +$fragmentRefs: PluralFragment$ref, - ... -}>; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type PluralFragment$ref: FragmentReference; -declare export opaque type PluralFragment$fragmentType: PluralFragment$ref; -export type PluralFragment = $ReadOnlyArray<{| - +id: string, - +$refType: PluralFragment$ref, -|}>; -export type PluralFragment$data = PluralFragment; -export type PluralFragment$key = $ReadOnlyArray<{ - +$data?: PluralFragment$data, - +$fragmentRefs: PluralFragment$ref, - ... -}>; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import type { FragmentReference } from "relay-runtime"; declare export opaque type PluralFragment$ref: FragmentReference; declare export opaque type PluralFragment$fragmentType: PluralFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-handles.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-handles.expected index b66e2cf7b64a8..54fdc48eb8006 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-handles.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-handles.expected @@ -17,182 +17,6 @@ query ScalarHandleField($id: ID!) @raw_response_type { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type LinkedHandleFieldVariables = {| - id: string -|}; -export type LinkedHandleFieldResponse = {| - +node: ?{| - +friends?: ?{| - +count: ?number - |} - |} -|}; -export type LinkedHandleFieldRawResponse = {| - +node: ?({| - +__typename: "User", - +id: string, - +friends: ?{| - +count: ?number - |}, - |} | {| - +__typename: string, - +id: string, - |}) -|}; -export type LinkedHandleField = {| - variables: LinkedHandleFieldVariables, - response: LinkedHandleFieldResponse, - rawResponse: LinkedHandleFieldRawResponse, -|}; -------------------------------------------------------------------------------- -export type ScalarHandleFieldVariables = {| - id: string -|}; -export type ScalarHandleFieldResponse = {| - +node: ?{| - +name?: ?string - |} -|}; -export type ScalarHandleFieldRawResponse = {| - +node: ?({| - +__typename: "User", - +id: string, - +name: ?string, - |} | {| - +__typename: string, - +id: string, - |}) -|}; -export type ScalarHandleField = {| - variables: ScalarHandleFieldVariables, - response: ScalarHandleFieldResponse, - rawResponse: ScalarHandleFieldRawResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type LinkedHandleFieldVariables = {| - id: string -|}; -export type LinkedHandleFieldResponse = {| - +node: ?{| - +friends?: ?{| - +count: ?number - |} - |} -|}; -export type LinkedHandleFieldRawResponse = {| - +node: ?({| - +__typename: "User", - +id: string, - +friends: ?{| - +count: ?number - |}, - |} | {| - +__typename: string, - +id: string, - |}) -|}; -export type LinkedHandleField = {| - variables: LinkedHandleFieldVariables, - response: LinkedHandleFieldResponse, - rawResponse: LinkedHandleFieldRawResponse, -|}; -------------------------------------------------------------------------------- -export type ScalarHandleFieldVariables = {| - id: string -|}; -export type ScalarHandleFieldResponse = {| - +node: ?{| - +name?: ?string - |} -|}; -export type ScalarHandleFieldRawResponse = {| - +node: ?({| - +__typename: "User", - +id: string, - +name: ?string, - |} | {| - +__typename: string, - +id: string, - |}) -|}; -export type ScalarHandleField = {| - variables: ScalarHandleFieldVariables, - response: ScalarHandleFieldResponse, - rawResponse: ScalarHandleFieldRawResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type LinkedHandleFieldVariables = {| - id: string -|}; -export type LinkedHandleFieldResponse = {| - +node: ?{| - +friends?: ?{| - +count: ?number - |} - |} -|}; -export type LinkedHandleFieldRawResponse = {| - +node: ?({| - +__typename: "User", - +id: string, - +friends: ?{| - +count: ?number - |}, - |} | {| - +__typename: string, - +id: string, - |}) -|}; -export type LinkedHandleField = {| - variables: LinkedHandleFieldVariables, - response: LinkedHandleFieldResponse, - rawResponse: LinkedHandleFieldRawResponse, -|}; -------------------------------------------------------------------------------- -export type ScalarHandleFieldVariables = {| - id: string -|}; -export type ScalarHandleFieldResponse = {| - +node: ?{| - +name?: ?string - |} -|}; -export type ScalarHandleFieldRawResponse = {| - +node: ?({| - +__typename: "User", - +id: string, - +name: ?string, - |} | {| - +__typename: string, - +id: string, - |}) -|}; -export type ScalarHandleField = {| - variables: ScalarHandleFieldVariables, - response: ScalarHandleFieldResponse, - rawResponse: ScalarHandleFieldRawResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type LinkedHandleFieldVariables = {| id: string |}; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-match-fields.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-match-fields.expected index 75a8f30e484a9..b4a44c8a7cf66 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-match-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-match-fields.expected @@ -28,359 +28,6 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import type { Local3DPayload } from "relay-runtime"; -import type { NameRendererFragment$ref } from "NameRendererFragment.graphql"; -export type TestVariables = {||}; -export type TestResponse = {| - +node: ?{| - +$fragmentRefs: NameRendererFragment$ref - |} -|}; -export type PlainUserNameRenderer_name = {| - +plaintext: ?string, - +data: ?{| - +text: ?string, - +id: ?string, - |}, -|}; -export type MarkdownUserNameRenderer_name = {| - +markdown: ?string, - +data: ?{| - +markup: ?string, - +id: ?string, - |}, -|}; -export type TestRawResponse = {| - +node: ?({| - +__typename: "User", - +id: string, - +nameRenderer: ?({| - +__typename: "PlainUserNameRenderer", - +__module_operation_NameRendererFragment: ?any, - +__module_component_NameRendererFragment: ?any, - ...PlainUserNameRenderer_name, - |} | Local3DPayload<"NameRendererFragment", {| - +__typename: "PlainUserNameRenderer", - ...PlainUserNameRenderer_name, - |}> | {| - +__typename: "MarkdownUserNameRenderer", - +__module_operation_NameRendererFragment: ?any, - +__module_component_NameRendererFragment: ?any, - ...MarkdownUserNameRenderer_name, - |} | Local3DPayload<"NameRendererFragment", {| - +__typename: "MarkdownUserNameRenderer", - ...MarkdownUserNameRenderer_name, - |}> | {| - +__typename: string - |}), - |} | {| - +__typename: string, - +id: string, - |}) -|}; -export type Test = {| - variables: TestVariables, - response: TestResponse, - rawResponse: TestRawResponse, -|}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type MarkdownUserNameRenderer_name$ref: FragmentReference; -declare export opaque type MarkdownUserNameRenderer_name$fragmentType: MarkdownUserNameRenderer_name$ref; -export type MarkdownUserNameRenderer_name = {| - +markdown: ?string, - +data: ?{| - +markup: ?string - |}, - +$refType: MarkdownUserNameRenderer_name$ref, -|}; -export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; -export type MarkdownUserNameRenderer_name$key = { - +$data?: MarkdownUserNameRenderer_name$data, - +$fragmentRefs: MarkdownUserNameRenderer_name$ref, - ... -}; -------------------------------------------------------------------------------- -import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; -import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type NameRendererFragment$ref: FragmentReference; -declare export opaque type NameRendererFragment$fragmentType: NameRendererFragment$ref; -export type NameRendererFragment = {| - +id: string, - +nameRenderer: ?{| - +__fragmentPropName?: ?string, - +__module_component?: ?string, - +$fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, - |}, - +$refType: NameRendererFragment$ref, -|}; -export type NameRendererFragment$data = NameRendererFragment; -export type NameRendererFragment$key = { - +$data?: NameRendererFragment$data, - +$fragmentRefs: NameRendererFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type PlainUserNameRenderer_name$ref: FragmentReference; -declare export opaque type PlainUserNameRenderer_name$fragmentType: PlainUserNameRenderer_name$ref; -export type PlainUserNameRenderer_name = {| - +plaintext: ?string, - +data: ?{| - +text: ?string - |}, - +$refType: PlainUserNameRenderer_name$ref, -|}; -export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; -export type PlainUserNameRenderer_name$key = { - +$data?: PlainUserNameRenderer_name$data, - +$fragmentRefs: PlainUserNameRenderer_name$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import type { Local3DPayload } from "relay-runtime"; -import type { NameRendererFragment$ref } from "NameRendererFragment.graphql"; -export type TestVariables = {||}; -export type TestResponse = {| - +node: ?{| - +$fragmentRefs: NameRendererFragment$ref - |} -|}; -export type PlainUserNameRenderer_name = {| - +plaintext: ?string, - +data: ?{| - +text: ?string, - +id: ?string, - |}, -|}; -export type MarkdownUserNameRenderer_name = {| - +markdown: ?string, - +data: ?{| - +markup: ?string, - +id: ?string, - |}, -|}; -export type TestRawResponse = {| - +node: ?({| - +__typename: "User", - +id: string, - +nameRenderer: ?({| - +__typename: "PlainUserNameRenderer", - +__module_operation_NameRendererFragment: ?any, - +__module_component_NameRendererFragment: ?any, - ...PlainUserNameRenderer_name, - |} | Local3DPayload<"NameRendererFragment", {| - +__typename: "PlainUserNameRenderer", - ...PlainUserNameRenderer_name, - |}> | {| - +__typename: "MarkdownUserNameRenderer", - +__module_operation_NameRendererFragment: ?any, - +__module_component_NameRendererFragment: ?any, - ...MarkdownUserNameRenderer_name, - |} | Local3DPayload<"NameRendererFragment", {| - +__typename: "MarkdownUserNameRenderer", - ...MarkdownUserNameRenderer_name, - |}> | {| - +__typename: string - |}), - |} | {| - +__typename: string, - +id: string, - |}) -|}; -export type Test = {| - variables: TestVariables, - response: TestResponse, - rawResponse: TestRawResponse, -|}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type MarkdownUserNameRenderer_name$ref: FragmentReference; -declare export opaque type MarkdownUserNameRenderer_name$fragmentType: MarkdownUserNameRenderer_name$ref; -export type MarkdownUserNameRenderer_name = {| - +markdown: ?string, - +data: ?{| - +markup: ?string - |}, - +$refType: MarkdownUserNameRenderer_name$ref, -|}; -export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; -export type MarkdownUserNameRenderer_name$key = { - +$data?: MarkdownUserNameRenderer_name$data, - +$fragmentRefs: MarkdownUserNameRenderer_name$ref, - ... -}; -------------------------------------------------------------------------------- -import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; -import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type NameRendererFragment$ref: FragmentReference; -declare export opaque type NameRendererFragment$fragmentType: NameRendererFragment$ref; -export type NameRendererFragment = {| - +id: string, - +nameRenderer: ?{| - +__fragmentPropName?: ?string, - +__module_component?: ?string, - +$fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, - |}, - +$refType: NameRendererFragment$ref, -|}; -export type NameRendererFragment$data = NameRendererFragment; -export type NameRendererFragment$key = { - +$data?: NameRendererFragment$data, - +$fragmentRefs: NameRendererFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type PlainUserNameRenderer_name$ref: FragmentReference; -declare export opaque type PlainUserNameRenderer_name$fragmentType: PlainUserNameRenderer_name$ref; -export type PlainUserNameRenderer_name = {| - +plaintext: ?string, - +data: ?{| - +text: ?string - |}, - +$refType: PlainUserNameRenderer_name$ref, -|}; -export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; -export type PlainUserNameRenderer_name$key = { - +$data?: PlainUserNameRenderer_name$data, - +$fragmentRefs: PlainUserNameRenderer_name$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import type { Local3DPayload } from "relay-runtime"; -import type { NameRendererFragment$ref } from "NameRendererFragment.graphql"; -export type TestVariables = {||}; -export type TestResponse = {| - +node: ?{| - +$fragmentRefs: NameRendererFragment$ref - |} -|}; -export type PlainUserNameRenderer_name = {| - +plaintext: ?string, - +data: ?{| - +text: ?string, - +id: ?string, - |}, -|}; -export type MarkdownUserNameRenderer_name = {| - +markdown: ?string, - +data: ?{| - +markup: ?string, - +id: ?string, - |}, -|}; -export type TestRawResponse = {| - +node: ?({| - +__typename: "User", - +id: string, - +nameRenderer: ?({| - +__typename: "PlainUserNameRenderer", - +__module_operation_NameRendererFragment: ?any, - +__module_component_NameRendererFragment: ?any, - ...PlainUserNameRenderer_name, - |} | Local3DPayload<"NameRendererFragment", {| - +__typename: "PlainUserNameRenderer", - ...PlainUserNameRenderer_name, - |}> | {| - +__typename: "MarkdownUserNameRenderer", - +__module_operation_NameRendererFragment: ?any, - +__module_component_NameRendererFragment: ?any, - ...MarkdownUserNameRenderer_name, - |} | Local3DPayload<"NameRendererFragment", {| - +__typename: "MarkdownUserNameRenderer", - ...MarkdownUserNameRenderer_name, - |}> | {| - +__typename: string - |}), - |} | {| - +__typename: string, - +id: string, - |}) -|}; -export type Test = {| - variables: TestVariables, - response: TestResponse, - rawResponse: TestRawResponse, -|}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type MarkdownUserNameRenderer_name$ref: FragmentReference; -declare export opaque type MarkdownUserNameRenderer_name$fragmentType: MarkdownUserNameRenderer_name$ref; -export type MarkdownUserNameRenderer_name = {| - +markdown: ?string, - +data: ?{| - +markup: ?string - |}, - +$refType: MarkdownUserNameRenderer_name$ref, -|}; -export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; -export type MarkdownUserNameRenderer_name$key = { - +$data?: MarkdownUserNameRenderer_name$data, - +$fragmentRefs: MarkdownUserNameRenderer_name$ref, - ... -}; -------------------------------------------------------------------------------- -import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; -import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type NameRendererFragment$ref: FragmentReference; -declare export opaque type NameRendererFragment$fragmentType: NameRendererFragment$ref; -export type NameRendererFragment = {| - +id: string, - +nameRenderer: ?{| - +__fragmentPropName?: ?string, - +__module_component?: ?string, - +$fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, - |}, - +$refType: NameRendererFragment$ref, -|}; -export type NameRendererFragment$data = NameRendererFragment; -export type NameRendererFragment$key = { - +$data?: NameRendererFragment$data, - +$fragmentRefs: NameRendererFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type PlainUserNameRenderer_name$ref: FragmentReference; -declare export opaque type PlainUserNameRenderer_name$fragmentType: PlainUserNameRenderer_name$ref; -export type PlainUserNameRenderer_name = {| - +plaintext: ?string, - +data: ?{| - +text: ?string - |}, - +$refType: PlainUserNameRenderer_name$ref, -|}; -export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; -export type PlainUserNameRenderer_name$key = { - +$data?: PlainUserNameRenderer_name$data, - +$fragmentRefs: PlainUserNameRenderer_name$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import type { Local3DPayload } from "relay-runtime"; import type { NameRendererFragment$ref } from "NameRendererFragment.graphql"; export type TestVariables = {||}; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-module-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-module-field.expected index 8e763eab0bfb2..2f71e93af88bc 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-module-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-module-field.expected @@ -17,236 +17,6 @@ fragment Test_userRenderer on PlainUserRenderer { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import type { Local3DPayload } from "relay-runtime"; -import type { Test_user$ref } from "Test_user.graphql"; -export type TestVariables = {||}; -export type TestResponse = {| - +node: ?{| - +$fragmentRefs: Test_user$ref - |} -|}; -export type Test_userRenderer = {| - +user: ?{| - +username: ?string, - +id: string, - |} -|}; -export type TestRawResponse = {| - +node: ?({| - +__typename: "User", - +id: string, - +plainUserRenderer: ?({| - +__module_operation_Test_user: ?any, - +__module_component_Test_user: ?any, - ...Test_userRenderer, - |} | Local3DPayload<"Test_user", {| ...Test_userRenderer - |}>), - |} | {| - +__typename: string, - +id: string, - |}) -|}; -export type Test = {| - variables: TestVariables, - response: TestResponse, - rawResponse: TestRawResponse, -|}; -------------------------------------------------------------------------------- -import type { Test_userRenderer$ref } from "Test_userRenderer.graphql"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type Test_user$ref: FragmentReference; -declare export opaque type Test_user$fragmentType: Test_user$ref; -export type Test_user = {| - +plainUserRenderer: ?{| - +__fragmentPropName?: ?string, - +__module_component?: ?string, - +$fragmentRefs: Test_userRenderer$ref, - |}, - +$refType: Test_user$ref, -|}; -export type Test_user$data = Test_user; -export type Test_user$key = { - +$data?: Test_user$data, - +$fragmentRefs: Test_user$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type Test_userRenderer$ref: FragmentReference; -declare export opaque type Test_userRenderer$fragmentType: Test_userRenderer$ref; -export type Test_userRenderer = {| - +user: ?{| - +username: ?string - |}, - +$refType: Test_userRenderer$ref, -|}; -export type Test_userRenderer$data = Test_userRenderer; -export type Test_userRenderer$key = { - +$data?: Test_userRenderer$data, - +$fragmentRefs: Test_userRenderer$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import type { Local3DPayload } from "relay-runtime"; -import type { Test_user$ref } from "Test_user.graphql"; -export type TestVariables = {||}; -export type TestResponse = {| - +node: ?{| - +$fragmentRefs: Test_user$ref - |} -|}; -export type Test_userRenderer = {| - +user: ?{| - +username: ?string, - +id: string, - |} -|}; -export type TestRawResponse = {| - +node: ?({| - +__typename: "User", - +id: string, - +plainUserRenderer: ?({| - +__module_operation_Test_user: ?any, - +__module_component_Test_user: ?any, - ...Test_userRenderer, - |} | Local3DPayload<"Test_user", {| ...Test_userRenderer - |}>), - |} | {| - +__typename: string, - +id: string, - |}) -|}; -export type Test = {| - variables: TestVariables, - response: TestResponse, - rawResponse: TestRawResponse, -|}; -------------------------------------------------------------------------------- -import type { Test_userRenderer$ref } from "Test_userRenderer.graphql"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type Test_user$ref: FragmentReference; -declare export opaque type Test_user$fragmentType: Test_user$ref; -export type Test_user = {| - +plainUserRenderer: ?{| - +__fragmentPropName?: ?string, - +__module_component?: ?string, - +$fragmentRefs: Test_userRenderer$ref, - |}, - +$refType: Test_user$ref, -|}; -export type Test_user$data = Test_user; -export type Test_user$key = { - +$data?: Test_user$data, - +$fragmentRefs: Test_user$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type Test_userRenderer$ref: FragmentReference; -declare export opaque type Test_userRenderer$fragmentType: Test_userRenderer$ref; -export type Test_userRenderer = {| - +user: ?{| - +username: ?string - |}, - +$refType: Test_userRenderer$ref, -|}; -export type Test_userRenderer$data = Test_userRenderer; -export type Test_userRenderer$key = { - +$data?: Test_userRenderer$data, - +$fragmentRefs: Test_userRenderer$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import type { Local3DPayload } from "relay-runtime"; -import type { Test_user$ref } from "Test_user.graphql"; -export type TestVariables = {||}; -export type TestResponse = {| - +node: ?{| - +$fragmentRefs: Test_user$ref - |} -|}; -export type Test_userRenderer = {| - +user: ?{| - +username: ?string, - +id: string, - |} -|}; -export type TestRawResponse = {| - +node: ?({| - +__typename: "User", - +id: string, - +plainUserRenderer: ?({| - +__module_operation_Test_user: ?any, - +__module_component_Test_user: ?any, - ...Test_userRenderer, - |} | Local3DPayload<"Test_user", {| ...Test_userRenderer - |}>), - |} | {| - +__typename: string, - +id: string, - |}) -|}; -export type Test = {| - variables: TestVariables, - response: TestResponse, - rawResponse: TestRawResponse, -|}; -------------------------------------------------------------------------------- -import type { Test_userRenderer$ref } from "Test_userRenderer.graphql"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type Test_user$ref: FragmentReference; -declare export opaque type Test_user$fragmentType: Test_user$ref; -export type Test_user = {| - +plainUserRenderer: ?{| - +__fragmentPropName?: ?string, - +__module_component?: ?string, - +$fragmentRefs: Test_userRenderer$ref, - |}, - +$refType: Test_user$ref, -|}; -export type Test_user$data = Test_user; -export type Test_user$key = { - +$data?: Test_user$data, - +$fragmentRefs: Test_user$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type Test_userRenderer$ref: FragmentReference; -declare export opaque type Test_userRenderer$fragmentType: Test_userRenderer$ref; -export type Test_userRenderer = {| - +user: ?{| - +username: ?string - |}, - +$refType: Test_userRenderer$ref, -|}; -export type Test_userRenderer$data = Test_userRenderer; -export type Test_userRenderer$key = { - +$data?: Test_userRenderer$data, - +$fragmentRefs: Test_userRenderer$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import type { Local3DPayload } from "relay-runtime"; import type { Test_user$ref } from "Test_user.graphql"; export type TestVariables = {||}; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-multiple-match-fields.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-multiple-match-fields.expected index 1b03f162c9733..9aca04648dca8 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-multiple-match-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-multiple-match-fields.expected @@ -48,536 +48,6 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import type { Local3DPayload } from "relay-runtime"; -import type { AnotherNameRendererFragment$ref } from "AnotherNameRendererFragment.graphql"; -import type { NameRendererFragment$ref } from "NameRendererFragment.graphql"; -export type TestVariables = {||}; -export type TestResponse = {| - +node: ?{| - +username?: ?string, - +$fragmentRefs: NameRendererFragment$ref, - |}, - +viewer: ?{| - +actor: ?{| - +name?: ?string, - +$fragmentRefs: AnotherNameRendererFragment$ref, - |} - |}, -|}; -export type PlainUserNameRenderer_name = {| - +plaintext: ?string, - +data: ?{| - +text: ?string, - +id: ?string, - |}, -|}; -export type MarkdownUserNameRenderer_name = {| - +markdown: ?string, - +data: ?{| - +markup: ?string, - +id: ?string, - |}, -|}; -export type TestRawResponse = {| - +node: ?({| - +__typename: "User", - +id: string, - +username: ?string, - +nameRenderer: ?({| - +__typename: "PlainUserNameRenderer", - +__module_operation_NameRendererFragment: ?any, - +__module_component_NameRendererFragment: ?any, - ...PlainUserNameRenderer_name, - |} | Local3DPayload<"NameRendererFragment", {| - +__typename: "PlainUserNameRenderer", - ...PlainUserNameRenderer_name, - |}> | {| - +__typename: "MarkdownUserNameRenderer", - +__module_operation_NameRendererFragment: ?any, - +__module_component_NameRendererFragment: ?any, - ...MarkdownUserNameRenderer_name, - |} | Local3DPayload<"NameRendererFragment", {| - +__typename: "MarkdownUserNameRenderer", - ...MarkdownUserNameRenderer_name, - |}> | {| - +__typename: string - |}), - |} | {| - +__typename: string, - +id: string, - |}), - +viewer: ?{| - +actor: ?({| - +__typename: "User", - +id: string, - +name: ?string, - +nameRenderer: ?({| - +__typename: "PlainUserNameRenderer", - +__module_operation_AnotherNameRendererFragment: ?any, - +__module_component_AnotherNameRendererFragment: ?any, - ...PlainUserNameRenderer_name, - |} | Local3DPayload<"AnotherNameRendererFragment", {| - +__typename: "PlainUserNameRenderer", - ...PlainUserNameRenderer_name, - |}> | {| - +__typename: "MarkdownUserNameRenderer", - +__module_operation_AnotherNameRendererFragment: ?any, - +__module_component_AnotherNameRendererFragment: ?any, - ...MarkdownUserNameRenderer_name, - |} | Local3DPayload<"AnotherNameRendererFragment", {| - +__typename: "MarkdownUserNameRenderer", - ...MarkdownUserNameRenderer_name, - |}> | {| - +__typename: string - |}), - |} | {| - +__typename: string, - +id: string, - |}) - |}, -|}; -export type Test = {| - variables: TestVariables, - response: TestResponse, - rawResponse: TestRawResponse, -|}; -------------------------------------------------------------------------------- -import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; -import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type AnotherNameRendererFragment$ref: FragmentReference; -declare export opaque type AnotherNameRendererFragment$fragmentType: AnotherNameRendererFragment$ref; -export type AnotherNameRendererFragment = {| - +name: ?string, - +nameRenderer: ?{| - +__fragmentPropName?: ?string, - +__module_component?: ?string, - +$fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, - |}, - +$refType: AnotherNameRendererFragment$ref, -|}; -export type AnotherNameRendererFragment$data = AnotherNameRendererFragment; -export type AnotherNameRendererFragment$key = { - +$data?: AnotherNameRendererFragment$data, - +$fragmentRefs: AnotherNameRendererFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type MarkdownUserNameRenderer_name$ref: FragmentReference; -declare export opaque type MarkdownUserNameRenderer_name$fragmentType: MarkdownUserNameRenderer_name$ref; -export type MarkdownUserNameRenderer_name = {| - +markdown: ?string, - +data: ?{| - +markup: ?string - |}, - +$refType: MarkdownUserNameRenderer_name$ref, -|}; -export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; -export type MarkdownUserNameRenderer_name$key = { - +$data?: MarkdownUserNameRenderer_name$data, - +$fragmentRefs: MarkdownUserNameRenderer_name$ref, - ... -}; -------------------------------------------------------------------------------- -import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; -import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type NameRendererFragment$ref: FragmentReference; -declare export opaque type NameRendererFragment$fragmentType: NameRendererFragment$ref; -export type NameRendererFragment = {| - +id: string, - +nameRenderer: ?{| - +__fragmentPropName?: ?string, - +__module_component?: ?string, - +$fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, - |}, - +$refType: NameRendererFragment$ref, -|}; -export type NameRendererFragment$data = NameRendererFragment; -export type NameRendererFragment$key = { - +$data?: NameRendererFragment$data, - +$fragmentRefs: NameRendererFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type PlainUserNameRenderer_name$ref: FragmentReference; -declare export opaque type PlainUserNameRenderer_name$fragmentType: PlainUserNameRenderer_name$ref; -export type PlainUserNameRenderer_name = {| - +plaintext: ?string, - +data: ?{| - +text: ?string - |}, - +$refType: PlainUserNameRenderer_name$ref, -|}; -export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; -export type PlainUserNameRenderer_name$key = { - +$data?: PlainUserNameRenderer_name$data, - +$fragmentRefs: PlainUserNameRenderer_name$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import type { Local3DPayload } from "relay-runtime"; -import type { AnotherNameRendererFragment$ref } from "AnotherNameRendererFragment.graphql"; -import type { NameRendererFragment$ref } from "NameRendererFragment.graphql"; -export type TestVariables = {||}; -export type TestResponse = {| - +node: ?{| - +username?: ?string, - +$fragmentRefs: NameRendererFragment$ref, - |}, - +viewer: ?{| - +actor: ?{| - +name?: ?string, - +$fragmentRefs: AnotherNameRendererFragment$ref, - |} - |}, -|}; -export type PlainUserNameRenderer_name = {| - +plaintext: ?string, - +data: ?{| - +text: ?string, - +id: ?string, - |}, -|}; -export type MarkdownUserNameRenderer_name = {| - +markdown: ?string, - +data: ?{| - +markup: ?string, - +id: ?string, - |}, -|}; -export type TestRawResponse = {| - +node: ?({| - +__typename: "User", - +id: string, - +username: ?string, - +nameRenderer: ?({| - +__typename: "PlainUserNameRenderer", - +__module_operation_NameRendererFragment: ?any, - +__module_component_NameRendererFragment: ?any, - ...PlainUserNameRenderer_name, - |} | Local3DPayload<"NameRendererFragment", {| - +__typename: "PlainUserNameRenderer", - ...PlainUserNameRenderer_name, - |}> | {| - +__typename: "MarkdownUserNameRenderer", - +__module_operation_NameRendererFragment: ?any, - +__module_component_NameRendererFragment: ?any, - ...MarkdownUserNameRenderer_name, - |} | Local3DPayload<"NameRendererFragment", {| - +__typename: "MarkdownUserNameRenderer", - ...MarkdownUserNameRenderer_name, - |}> | {| - +__typename: string - |}), - |} | {| - +__typename: string, - +id: string, - |}), - +viewer: ?{| - +actor: ?({| - +__typename: "User", - +id: string, - +name: ?string, - +nameRenderer: ?({| - +__typename: "PlainUserNameRenderer", - +__module_operation_AnotherNameRendererFragment: ?any, - +__module_component_AnotherNameRendererFragment: ?any, - ...PlainUserNameRenderer_name, - |} | Local3DPayload<"AnotherNameRendererFragment", {| - +__typename: "PlainUserNameRenderer", - ...PlainUserNameRenderer_name, - |}> | {| - +__typename: "MarkdownUserNameRenderer", - +__module_operation_AnotherNameRendererFragment: ?any, - +__module_component_AnotherNameRendererFragment: ?any, - ...MarkdownUserNameRenderer_name, - |} | Local3DPayload<"AnotherNameRendererFragment", {| - +__typename: "MarkdownUserNameRenderer", - ...MarkdownUserNameRenderer_name, - |}> | {| - +__typename: string - |}), - |} | {| - +__typename: string, - +id: string, - |}) - |}, -|}; -export type Test = {| - variables: TestVariables, - response: TestResponse, - rawResponse: TestRawResponse, -|}; -------------------------------------------------------------------------------- -import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; -import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type AnotherNameRendererFragment$ref: FragmentReference; -declare export opaque type AnotherNameRendererFragment$fragmentType: AnotherNameRendererFragment$ref; -export type AnotherNameRendererFragment = {| - +name: ?string, - +nameRenderer: ?{| - +__fragmentPropName?: ?string, - +__module_component?: ?string, - +$fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, - |}, - +$refType: AnotherNameRendererFragment$ref, -|}; -export type AnotherNameRendererFragment$data = AnotherNameRendererFragment; -export type AnotherNameRendererFragment$key = { - +$data?: AnotherNameRendererFragment$data, - +$fragmentRefs: AnotherNameRendererFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type MarkdownUserNameRenderer_name$ref: FragmentReference; -declare export opaque type MarkdownUserNameRenderer_name$fragmentType: MarkdownUserNameRenderer_name$ref; -export type MarkdownUserNameRenderer_name = {| - +markdown: ?string, - +data: ?{| - +markup: ?string - |}, - +$refType: MarkdownUserNameRenderer_name$ref, -|}; -export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; -export type MarkdownUserNameRenderer_name$key = { - +$data?: MarkdownUserNameRenderer_name$data, - +$fragmentRefs: MarkdownUserNameRenderer_name$ref, - ... -}; -------------------------------------------------------------------------------- -import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; -import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type NameRendererFragment$ref: FragmentReference; -declare export opaque type NameRendererFragment$fragmentType: NameRendererFragment$ref; -export type NameRendererFragment = {| - +id: string, - +nameRenderer: ?{| - +__fragmentPropName?: ?string, - +__module_component?: ?string, - +$fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, - |}, - +$refType: NameRendererFragment$ref, -|}; -export type NameRendererFragment$data = NameRendererFragment; -export type NameRendererFragment$key = { - +$data?: NameRendererFragment$data, - +$fragmentRefs: NameRendererFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type PlainUserNameRenderer_name$ref: FragmentReference; -declare export opaque type PlainUserNameRenderer_name$fragmentType: PlainUserNameRenderer_name$ref; -export type PlainUserNameRenderer_name = {| - +plaintext: ?string, - +data: ?{| - +text: ?string - |}, - +$refType: PlainUserNameRenderer_name$ref, -|}; -export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; -export type PlainUserNameRenderer_name$key = { - +$data?: PlainUserNameRenderer_name$data, - +$fragmentRefs: PlainUserNameRenderer_name$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import type { Local3DPayload } from "relay-runtime"; -import type { AnotherNameRendererFragment$ref } from "AnotherNameRendererFragment.graphql"; -import type { NameRendererFragment$ref } from "NameRendererFragment.graphql"; -export type TestVariables = {||}; -export type TestResponse = {| - +node: ?{| - +username?: ?string, - +$fragmentRefs: NameRendererFragment$ref, - |}, - +viewer: ?{| - +actor: ?{| - +name?: ?string, - +$fragmentRefs: AnotherNameRendererFragment$ref, - |} - |}, -|}; -export type PlainUserNameRenderer_name = {| - +plaintext: ?string, - +data: ?{| - +text: ?string, - +id: ?string, - |}, -|}; -export type MarkdownUserNameRenderer_name = {| - +markdown: ?string, - +data: ?{| - +markup: ?string, - +id: ?string, - |}, -|}; -export type TestRawResponse = {| - +node: ?({| - +__typename: "User", - +id: string, - +username: ?string, - +nameRenderer: ?({| - +__typename: "PlainUserNameRenderer", - +__module_operation_NameRendererFragment: ?any, - +__module_component_NameRendererFragment: ?any, - ...PlainUserNameRenderer_name, - |} | Local3DPayload<"NameRendererFragment", {| - +__typename: "PlainUserNameRenderer", - ...PlainUserNameRenderer_name, - |}> | {| - +__typename: "MarkdownUserNameRenderer", - +__module_operation_NameRendererFragment: ?any, - +__module_component_NameRendererFragment: ?any, - ...MarkdownUserNameRenderer_name, - |} | Local3DPayload<"NameRendererFragment", {| - +__typename: "MarkdownUserNameRenderer", - ...MarkdownUserNameRenderer_name, - |}> | {| - +__typename: string - |}), - |} | {| - +__typename: string, - +id: string, - |}), - +viewer: ?{| - +actor: ?({| - +__typename: "User", - +id: string, - +name: ?string, - +nameRenderer: ?({| - +__typename: "PlainUserNameRenderer", - +__module_operation_AnotherNameRendererFragment: ?any, - +__module_component_AnotherNameRendererFragment: ?any, - ...PlainUserNameRenderer_name, - |} | Local3DPayload<"AnotherNameRendererFragment", {| - +__typename: "PlainUserNameRenderer", - ...PlainUserNameRenderer_name, - |}> | {| - +__typename: "MarkdownUserNameRenderer", - +__module_operation_AnotherNameRendererFragment: ?any, - +__module_component_AnotherNameRendererFragment: ?any, - ...MarkdownUserNameRenderer_name, - |} | Local3DPayload<"AnotherNameRendererFragment", {| - +__typename: "MarkdownUserNameRenderer", - ...MarkdownUserNameRenderer_name, - |}> | {| - +__typename: string - |}), - |} | {| - +__typename: string, - +id: string, - |}) - |}, -|}; -export type Test = {| - variables: TestVariables, - response: TestResponse, - rawResponse: TestRawResponse, -|}; -------------------------------------------------------------------------------- -import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; -import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type AnotherNameRendererFragment$ref: FragmentReference; -declare export opaque type AnotherNameRendererFragment$fragmentType: AnotherNameRendererFragment$ref; -export type AnotherNameRendererFragment = {| - +name: ?string, - +nameRenderer: ?{| - +__fragmentPropName?: ?string, - +__module_component?: ?string, - +$fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, - |}, - +$refType: AnotherNameRendererFragment$ref, -|}; -export type AnotherNameRendererFragment$data = AnotherNameRendererFragment; -export type AnotherNameRendererFragment$key = { - +$data?: AnotherNameRendererFragment$data, - +$fragmentRefs: AnotherNameRendererFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type MarkdownUserNameRenderer_name$ref: FragmentReference; -declare export opaque type MarkdownUserNameRenderer_name$fragmentType: MarkdownUserNameRenderer_name$ref; -export type MarkdownUserNameRenderer_name = {| - +markdown: ?string, - +data: ?{| - +markup: ?string - |}, - +$refType: MarkdownUserNameRenderer_name$ref, -|}; -export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; -export type MarkdownUserNameRenderer_name$key = { - +$data?: MarkdownUserNameRenderer_name$data, - +$fragmentRefs: MarkdownUserNameRenderer_name$ref, - ... -}; -------------------------------------------------------------------------------- -import type { MarkdownUserNameRenderer_name$ref } from "MarkdownUserNameRenderer_name.graphql"; -import type { PlainUserNameRenderer_name$ref } from "PlainUserNameRenderer_name.graphql"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type NameRendererFragment$ref: FragmentReference; -declare export opaque type NameRendererFragment$fragmentType: NameRendererFragment$ref; -export type NameRendererFragment = {| - +id: string, - +nameRenderer: ?{| - +__fragmentPropName?: ?string, - +__module_component?: ?string, - +$fragmentRefs: PlainUserNameRenderer_name$ref & MarkdownUserNameRenderer_name$ref, - |}, - +$refType: NameRendererFragment$ref, -|}; -export type NameRendererFragment$data = NameRendererFragment; -export type NameRendererFragment$key = { - +$data?: NameRendererFragment$data, - +$fragmentRefs: NameRendererFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type PlainUserNameRenderer_name$ref: FragmentReference; -declare export opaque type PlainUserNameRenderer_name$fragmentType: PlainUserNameRenderer_name$ref; -export type PlainUserNameRenderer_name = {| - +plaintext: ?string, - +data: ?{| - +text: ?string - |}, - +$refType: PlainUserNameRenderer_name$ref, -|}; -export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; -export type PlainUserNameRenderer_name$key = { - +$data?: PlainUserNameRenderer_name$data, - +$fragmentRefs: PlainUserNameRenderer_name$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import type { Local3DPayload } from "relay-runtime"; import type { AnotherNameRendererFragment$ref } from "AnotherNameRendererFragment.graphql"; import type { NameRendererFragment$ref } from "NameRendererFragment.graphql"; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-conditional.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-conditional.expected index 071f2b8463012..bd52665aa1ba3 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-conditional.expected @@ -16,176 +16,6 @@ fragment FriendFragment on User { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import type { FriendFragment$ref } from "FriendFragment.graphql"; -export type ExampleQueryVariables = {| - id: string, - condition: boolean, -|}; -export type ExampleQueryResponse = {| - +node: ?{| - +$fragmentRefs: FriendFragment$ref - |} -|}; -export type ExampleQueryRawResponse = {| - +node: ?({| - +__typename: "User", - +id: string, - +name: ?string, - +lastName: ?string, - +feedback: ?{| - +id: string, - +name: ?string, - |}, - |} | {| - +__typename: string, - +id: string, - |}) -|}; -export type ExampleQuery = {| - variables: ExampleQueryVariables, - response: ExampleQueryResponse, - rawResponse: ExampleQueryRawResponse, -|}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type FriendFragment$ref: FragmentReference; -declare export opaque type FriendFragment$fragmentType: FriendFragment$ref; -export type FriendFragment = {| - +name?: ?string, - +lastName?: ?string, - +feedback?: ?{| - +id: string, - +name: ?string, - |}, - +$refType: FriendFragment$ref, -|}; -export type FriendFragment$data = FriendFragment; -export type FriendFragment$key = { - +$data?: FriendFragment$data, - +$fragmentRefs: FriendFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import type { FriendFragment$ref } from "FriendFragment.graphql"; -export type ExampleQueryVariables = {| - id: string, - condition: boolean, -|}; -export type ExampleQueryResponse = {| - +node: ?{| - +$fragmentRefs: FriendFragment$ref - |} -|}; -export type ExampleQueryRawResponse = {| - +node: ?({| - +__typename: "User", - +id: string, - +name: ?string, - +lastName: ?string, - +feedback: ?{| - +id: string, - +name: ?string, - |}, - |} | {| - +__typename: string, - +id: string, - |}) -|}; -export type ExampleQuery = {| - variables: ExampleQueryVariables, - response: ExampleQueryResponse, - rawResponse: ExampleQueryRawResponse, -|}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type FriendFragment$ref: FragmentReference; -declare export opaque type FriendFragment$fragmentType: FriendFragment$ref; -export type FriendFragment = {| - +name?: ?string, - +lastName?: ?string, - +feedback?: ?{| - +id: string, - +name: ?string, - |}, - +$refType: FriendFragment$ref, -|}; -export type FriendFragment$data = FriendFragment; -export type FriendFragment$key = { - +$data?: FriendFragment$data, - +$fragmentRefs: FriendFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import type { FriendFragment$ref } from "FriendFragment.graphql"; -export type ExampleQueryVariables = {| - id: string, - condition: boolean, -|}; -export type ExampleQueryResponse = {| - +node: ?{| - +$fragmentRefs: FriendFragment$ref - |} -|}; -export type ExampleQueryRawResponse = {| - +node: ?({| - +__typename: "User", - +id: string, - +name: ?string, - +lastName: ?string, - +feedback: ?{| - +id: string, - +name: ?string, - |}, - |} | {| - +__typename: string, - +id: string, - |}) -|}; -export type ExampleQuery = {| - variables: ExampleQueryVariables, - response: ExampleQueryResponse, - rawResponse: ExampleQueryRawResponse, -|}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type FriendFragment$ref: FragmentReference; -declare export opaque type FriendFragment$fragmentType: FriendFragment$ref; -export type FriendFragment = {| - +name?: ?string, - +lastName?: ?string, - +feedback?: ?{| - +id: string, - +name: ?string, - |}, - +$refType: FriendFragment$ref, -|}; -export type FriendFragment$data = FriendFragment; -export type FriendFragment$key = { - +$data?: FriendFragment$data, - +$fragmentRefs: FriendFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import type { FriendFragment$ref } from "FriendFragment.graphql"; export type ExampleQueryVariables = {| id: string, diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-literal-conditional.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-literal-conditional.expected index 6c70ecfd105de..27d3673975f8b 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-literal-conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-literal-conditional.expected @@ -22,161 +22,6 @@ fragment FriendFragment on User { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import type { FriendFragment$ref } from "FriendFragment.graphql"; -export type ExampleQueryVariables = {| - id: string -|}; -export type ExampleQueryResponse = {| - +node: ?{| - +username: ?string, - +friends?: ?{| - +count: ?number - |}, - +$fragmentRefs: FriendFragment$ref, - |} -|}; -export type ExampleQueryRawResponse = {| - +node: ?{| - +__typename: string, - +username: ?string, - +id: string, - |} -|}; -export type ExampleQuery = {| - variables: ExampleQueryVariables, - response: ExampleQueryResponse, - rawResponse: ExampleQueryRawResponse, -|}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type FriendFragment$ref: FragmentReference; -declare export opaque type FriendFragment$fragmentType: FriendFragment$ref; -export type FriendFragment = {| - +name?: ?string, - +lastName?: ?string, - +feedback?: ?{| - +id: string, - +name: ?string, - |}, - +$refType: FriendFragment$ref, -|}; -export type FriendFragment$data = FriendFragment; -export type FriendFragment$key = { - +$data?: FriendFragment$data, - +$fragmentRefs: FriendFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import type { FriendFragment$ref } from "FriendFragment.graphql"; -export type ExampleQueryVariables = {| - id: string -|}; -export type ExampleQueryResponse = {| - +node: ?{| - +username: ?string, - +friends?: ?{| - +count: ?number - |}, - +$fragmentRefs: FriendFragment$ref, - |} -|}; -export type ExampleQueryRawResponse = {| - +node: ?{| - +__typename: string, - +username: ?string, - +id: string, - |} -|}; -export type ExampleQuery = {| - variables: ExampleQueryVariables, - response: ExampleQueryResponse, - rawResponse: ExampleQueryRawResponse, -|}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type FriendFragment$ref: FragmentReference; -declare export opaque type FriendFragment$fragmentType: FriendFragment$ref; -export type FriendFragment = {| - +name?: ?string, - +lastName?: ?string, - +feedback?: ?{| - +id: string, - +name: ?string, - |}, - +$refType: FriendFragment$ref, -|}; -export type FriendFragment$data = FriendFragment; -export type FriendFragment$key = { - +$data?: FriendFragment$data, - +$fragmentRefs: FriendFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import type { FriendFragment$ref } from "FriendFragment.graphql"; -export type ExampleQueryVariables = {| - id: string -|}; -export type ExampleQueryResponse = {| - +node: ?{| - +username: ?string, - +friends?: ?{| - +count: ?number - |}, - +$fragmentRefs: FriendFragment$ref, - |} -|}; -export type ExampleQueryRawResponse = {| - +node: ?{| - +__typename: string, - +username: ?string, - +id: string, - |} -|}; -export type ExampleQuery = {| - variables: ExampleQueryVariables, - response: ExampleQueryResponse, - rawResponse: ExampleQueryRawResponse, -|}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type FriendFragment$ref: FragmentReference; -declare export opaque type FriendFragment$fragmentType: FriendFragment$ref; -export type FriendFragment = {| - +name?: ?string, - +lastName?: ?string, - +feedback?: ?{| - +id: string, - +name: ?string, - |}, - +$refType: FriendFragment$ref, -|}; -export type FriendFragment$data = FriendFragment; -export type FriendFragment$key = { - +$data?: FriendFragment$data, - +$fragmentRefs: FriendFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import type { FriendFragment$ref } from "FriendFragment.graphql"; export type ExampleQueryVariables = {| id: string diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-stream-connection.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-stream-connection.expected index 74657280fbf45..db869695cc30f 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-stream-connection.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-stream-connection.expected @@ -17,173 +17,6 @@ query TestDefer @raw_response_type { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type TestDeferVariables = {||}; -export type TestDeferResponse = {| - +node: ?{| - +name?: ?string, - +friends?: ?{| - +edges: ?$ReadOnlyArray - |}, - |} -|}; -export type TestDeferRawResponse = {| - +node: ?({| - +__typename: "User", - +id: string, - +name: ?string, - +friends: ?{| - +edges: ?$ReadOnlyArray, - +pageInfo: ?{| - +endCursor: ?string, - +hasNextPage: ?boolean, - |}, - |}, - |} | {| - +__typename: string, - +id: string, - |}) -|}; -export type TestDefer = {| - variables: TestDeferVariables, - response: TestDeferResponse, - rawResponse: TestDeferRawResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type TestDeferVariables = {||}; -export type TestDeferResponse = {| - +node: ?{| - +name?: ?string, - +friends?: ?{| - +edges: ?$ReadOnlyArray - |}, - |} -|}; -export type TestDeferRawResponse = {| - +node: ?({| - +__typename: "User", - +id: string, - +name: ?string, - +friends: ?{| - +edges: ?$ReadOnlyArray, - +pageInfo: ?{| - +endCursor: ?string, - +hasNextPage: ?boolean, - |}, - |}, - |} | {| - +__typename: string, - +id: string, - |}) -|}; -export type TestDefer = {| - variables: TestDeferVariables, - response: TestDeferResponse, - rawResponse: TestDeferRawResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type TestDeferVariables = {||}; -export type TestDeferResponse = {| - +node: ?{| - +name?: ?string, - +friends?: ?{| - +edges: ?$ReadOnlyArray - |}, - |} -|}; -export type TestDeferRawResponse = {| - +node: ?({| - +__typename: "User", - +id: string, - +name: ?string, - +friends: ?{| - +edges: ?$ReadOnlyArray, - +pageInfo: ?{| - +endCursor: ?string, - +hasNextPage: ?boolean, - |}, - |}, - |} | {| - +__typename: string, - +id: string, - |}) -|}; -export type TestDefer = {| - variables: TestDeferVariables, - response: TestDeferResponse, - rawResponse: TestDeferRawResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type TestDeferVariables = {||}; export type TestDeferResponse = {| +node: ?{| diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-stream.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-stream.expected index efd1a8224490f..e79ebc313b654 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-stream.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-stream.expected @@ -18,152 +18,6 @@ query TestStream @raw_response_type { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type TestStreamVariables = {||}; -export type TestStreamResponse = {| - +node: ?{| - +name?: ?string, - +friends?: ?{| - +edges: ?$ReadOnlyArray - |}, - |} -|}; -export type TestStreamRawResponse = {| - +node: ?({| - +__typename: "User", - +id: string, - +name: ?string, - +friends: ?{| - +edges: ?$ReadOnlyArray, - +pageInfo: ?{| - +endCursor: ?string, - +hasNextPage: ?boolean, - |}, - |}, - |} | {| - +__typename: string, - +id: string, - |}) -|}; -export type TestStream = {| - variables: TestStreamVariables, - response: TestStreamResponse, - rawResponse: TestStreamRawResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type TestStreamVariables = {||}; -export type TestStreamResponse = {| - +node: ?{| - +name?: ?string, - +friends?: ?{| - +edges: ?$ReadOnlyArray - |}, - |} -|}; -export type TestStreamRawResponse = {| - +node: ?({| - +__typename: "User", - +id: string, - +name: ?string, - +friends: ?{| - +edges: ?$ReadOnlyArray, - +pageInfo: ?{| - +endCursor: ?string, - +hasNextPage: ?boolean, - |}, - |}, - |} | {| - +__typename: string, - +id: string, - |}) -|}; -export type TestStream = {| - variables: TestStreamVariables, - response: TestStreamResponse, - rawResponse: TestStreamRawResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type TestStreamVariables = {||}; -export type TestStreamResponse = {| - +node: ?{| - +name?: ?string, - +friends?: ?{| - +edges: ?$ReadOnlyArray - |}, - |} -|}; -export type TestStreamRawResponse = {| - +node: ?({| - +__typename: "User", - +id: string, - +name: ?string, - +friends: ?{| - +edges: ?$ReadOnlyArray, - +pageInfo: ?{| - +endCursor: ?string, - +hasNextPage: ?boolean, - |}, - |}, - |} | {| - +__typename: string, - +id: string, - |}) -|}; -export type TestStream = {| - variables: TestStreamVariables, - response: TestStreamResponse, - rawResponse: TestStreamRawResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type TestStreamVariables = {||}; export type TestStreamResponse = {| +node: ?{| diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/recursive-fragments.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/recursive-fragments.expected index f01e1fc9fec88..41d73a06c619d 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/recursive-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/recursive-fragments.expected @@ -6,71 +6,6 @@ fragment FragmentSpread on Node { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type FragmentSpread$ref: FragmentReference; -declare export opaque type FragmentSpread$fragmentType: FragmentSpread$ref; -export type FragmentSpread = {| - +id: string, - +$fragmentRefs: FragmentSpread$ref, - +$refType: FragmentSpread$ref, -|}; -export type FragmentSpread$data = FragmentSpread; -export type FragmentSpread$key = { - +$data?: FragmentSpread$data, - +$fragmentRefs: FragmentSpread$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type FragmentSpread$ref: FragmentReference; -declare export opaque type FragmentSpread$fragmentType: FragmentSpread$ref; -export type FragmentSpread = {| - +id: string, - +$fragmentRefs: FragmentSpread$ref, - +$refType: FragmentSpread$ref, -|}; -export type FragmentSpread$data = FragmentSpread; -export type FragmentSpread$key = { - +$data?: FragmentSpread$data, - +$fragmentRefs: FragmentSpread$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type FragmentSpread$ref: FragmentReference; -declare export opaque type FragmentSpread$fragmentType: FragmentSpread$ref; -export type FragmentSpread = {| - +id: string, - +$fragmentRefs: FragmentSpread$ref, - +$refType: FragmentSpread$ref, -|}; -export type FragmentSpread$data = FragmentSpread; -export type FragmentSpread$key = { - +$data?: FragmentSpread$data, - +$fragmentRefs: FragmentSpread$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import type { FragmentReference } from "relay-runtime"; declare export opaque type FragmentSpread$ref: FragmentReference; declare export opaque type FragmentSpread$fragmentType: FragmentSpread$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/refetchable-fragment.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/refetchable-fragment.expected index 38e765836869f..09e323df81954 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/refetchable-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/refetchable-fragment.expected @@ -7,125 +7,6 @@ fragment RefetchableFragment on Node } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type RefetchableFragment$ref: FragmentReference; -declare export opaque type RefetchableFragment$fragmentType: RefetchableFragment$ref; -export type RefetchableFragmentQueryVariables = {| - id: string -|}; -export type RefetchableFragmentQueryResponse = {| - +node: ?{| - +$fragmentRefs: RefetchableFragment$ref - |} -|}; -export type RefetchableFragmentQuery = {| - variables: RefetchableFragmentQueryVariables, - response: RefetchableFragmentQueryResponse, -|}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -import type { RefetchableFragment$ref, RefetchableFragment$fragmentType } from "RefetchableFragmentQuery.graphql"; -export type { RefetchableFragment$ref, RefetchableFragment$fragmentType }; -export type RefetchableFragment = {| - +id: string, - +fragAndField: ?{| - +uri: ?string - |}, - +$refType: RefetchableFragment$ref, -|}; -export type RefetchableFragment$data = RefetchableFragment; -export type RefetchableFragment$key = { - +$data?: RefetchableFragment$data, - +$fragmentRefs: RefetchableFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type RefetchableFragment$ref: FragmentReference; -declare export opaque type RefetchableFragment$fragmentType: RefetchableFragment$ref; -export type RefetchableFragmentQueryVariables = {| - id: string -|}; -export type RefetchableFragmentQueryResponse = {| - +node: ?{| - +$fragmentRefs: RefetchableFragment$ref - |} -|}; -export type RefetchableFragmentQuery = {| - variables: RefetchableFragmentQueryVariables, - response: RefetchableFragmentQueryResponse, -|}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -import type { RefetchableFragment$ref, RefetchableFragment$fragmentType } from "RefetchableFragmentQuery.graphql"; -export type { RefetchableFragment$ref, RefetchableFragment$fragmentType }; -export type RefetchableFragment = {| - +id: string, - +fragAndField: ?{| - +uri: ?string - |}, - +$refType: RefetchableFragment$ref, -|}; -export type RefetchableFragment$data = RefetchableFragment; -export type RefetchableFragment$key = { - +$data?: RefetchableFragment$data, - +$fragmentRefs: RefetchableFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type RefetchableFragment$ref: FragmentReference; -declare export opaque type RefetchableFragment$fragmentType: RefetchableFragment$ref; -export type RefetchableFragmentQueryVariables = {| - id: string -|}; -export type RefetchableFragmentQueryResponse = {| - +node: ?{| - +$fragmentRefs: RefetchableFragment$ref - |} -|}; -export type RefetchableFragmentQuery = {| - variables: RefetchableFragmentQueryVariables, - response: RefetchableFragmentQueryResponse, -|}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -import type { RefetchableFragment$ref, RefetchableFragment$fragmentType } from "RefetchableFragmentQuery.graphql"; -export type { RefetchableFragment$ref, RefetchableFragment$fragmentType }; -export type RefetchableFragment = {| - +id: string, - +fragAndField: ?{| - +uri: ?string - |}, - +$refType: RefetchableFragment$ref, -|}; -export type RefetchableFragment$data = RefetchableFragment; -export type RefetchableFragment$key = { - +$data?: RefetchableFragment$data, - +$fragmentRefs: RefetchableFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import type { FragmentReference } from "relay-runtime"; declare export opaque type RefetchableFragment$ref: FragmentReference; declare export opaque type RefetchableFragment$fragmentType: RefetchableFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/refetchable.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/refetchable.expected index d20e76f9f02e5..783c90c40e80a 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/refetchable.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/refetchable.expected @@ -7,119 +7,6 @@ fragment FlowRefetchableFragment on Node } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type FlowRefetchableFragment$ref: FragmentReference; -declare export opaque type FlowRefetchableFragment$fragmentType: FlowRefetchableFragment$ref; -export type FlowRefetchableFragmentQueryVariables = {| - id: string -|}; -export type FlowRefetchableFragmentQueryResponse = {| - +node: ?{| - +$fragmentRefs: FlowRefetchableFragment$ref - |} -|}; -export type FlowRefetchableFragmentQuery = {| - variables: FlowRefetchableFragmentQueryVariables, - response: FlowRefetchableFragmentQueryResponse, -|}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -import type { FlowRefetchableFragment$ref, FlowRefetchableFragment$fragmentType } from "FlowRefetchableFragmentQuery.graphql"; -export type { FlowRefetchableFragment$ref, FlowRefetchableFragment$fragmentType }; -export type FlowRefetchableFragment = {| - +id: string, - +name?: ?string, - +$refType: FlowRefetchableFragment$ref, -|}; -export type FlowRefetchableFragment$data = FlowRefetchableFragment; -export type FlowRefetchableFragment$key = { - +$data?: FlowRefetchableFragment$data, - +$fragmentRefs: FlowRefetchableFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type FlowRefetchableFragment$ref: FragmentReference; -declare export opaque type FlowRefetchableFragment$fragmentType: FlowRefetchableFragment$ref; -export type FlowRefetchableFragmentQueryVariables = {| - id: string -|}; -export type FlowRefetchableFragmentQueryResponse = {| - +node: ?{| - +$fragmentRefs: FlowRefetchableFragment$ref - |} -|}; -export type FlowRefetchableFragmentQuery = {| - variables: FlowRefetchableFragmentQueryVariables, - response: FlowRefetchableFragmentQueryResponse, -|}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -import type { FlowRefetchableFragment$ref, FlowRefetchableFragment$fragmentType } from "FlowRefetchableFragmentQuery.graphql"; -export type { FlowRefetchableFragment$ref, FlowRefetchableFragment$fragmentType }; -export type FlowRefetchableFragment = {| - +id: string, - +name?: ?string, - +$refType: FlowRefetchableFragment$ref, -|}; -export type FlowRefetchableFragment$data = FlowRefetchableFragment; -export type FlowRefetchableFragment$key = { - +$data?: FlowRefetchableFragment$data, - +$fragmentRefs: FlowRefetchableFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type FlowRefetchableFragment$ref: FragmentReference; -declare export opaque type FlowRefetchableFragment$fragmentType: FlowRefetchableFragment$ref; -export type FlowRefetchableFragmentQueryVariables = {| - id: string -|}; -export type FlowRefetchableFragmentQueryResponse = {| - +node: ?{| - +$fragmentRefs: FlowRefetchableFragment$ref - |} -|}; -export type FlowRefetchableFragmentQuery = {| - variables: FlowRefetchableFragmentQueryVariables, - response: FlowRefetchableFragmentQueryResponse, -|}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -import type { FlowRefetchableFragment$ref, FlowRefetchableFragment$fragmentType } from "FlowRefetchableFragmentQuery.graphql"; -export type { FlowRefetchableFragment$ref, FlowRefetchableFragment$fragmentType }; -export type FlowRefetchableFragment = {| - +id: string, - +name?: ?string, - +$refType: FlowRefetchableFragment$ref, -|}; -export type FlowRefetchableFragment$data = FlowRefetchableFragment; -export type FlowRefetchableFragment$key = { - +$data?: FlowRefetchableFragment$data, - +$fragmentRefs: FlowRefetchableFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import type { FragmentReference } from "relay-runtime"; declare export opaque type FlowRefetchableFragment$ref: FragmentReference; declare export opaque type FlowRefetchableFragment$fragmentType: FlowRefetchableFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.expected index bea5fe2db6e3e..8bb8a29dee859 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.expected @@ -27,144 +27,6 @@ query RelayClientIDFieldQuery($id: ID!) { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type RelayClientIDFieldQueryVariables = {| - id: string -|}; -export type RelayClientIDFieldQueryResponse = {| - +__id: string, - +me: ?{| - +__id: string, - +__typename: string, - +id: string, - |}, - +node: ?({| - +__typename: "Comment", - +commentBody: ?({| - +__typename: "PlainCommentBody", - +__id: string, - +text: ?{| - +__id: string, - +__typename: string, - +text: ?string, - |}, - +__id: string, - |} | {| - +__typename: "MarkdownCommentBody", - +__id: string, - |}), - +__id: string, - +id: string, - |} | {| - +__typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "User", - +__id: string, - +id: string, - |}), -|}; -export type RelayClientIDFieldQuery = {| - variables: RelayClientIDFieldQueryVariables, - response: RelayClientIDFieldQueryResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type RelayClientIDFieldQueryVariables = {| - id: string -|}; -export type RelayClientIDFieldQueryResponse = {| - +__id: string, - +me: ?{| - +__id: string, - +__typename: string, - +id: string, - |}, - +node: ?({| - +__typename: "Comment", - +commentBody: ?({| - +__typename: "PlainCommentBody", - +__id: string, - +text: ?{| - +__id: string, - +__typename: string, - +text: ?string, - |}, - +__id: string, - |} | {| - +__typename: "MarkdownCommentBody", - +__id: string, - |}), - +__id: string, - +id: string, - |} | {| - +__typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "User", - +__id: string, - +id: string, - |}), -|}; -export type RelayClientIDFieldQuery = {| - variables: RelayClientIDFieldQueryVariables, - response: RelayClientIDFieldQueryResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type RelayClientIDFieldQueryVariables = {| - id: string -|}; -export type RelayClientIDFieldQueryResponse = {| - +__id: string, - +me: ?{| - +__id: string, - +__typename: string, - +id: string, - |}, - +node: ?({| - +__typename: "Comment", - +commentBody: ?({| - +__typename: "PlainCommentBody", - +__id: string, - +text: ?{| - +__id: string, - +__typename: string, - +text: ?string, - |}, - +__id: string, - |} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +__typename: "%other", - +__id: string, - |}), - +__id: string, - +id: string, - |} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +__typename: "%other", - +__id: string, - +id: string, - |}), -|}; -export type RelayClientIDFieldQuery = {| - variables: RelayClientIDFieldQueryVariables, - response: RelayClientIDFieldQueryResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type RelayClientIDFieldQueryVariables = {| id: string |}; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected index 37d8e1f56fa68..36f1e3a8fe0ad 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected @@ -8,82 +8,6 @@ fragment Foo on Node { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type Foo$ref: FragmentReference; -declare export opaque type Foo$fragmentType: Foo$ref; -export type Foo = ?({| - +__typename: "User", - +name: string, - +$refType: Foo$ref, -|} | {| - +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story", - +$refType: Foo$ref, -|}); -export type Foo$data = Foo; -export type Foo$key = { - +$data?: Foo$data, - +$fragmentRefs: Foo$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type Foo$ref: FragmentReference; -declare export opaque type Foo$fragmentType: Foo$ref; -export type Foo = ?({| - +__typename: "User", - +name: string, - +$refType: Foo$ref, -|} | {| - +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story", - +$refType: Foo$ref, -|}); -export type Foo$data = Foo; -export type Foo$key = { - +$data?: Foo$data, - +$fragmentRefs: Foo$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type Foo$ref: FragmentReference; -declare export opaque type Foo$fragmentType: Foo$ref; -export type Foo = ?({| - +__typename: "User", - +name: string, - +$refType: Foo$ref, -|} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +__typename: "%other", - +$refType: Foo$ref, -|}); -export type Foo$data = Foo; -export type Foo$key = { - +$data?: Foo$data, - +$fragmentRefs: Foo$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import type { FragmentReference } from "relay-runtime"; declare export opaque type Foo$ref: FragmentReference; declare export opaque type Foo$fragmentType: Foo$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-fragment.expected index 97aa3b66d22da..25cebfecb25bc 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-fragment.expected @@ -4,71 +4,6 @@ fragment NonNullFragment on User { lastName @required(action: NONE) } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type NonNullFragment$ref: FragmentReference; -declare export opaque type NonNullFragment$fragmentType: NonNullFragment$ref; -export type NonNullFragment = ?{| - +firstName: ?string, - +lastName: string, - +$refType: NonNullFragment$ref, -|}; -export type NonNullFragment$data = NonNullFragment; -export type NonNullFragment$key = { - +$data?: NonNullFragment$data, - +$fragmentRefs: NonNullFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type NonNullFragment$ref: FragmentReference; -declare export opaque type NonNullFragment$fragmentType: NonNullFragment$ref; -export type NonNullFragment = ?{| - +firstName: ?string, - +lastName: string, - +$refType: NonNullFragment$ref, -|}; -export type NonNullFragment$data = NonNullFragment; -export type NonNullFragment$key = { - +$data?: NonNullFragment$data, - +$fragmentRefs: NonNullFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type NonNullFragment$ref: FragmentReference; -declare export opaque type NonNullFragment$fragmentType: NonNullFragment$ref; -export type NonNullFragment = ?{| - +firstName: ?string, - +lastName: string, - +$refType: NonNullFragment$ref, -|}; -export type NonNullFragment$data = NonNullFragment; -export type NonNullFragment$key = { - +$data?: NonNullFragment$data, - +$fragmentRefs: NonNullFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import type { FragmentReference } from "relay-runtime"; declare export opaque type NonNullFragment$ref: FragmentReference; declare export opaque type NonNullFragment$fragmentType: NonNullFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-item-in-plural-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-item-in-plural-field.expected index 5f47a910341c0..40863e84d75d4 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-item-in-plural-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-item-in-plural-field.expected @@ -7,80 +7,6 @@ fragment NonNullFragment on User { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type NonNullFragment$ref: FragmentReference; -declare export opaque type NonNullFragment$fragmentType: NonNullFragment$ref; -export type NonNullFragment = {| - +firstName: ?string, - +screennames: ?$ReadOnlyArray, - +$refType: NonNullFragment$ref, -|}; -export type NonNullFragment$data = NonNullFragment; -export type NonNullFragment$key = { - +$data?: NonNullFragment$data, - +$fragmentRefs: NonNullFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type NonNullFragment$ref: FragmentReference; -declare export opaque type NonNullFragment$fragmentType: NonNullFragment$ref; -export type NonNullFragment = {| - +firstName: ?string, - +screennames: ?$ReadOnlyArray, - +$refType: NonNullFragment$ref, -|}; -export type NonNullFragment$data = NonNullFragment; -export type NonNullFragment$key = { - +$data?: NonNullFragment$data, - +$fragmentRefs: NonNullFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type NonNullFragment$ref: FragmentReference; -declare export opaque type NonNullFragment$fragmentType: NonNullFragment$ref; -export type NonNullFragment = {| - +firstName: ?string, - +screennames: ?$ReadOnlyArray, - +$refType: NonNullFragment$ref, -|}; -export type NonNullFragment$data = NonNullFragment; -export type NonNullFragment$key = { - +$data?: NonNullFragment$data, - +$fragmentRefs: NonNullFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import type { FragmentReference } from "relay-runtime"; declare export opaque type NonNullFragment$ref: FragmentReference; declare export opaque type NonNullFragment$fragmentType: NonNullFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-non-null-item-in-non-null-plural-linked-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-non-null-item-in-non-null-plural-linked-field.expected index d15b0c5ec991c..b631064636b1b 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-non-null-item-in-non-null-plural-linked-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-non-null-item-in-non-null-plural-linked-field.expected @@ -5,74 +5,6 @@ fragment SomeFragment on User { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type SomeFragment$ref: FragmentReference; -declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; -export type SomeFragment = {| - +parents: $ReadOnlyArray, - +$refType: SomeFragment$ref, -|}; -export type SomeFragment$data = SomeFragment; -export type SomeFragment$key = { - +$data?: SomeFragment$data, - +$fragmentRefs: SomeFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type SomeFragment$ref: FragmentReference; -declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; -export type SomeFragment = {| - +parents: $ReadOnlyArray, - +$refType: SomeFragment$ref, -|}; -export type SomeFragment$data = SomeFragment; -export type SomeFragment$key = { - +$data?: SomeFragment$data, - +$fragmentRefs: SomeFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type SomeFragment$ref: FragmentReference; -declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; -export type SomeFragment = {| - +parents: $ReadOnlyArray, - +$refType: SomeFragment$ref, -|}; -export type SomeFragment$data = SomeFragment; -export type SomeFragment$key = { - +$data?: SomeFragment$data, - +$fragmentRefs: SomeFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import type { FragmentReference } from "relay-runtime"; declare export opaque type SomeFragment$ref: FragmentReference; declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-non-null-linked-field-through-inline-fragment.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-non-null-linked-field-through-inline-fragment.expected index 3ff6566d7603c..a6312eeab06f1 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-non-null-linked-field-through-inline-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-non-null-linked-field-through-inline-fragment.expected @@ -7,74 +7,6 @@ fragment SomeFragment on User { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type SomeFragment$ref: FragmentReference; -declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; -export type SomeFragment = {| - +nearest_neighbor: ?{| - +name: string - |}, - +$refType: SomeFragment$ref, -|}; -export type SomeFragment$data = SomeFragment; -export type SomeFragment$key = { - +$data?: SomeFragment$data, - +$fragmentRefs: SomeFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type SomeFragment$ref: FragmentReference; -declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; -export type SomeFragment = {| - +nearest_neighbor: ?{| - +name: string - |}, - +$refType: SomeFragment$ref, -|}; -export type SomeFragment$data = SomeFragment; -export type SomeFragment$key = { - +$data?: SomeFragment$data, - +$fragmentRefs: SomeFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type SomeFragment$ref: FragmentReference; -declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; -export type SomeFragment = {| - +nearest_neighbor: ?{| - +name: string - |}, - +$refType: SomeFragment$ref, -|}; -export type SomeFragment$data = SomeFragment; -export type SomeFragment$key = { - +$data?: SomeFragment$data, - +$fragmentRefs: SomeFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import type { FragmentReference } from "relay-runtime"; declare export opaque type SomeFragment$ref: FragmentReference; declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-non-null-linked-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-non-null-linked-field.expected index 3ea84c6335313..847985144aab0 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-non-null-linked-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-non-null-linked-field.expected @@ -5,74 +5,6 @@ fragment SomeFragment on User { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type SomeFragment$ref: FragmentReference; -declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; -export type SomeFragment = {| - +nearest_neighbor: ?{| - +name: string - |}, - +$refType: SomeFragment$ref, -|}; -export type SomeFragment$data = SomeFragment; -export type SomeFragment$key = { - +$data?: SomeFragment$data, - +$fragmentRefs: SomeFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type SomeFragment$ref: FragmentReference; -declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; -export type SomeFragment = {| - +nearest_neighbor: ?{| - +name: string - |}, - +$refType: SomeFragment$ref, -|}; -export type SomeFragment$data = SomeFragment; -export type SomeFragment$key = { - +$data?: SomeFragment$data, - +$fragmentRefs: SomeFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type SomeFragment$ref: FragmentReference; -declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; -export type SomeFragment = {| - +nearest_neighbor: ?{| - +name: string - |}, - +$refType: SomeFragment$ref, -|}; -export type SomeFragment$data = SomeFragment; -export type SomeFragment$key = { - +$data?: SomeFragment$data, - +$fragmentRefs: SomeFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import type { FragmentReference } from "relay-runtime"; declare export opaque type SomeFragment$ref: FragmentReference; declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-non-null-plural-linked-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-non-null-plural-linked-field.expected index 5925931c1d2d5..ca2a309412de3 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-non-null-plural-linked-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-non-null-plural-linked-field.expected @@ -5,74 +5,6 @@ fragment SomeFragment on User { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type SomeFragment$ref: FragmentReference; -declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; -export type SomeFragment = {| - +neighbors: ?$ReadOnlyArray, - +$refType: SomeFragment$ref, -|}; -export type SomeFragment$data = SomeFragment; -export type SomeFragment$key = { - +$data?: SomeFragment$data, - +$fragmentRefs: SomeFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type SomeFragment$ref: FragmentReference; -declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; -export type SomeFragment = {| - +neighbors: ?$ReadOnlyArray, - +$refType: SomeFragment$ref, -|}; -export type SomeFragment$data = SomeFragment; -export type SomeFragment$key = { - +$data?: SomeFragment$data, - +$fragmentRefs: SomeFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type SomeFragment$ref: FragmentReference; -declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; -export type SomeFragment = {| - +neighbors: ?$ReadOnlyArray, - +$refType: SomeFragment$ref, -|}; -export type SomeFragment$data = SomeFragment; -export type SomeFragment$key = { - +$data?: SomeFragment$data, - +$fragmentRefs: SomeFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import type { FragmentReference } from "relay-runtime"; declare export opaque type SomeFragment$ref: FragmentReference; declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-query.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-query.expected index 01d84c5b30b13..09cf659b48458 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-query.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-query.expected @@ -6,62 +6,6 @@ query FooQuery { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type FooQueryVariables = {||}; -export type FooQueryResponse = ?{| - +me: {| - +firstName: ?string, - +lastName: string, - |} -|}; -export type FooQuery = {| - variables: FooQueryVariables, - response: FooQueryResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type FooQueryVariables = {||}; -export type FooQueryResponse = ?{| - +me: {| - +firstName: ?string, - +lastName: string, - |} -|}; -export type FooQuery = {| - variables: FooQueryVariables, - response: FooQueryResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type FooQueryVariables = {||}; -export type FooQueryResponse = ?{| - +me: {| - +firstName: ?string, - +lastName: string, - |} -|}; -export type FooQuery = {| - variables: FooQueryVariables, - response: FooQueryResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type FooQueryVariables = {||}; export type FooQueryResponse = ?{| +me: {| diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-up-to-mutation-response.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-up-to-mutation-response.expected index 9da54cc13a7b1..361231f2e410c 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-up-to-mutation-response.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-up-to-mutation-response.expected @@ -7,104 +7,6 @@ mutation CommentCreateMutation($input: CommentCreateInput!) { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type CommentCreateInput = {| - clientMutationId?: ?string, - feedbackId?: ?string, - feedback?: ?CommentfeedbackFeedback, -|}; -export type CommentfeedbackFeedback = {| - comment?: ?FeedbackcommentComment -|}; -export type FeedbackcommentComment = {| - feedback?: ?CommentfeedbackFeedback -|}; -export type CommentCreateMutationVariables = {| - input: CommentCreateInput -|}; -export type CommentCreateMutationResponse = ?{| - +commentCreate: {| - +comment: {| - +id: string - |} - |} -|}; -export type CommentCreateMutation = {| - variables: CommentCreateMutationVariables, - response: CommentCreateMutationResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type CommentCreateInput = {| - clientMutationId?: ?string, - feedbackId?: ?string, - feedback?: ?CommentfeedbackFeedback, -|}; -export type CommentfeedbackFeedback = {| - comment?: ?FeedbackcommentComment -|}; -export type FeedbackcommentComment = {| - feedback?: ?CommentfeedbackFeedback -|}; -export type CommentCreateMutationVariables = {| - input: CommentCreateInput -|}; -export type CommentCreateMutationResponse = ?{| - +commentCreate: {| - +comment: {| - +id: string - |} - |} -|}; -export type CommentCreateMutation = {| - variables: CommentCreateMutationVariables, - response: CommentCreateMutationResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type CommentCreateInput = {| - clientMutationId?: ?string, - feedbackId?: ?string, - feedback?: ?CommentfeedbackFeedback, -|}; -export type CommentfeedbackFeedback = {| - comment?: ?FeedbackcommentComment -|}; -export type FeedbackcommentComment = {| - feedback?: ?CommentfeedbackFeedback -|}; -export type CommentCreateMutationVariables = {| - input: CommentCreateInput -|}; -export type CommentCreateMutationResponse = ?{| - +commentCreate: {| - +comment: {| - +id: string - |} - |} -|}; -export type CommentCreateMutation = {| - variables: CommentCreateMutationVariables, - response: CommentCreateMutationResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type CommentCreateInput = {| clientMutationId?: ?string, feedbackId?: ?string, diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-chain-bubbles-to-non-null-linked-field-through-inline-fragment.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-chain-bubbles-to-non-null-linked-field-through-inline-fragment.expected index d291b9e64a7d4..ce5d63d8e3388 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-chain-bubbles-to-non-null-linked-field-through-inline-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-chain-bubbles-to-non-null-linked-field-through-inline-fragment.expected @@ -7,80 +7,6 @@ fragment SomeFragment on User { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type SomeFragment$ref: FragmentReference; -declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; -export type SomeFragment = {| - +nearest_neighbor: ?{| - +profile_picture: {| - +uri: string - |} - |}, - +$refType: SomeFragment$ref, -|}; -export type SomeFragment$data = SomeFragment; -export type SomeFragment$key = { - +$data?: SomeFragment$data, - +$fragmentRefs: SomeFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type SomeFragment$ref: FragmentReference; -declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; -export type SomeFragment = {| - +nearest_neighbor: ?{| - +profile_picture: {| - +uri: string - |} - |}, - +$refType: SomeFragment$ref, -|}; -export type SomeFragment$data = SomeFragment; -export type SomeFragment$key = { - +$data?: SomeFragment$data, - +$fragmentRefs: SomeFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type SomeFragment$ref: FragmentReference; -declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; -export type SomeFragment = {| - +nearest_neighbor: ?{| - +profile_picture: {| - +uri: string - |} - |}, - +$refType: SomeFragment$ref, -|}; -export type SomeFragment$data = SomeFragment; -export type SomeFragment$key = { - +$data?: SomeFragment$data, - +$fragmentRefs: SomeFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import type { FragmentReference } from "relay-runtime"; declare export opaque type SomeFragment$ref: FragmentReference; declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-isolates-concrete-inline-fragments.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-isolates-concrete-inline-fragments.expected index cc73eaf1b8b9d..fd2e2fd20cd7d 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-isolates-concrete-inline-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-isolates-concrete-inline-fragments.expected @@ -28,151 +28,6 @@ fragment Foo on Node { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type Bar$ref: FragmentReference; -declare export opaque type Bar$fragmentType: Bar$ref; -export type Bar = ?{| - +name?: string, - +body?: ?{| - +text: ?string - |}, - +$refType: Bar$ref, -|}; -export type Bar$data = Bar; -export type Bar$key = { - +$data?: Bar$data, - +$fragmentRefs: Bar$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type Foo$ref: FragmentReference; -declare export opaque type Foo$fragmentType: Foo$ref; -export type Foo = ?({| - +__typename: "User", - +name: string, - +$refType: Foo$ref, -|} | {| - +__typename: "Comment", - +body: ?{| - +text: ?string - |}, - +$refType: Foo$ref, -|} | {| - +__typename: "Feedback" | "Page" | "PhotoStory" | "Story", - +$refType: Foo$ref, -|}); -export type Foo$data = Foo; -export type Foo$key = { - +$data?: Foo$data, - +$fragmentRefs: Foo$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type Bar$ref: FragmentReference; -declare export opaque type Bar$fragmentType: Bar$ref; -export type Bar = ?{| - +name?: string, - +body?: ?{| - +text: ?string - |}, - +$refType: Bar$ref, -|}; -export type Bar$data = Bar; -export type Bar$key = { - +$data?: Bar$data, - +$fragmentRefs: Bar$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type Foo$ref: FragmentReference; -declare export opaque type Foo$fragmentType: Foo$ref; -export type Foo = ?({| - +__typename: "User", - +name: string, - +$refType: Foo$ref, -|} | {| - +__typename: "Comment", - +body: ?{| - +text: ?string - |}, - +$refType: Foo$ref, -|} | {| - +__typename: "Feedback" | "Page" | "PhotoStory" | "Story", - +$refType: Foo$ref, -|}); -export type Foo$data = Foo; -export type Foo$key = { - +$data?: Foo$data, - +$fragmentRefs: Foo$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type Bar$ref: FragmentReference; -declare export opaque type Bar$fragmentType: Bar$ref; -export type Bar = ?{| - +name?: string, - +body?: ?{| - +text: ?string - |}, - +$refType: Bar$ref, -|}; -export type Bar$data = Bar; -export type Bar$key = { - +$data?: Bar$data, - +$fragmentRefs: Bar$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type Foo$ref: FragmentReference; -declare export opaque type Foo$fragmentType: Foo$ref; -export type Foo = ?({| - +__typename: "User", - +name: string, - +$refType: Foo$ref, -|} | {| - +__typename: "Comment", - +body: ?{| - +text: ?string - |}, - +$refType: Foo$ref, -|} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +__typename: "%other", - +$refType: Foo$ref, -|}); -export type Foo$data = Foo; -export type Foo$key = { - +$data?: Foo$data, - +$fragmentRefs: Foo$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import type { FragmentReference } from "relay-runtime"; declare export opaque type Bar$ref: FragmentReference; declare export opaque type Bar$fragmentType: Bar$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-raw-response-type.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-raw-response-type.expected index 6c838e870ceff..97b084a29690f 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-raw-response-type.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-raw-response-type.expected @@ -6,83 +6,6 @@ query MyQuery @raw_response_type { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type MyQueryVariables = {||}; -export type MyQueryResponse = ?{| - +me: {| - +id: string, - +name: string, - |} -|}; -export type MyQueryRawResponse = {| - +me: ?{| - +id: string, - +name: ?string, - |} -|}; -export type MyQuery = {| - variables: MyQueryVariables, - response: MyQueryResponse, - rawResponse: MyQueryRawResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type MyQueryVariables = {||}; -export type MyQueryResponse = ?{| - +me: {| - +id: string, - +name: string, - |} -|}; -export type MyQueryRawResponse = {| - +me: ?{| - +id: string, - +name: ?string, - |} -|}; -export type MyQuery = {| - variables: MyQueryVariables, - response: MyQueryResponse, - rawResponse: MyQueryRawResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type MyQueryVariables = {||}; -export type MyQueryResponse = ?{| - +me: {| - +id: string, - +name: string, - |} -|}; -export type MyQueryRawResponse = {| - +me: ?{| - +id: string, - +name: ?string, - |} -|}; -export type MyQuery = {| - variables: MyQueryVariables, - response: MyQueryResponse, - rawResponse: MyQueryRawResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type MyQueryVariables = {||}; export type MyQueryResponse = ?{| +me: {| diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throw-doesnt-bubbles-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throw-doesnt-bubbles-to-fragment.expected index 10b5887e09f5b..5b4d4853c20a2 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throw-doesnt-bubbles-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throw-doesnt-bubbles-to-fragment.expected @@ -4,71 +4,6 @@ fragment NonNullFragment on User { lastName @required(action: THROW) } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type NonNullFragment$ref: FragmentReference; -declare export opaque type NonNullFragment$fragmentType: NonNullFragment$ref; -export type NonNullFragment = {| - +firstName: ?string, - +lastName: string, - +$refType: NonNullFragment$ref, -|}; -export type NonNullFragment$data = NonNullFragment; -export type NonNullFragment$key = { - +$data?: NonNullFragment$data, - +$fragmentRefs: NonNullFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type NonNullFragment$ref: FragmentReference; -declare export opaque type NonNullFragment$fragmentType: NonNullFragment$ref; -export type NonNullFragment = {| - +firstName: ?string, - +lastName: string, - +$refType: NonNullFragment$ref, -|}; -export type NonNullFragment$data = NonNullFragment; -export type NonNullFragment$key = { - +$data?: NonNullFragment$data, - +$fragmentRefs: NonNullFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type NonNullFragment$ref: FragmentReference; -declare export opaque type NonNullFragment$fragmentType: NonNullFragment$ref; -export type NonNullFragment = {| - +firstName: ?string, - +lastName: string, - +$refType: NonNullFragment$ref, -|}; -export type NonNullFragment$data = NonNullFragment; -export type NonNullFragment$key = { - +$data?: NonNullFragment$data, - +$fragmentRefs: NonNullFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import type { FragmentReference } from "relay-runtime"; declare export opaque type NonNullFragment$ref: FragmentReference; declare export opaque type NonNullFragment$fragmentType: NonNullFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throw-doesnt-bubbles-to-query.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throw-doesnt-bubbles-to-query.expected index c32d8ab4a4279..2bbcbc3c1baa0 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throw-doesnt-bubbles-to-query.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throw-doesnt-bubbles-to-query.expected @@ -6,62 +6,6 @@ query FooQuery { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type FooQueryVariables = {||}; -export type FooQueryResponse = {| - +me: {| - +firstName: ?string, - +lastName: ?string, - |} -|}; -export type FooQuery = {| - variables: FooQueryVariables, - response: FooQueryResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type FooQueryVariables = {||}; -export type FooQueryResponse = {| - +me: {| - +firstName: ?string, - +lastName: ?string, - |} -|}; -export type FooQuery = {| - variables: FooQueryVariables, - response: FooQueryResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type FooQueryVariables = {||}; -export type FooQueryResponse = {| - +me: {| - +firstName: ?string, - +lastName: ?string, - |} -|}; -export type FooQuery = {| - variables: FooQueryVariables, - response: FooQueryResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type FooQueryVariables = {||}; export type FooQueryResponse = {| +me: {| diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throws-nested.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throws-nested.expected index fafea18175e11..8b1ab03230fd8 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throws-nested.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throws-nested.expected @@ -6,62 +6,6 @@ query FooQuery { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type FooQueryVariables = {||}; -export type FooQueryResponse = {| - +me: ?{| - +firstName: ?string, - +lastName: string, - |} -|}; -export type FooQuery = {| - variables: FooQueryVariables, - response: FooQueryResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type FooQueryVariables = {||}; -export type FooQueryResponse = {| - +me: ?{| - +firstName: ?string, - +lastName: string, - |} -|}; -export type FooQuery = {| - variables: FooQueryVariables, - response: FooQueryResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type FooQueryVariables = {||}; -export type FooQueryResponse = {| - +me: ?{| - +firstName: ?string, - +lastName: string, - |} -|}; -export type FooQuery = {| - variables: FooQueryVariables, - response: FooQueryResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type FooQueryVariables = {||}; export type FooQueryResponse = {| +me: ?{| diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throws-within-non-null-linked-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throws-within-non-null-linked-field.expected index c85589c49ec11..4960335a1198a 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throws-within-non-null-linked-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throws-within-non-null-linked-field.expected @@ -5,74 +5,6 @@ fragment SomeFragment on User { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type SomeFragment$ref: FragmentReference; -declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; -export type SomeFragment = {| - +nearest_neighbor: {| - +name: string - |}, - +$refType: SomeFragment$ref, -|}; -export type SomeFragment$data = SomeFragment; -export type SomeFragment$key = { - +$data?: SomeFragment$data, - +$fragmentRefs: SomeFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type SomeFragment$ref: FragmentReference; -declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; -export type SomeFragment = {| - +nearest_neighbor: {| - +name: string - |}, - +$refType: SomeFragment$ref, -|}; -export type SomeFragment$data = SomeFragment; -export type SomeFragment$key = { - +$data?: SomeFragment$data, - +$fragmentRefs: SomeFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type SomeFragment$ref: FragmentReference; -declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; -export type SomeFragment = {| - +nearest_neighbor: {| - +name: string - |}, - +$refType: SomeFragment$ref, -|}; -export type SomeFragment$data = SomeFragment; -export type SomeFragment$key = { - +$data?: SomeFragment$data, - +$fragmentRefs: SomeFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import type { FragmentReference } from "relay-runtime"; declare export opaque type SomeFragment$ref: FragmentReference; declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throws-within-non-null-plural-linked-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throws-within-non-null-plural-linked-field.expected index 390ffe560b996..c67fd1e885d22 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throws-within-non-null-plural-linked-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throws-within-non-null-plural-linked-field.expected @@ -5,74 +5,6 @@ fragment SomeFragment on User { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type SomeFragment$ref: FragmentReference; -declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; -export type SomeFragment = {| - +neighbors: ?$ReadOnlyArray<{| - +name: string - |}>, - +$refType: SomeFragment$ref, -|}; -export type SomeFragment$data = SomeFragment; -export type SomeFragment$key = { - +$data?: SomeFragment$data, - +$fragmentRefs: SomeFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type SomeFragment$ref: FragmentReference; -declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; -export type SomeFragment = {| - +neighbors: ?$ReadOnlyArray<{| - +name: string - |}>, - +$refType: SomeFragment$ref, -|}; -export type SomeFragment$data = SomeFragment; -export type SomeFragment$key = { - +$data?: SomeFragment$data, - +$fragmentRefs: SomeFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type SomeFragment$ref: FragmentReference; -declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; -export type SomeFragment = {| - +neighbors: ?$ReadOnlyArray<{| - +name: string - |}>, - +$refType: SomeFragment$ref, -|}; -export type SomeFragment$data = SomeFragment; -export type SomeFragment$key = { - +$data?: SomeFragment$data, - +$fragmentRefs: SomeFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import type { FragmentReference } from "relay-runtime"; declare export opaque type SomeFragment$ref: FragmentReference; declare export opaque type SomeFragment$fragmentType: SomeFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required.expected index 591f753c13b2d..e82aac670513c 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required.expected @@ -6,62 +6,6 @@ query FooQuery { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type FooQueryVariables = {||}; -export type FooQueryResponse = {| - +me: ?{| - +firstName: ?string, - +lastName: string, - |} -|}; -export type FooQuery = {| - variables: FooQueryVariables, - response: FooQueryResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type FooQueryVariables = {||}; -export type FooQueryResponse = {| - +me: ?{| - +firstName: ?string, - +lastName: string, - |} -|}; -export type FooQuery = {| - variables: FooQueryVariables, - response: FooQueryResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type FooQueryVariables = {||}; -export type FooQueryResponse = {| - +me: ?{| - +firstName: ?string, - +lastName: string, - |} -|}; -export type FooQuery = {| - variables: FooQueryVariables, - response: FooQueryResponse, -|}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type FooQueryVariables = {||}; export type FooQueryResponse = {| +me: ?{| diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/roots.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/roots.expected index fdbb3c02203d4..e9ca5bcadf722 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/roots.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/roots.expected @@ -25,242 +25,6 @@ subscription TestSubscription($input: FeedbackLikeInput) { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type ExampleQueryVariables = {| - id: string -|}; -export type ExampleQueryResponse = {| - +node: ?{| - +id: string - |} -|}; -export type ExampleQuery = {| - variables: ExampleQueryVariables, - response: ExampleQueryResponse, -|}; -------------------------------------------------------------------------------- -export type CommentCreateInput = {| - clientMutationId?: ?string, - feedbackId?: ?string, - feedback?: ?CommentfeedbackFeedback, -|}; -export type CommentfeedbackFeedback = {| - comment?: ?FeedbackcommentComment -|}; -export type FeedbackcommentComment = {| - feedback?: ?CommentfeedbackFeedback -|}; -export type TestMutationVariables = {| - input: CommentCreateInput -|}; -export type TestMutationResponse = {| - +commentCreate: ?{| - +comment: ?{| - +id: string - |} - |} -|}; -export type TestMutation = {| - variables: TestMutationVariables, - response: TestMutationResponse, -|}; -------------------------------------------------------------------------------- -export type FeedbackLikeInput = {| - clientMutationId?: ?string, - feedbackId?: ?string, -|}; -export type TestSubscriptionVariables = {| - input?: ?FeedbackLikeInput -|}; -export type TestSubscriptionResponse = {| - +feedbackLikeSubscribe: ?{| - +feedback: ?{| - +id: string - |} - |} -|}; -export type TestSubscription = {| - variables: TestSubscriptionVariables, - response: TestSubscriptionResponse, -|}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type ExampleFragment$ref: FragmentReference; -declare export opaque type ExampleFragment$fragmentType: ExampleFragment$ref; -export type ExampleFragment = {| - +id: string, - +$refType: ExampleFragment$ref, -|}; -export type ExampleFragment$data = ExampleFragment; -export type ExampleFragment$key = { - +$data?: ExampleFragment$data, - +$fragmentRefs: ExampleFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type ExampleQueryVariables = {| - id: string -|}; -export type ExampleQueryResponse = {| - +node: ?{| - +id: string - |} -|}; -export type ExampleQuery = {| - variables: ExampleQueryVariables, - response: ExampleQueryResponse, -|}; -------------------------------------------------------------------------------- -export type CommentCreateInput = {| - clientMutationId?: ?string, - feedbackId?: ?string, - feedback?: ?CommentfeedbackFeedback, -|}; -export type CommentfeedbackFeedback = {| - comment?: ?FeedbackcommentComment -|}; -export type FeedbackcommentComment = {| - feedback?: ?CommentfeedbackFeedback -|}; -export type TestMutationVariables = {| - input: CommentCreateInput -|}; -export type TestMutationResponse = {| - +commentCreate: ?{| - +comment: ?{| - +id: string - |} - |} -|}; -export type TestMutation = {| - variables: TestMutationVariables, - response: TestMutationResponse, -|}; -------------------------------------------------------------------------------- -export type FeedbackLikeInput = {| - clientMutationId?: ?string, - feedbackId?: ?string, -|}; -export type TestSubscriptionVariables = {| - input?: ?FeedbackLikeInput -|}; -export type TestSubscriptionResponse = {| - +feedbackLikeSubscribe: ?{| - +feedback: ?{| - +id: string - |} - |} -|}; -export type TestSubscription = {| - variables: TestSubscriptionVariables, - response: TestSubscriptionResponse, -|}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type ExampleFragment$ref: FragmentReference; -declare export opaque type ExampleFragment$fragmentType: ExampleFragment$ref; -export type ExampleFragment = {| - +id: string, - +$refType: ExampleFragment$ref, -|}; -export type ExampleFragment$data = ExampleFragment; -export type ExampleFragment$key = { - +$data?: ExampleFragment$data, - +$fragmentRefs: ExampleFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type ExampleQueryVariables = {| - id: string -|}; -export type ExampleQueryResponse = {| - +node: ?{| - +id: string - |} -|}; -export type ExampleQuery = {| - variables: ExampleQueryVariables, - response: ExampleQueryResponse, -|}; -------------------------------------------------------------------------------- -export type CommentCreateInput = {| - clientMutationId?: ?string, - feedbackId?: ?string, - feedback?: ?CommentfeedbackFeedback, -|}; -export type CommentfeedbackFeedback = {| - comment?: ?FeedbackcommentComment -|}; -export type FeedbackcommentComment = {| - feedback?: ?CommentfeedbackFeedback -|}; -export type TestMutationVariables = {| - input: CommentCreateInput -|}; -export type TestMutationResponse = {| - +commentCreate: ?{| - +comment: ?{| - +id: string - |} - |} -|}; -export type TestMutation = {| - variables: TestMutationVariables, - response: TestMutationResponse, -|}; -------------------------------------------------------------------------------- -export type FeedbackLikeInput = {| - clientMutationId?: ?string, - feedbackId?: ?string, -|}; -export type TestSubscriptionVariables = {| - input?: ?FeedbackLikeInput -|}; -export type TestSubscriptionResponse = {| - +feedbackLikeSubscribe: ?{| - +feedback: ?{| - +id: string - |} - |} -|}; -export type TestSubscription = {| - variables: TestSubscriptionVariables, - response: TestSubscriptionResponse, -|}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type ExampleFragment$ref: FragmentReference; -declare export opaque type ExampleFragment$fragmentType: ExampleFragment$ref; -export type ExampleFragment = {| - +id: string, - +$refType: ExampleFragment$ref, -|}; -export type ExampleFragment$data = ExampleFragment; -export type ExampleFragment$key = { - +$data?: ExampleFragment$data, - +$fragmentRefs: ExampleFragment$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type ExampleQueryVariables = {| id: string |}; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/scalar-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/scalar-field.expected index 39e67c03adb7e..fa4e94725ada7 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/scalar-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/scalar-field.expected @@ -13,101 +13,6 @@ fragment ScalarField on User { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type PersonalityTraits = "CHEERFUL" | "DERISIVE" | "HELPFUL" | "SNARKY"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type ScalarField$ref: FragmentReference; -declare export opaque type ScalarField$fragmentType: ScalarField$ref; -export type ScalarField = {| - +id: string, - +name: ?string, - +websites: ?$ReadOnlyArray, - +traits: ?$ReadOnlyArray, - +aliasedLinkedField: ?{| - +aliasedField: ?number - |}, - +screennames: ?$ReadOnlyArray, - +$refType: ScalarField$ref, -|}; -export type ScalarField$data = ScalarField; -export type ScalarField$key = { - +$data?: ScalarField$data, - +$fragmentRefs: ScalarField$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type PersonalityTraits = "CHEERFUL" | "DERISIVE" | "HELPFUL" | "SNARKY" | "%future added value"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type ScalarField$ref: FragmentReference; -declare export opaque type ScalarField$fragmentType: ScalarField$ref; -export type ScalarField = {| - +id: string, - +name: ?string, - +websites: ?$ReadOnlyArray, - +traits: ?$ReadOnlyArray, - +aliasedLinkedField: ?{| - +aliasedField: ?number - |}, - +screennames: ?$ReadOnlyArray, - +$refType: ScalarField$ref, -|}; -export type ScalarField$data = ScalarField; -export type ScalarField$key = { - +$data?: ScalarField$data, - +$fragmentRefs: ScalarField$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type PersonalityTraits = "CHEERFUL" | "DERISIVE" | "HELPFUL" | "SNARKY"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type ScalarField$ref: FragmentReference; -declare export opaque type ScalarField$fragmentType: ScalarField$ref; -export type ScalarField = {| - +id: string, - +name: ?string, - +websites: ?$ReadOnlyArray, - +traits: ?$ReadOnlyArray, - +aliasedLinkedField: ?{| - +aliasedField: ?number - |}, - +screennames: ?$ReadOnlyArray, - +$refType: ScalarField$ref, -|}; -export type ScalarField$data = ScalarField; -export type ScalarField$key = { - +$data?: ScalarField$data, - +$fragmentRefs: ScalarField$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type PersonalityTraits = "CHEERFUL" | "DERISIVE" | "HELPFUL" | "SNARKY" | "%future added value"; import type { FragmentReference } from "relay-runtime"; declare export opaque type ScalarField$ref: FragmentReference; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/simple.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/simple.expected index 682c89107ffeb..5e073ec3e140e 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/simple.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/simple.expected @@ -8,83 +8,6 @@ fragment LinkedField on User { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type LinkedField$ref: FragmentReference; -declare export opaque type LinkedField$fragmentType: LinkedField$ref; -export type LinkedField = {| - +name: ?string, - +profilePicture: ?{| - +uri: ?string, - +width: ?number, - +height: ?number, - |}, - +$refType: LinkedField$ref, -|}; -export type LinkedField$data = LinkedField; -export type LinkedField$key = { - +$data?: LinkedField$data, - +$fragmentRefs: LinkedField$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type LinkedField$ref: FragmentReference; -declare export opaque type LinkedField$fragmentType: LinkedField$ref; -export type LinkedField = {| - +name: ?string, - +profilePicture: ?{| - +uri: ?string, - +width: ?number, - +height: ?number, - |}, - +$refType: LinkedField$ref, -|}; -export type LinkedField$data = LinkedField; -export type LinkedField$key = { - +$data?: LinkedField$data, - +$fragmentRefs: LinkedField$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type LinkedField$ref: FragmentReference; -declare export opaque type LinkedField$fragmentType: LinkedField$ref; -export type LinkedField = {| - +name: ?string, - +profilePicture: ?{| - +uri: ?string, - +width: ?number, - +height: ?number, - |}, - +$refType: LinkedField$ref, -|}; -export type LinkedField$data = LinkedField; -export type LinkedField$key = { - +$data?: LinkedField$data, - +$fragmentRefs: LinkedField$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import type { FragmentReference } from "relay-runtime"; declare export opaque type LinkedField$ref: FragmentReference; declare export opaque type LinkedField$fragmentType: LinkedField$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-inside-with-overlapping-fields.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-inside-with-overlapping-fields.expected index 19ad6ea1cb05e..687c34aa09f14 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-inside-with-overlapping-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-inside-with-overlapping-fields.expected @@ -16,105 +16,6 @@ fragment TypenameInsideWithOverlappingFields on Viewer { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type TypenameInsideWithOverlappingFields$ref: FragmentReference; -declare export opaque type TypenameInsideWithOverlappingFields$fragmentType: TypenameInsideWithOverlappingFields$ref; -export type TypenameInsideWithOverlappingFields = {| - +actor: ?({| - +__typename: "Page", - +id: string, - +name: ?string, - |} | {| - +__typename: "User", - +id: string, - +name: ?string, - +profile_picture: ?{| - +uri: ?string - |}, - |}), - +$refType: TypenameInsideWithOverlappingFields$ref, -|}; -export type TypenameInsideWithOverlappingFields$data = TypenameInsideWithOverlappingFields; -export type TypenameInsideWithOverlappingFields$key = { - +$data?: TypenameInsideWithOverlappingFields$data, - +$fragmentRefs: TypenameInsideWithOverlappingFields$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type TypenameInsideWithOverlappingFields$ref: FragmentReference; -declare export opaque type TypenameInsideWithOverlappingFields$fragmentType: TypenameInsideWithOverlappingFields$ref; -export type TypenameInsideWithOverlappingFields = {| - +actor: ?({| - +__typename: "Page", - +id: string, - +name: ?string, - |} | {| - +__typename: "User", - +id: string, - +name: ?string, - +profile_picture: ?{| - +uri: ?string - |}, - |}), - +$refType: TypenameInsideWithOverlappingFields$ref, -|}; -export type TypenameInsideWithOverlappingFields$data = TypenameInsideWithOverlappingFields; -export type TypenameInsideWithOverlappingFields$key = { - +$data?: TypenameInsideWithOverlappingFields$data, - +$fragmentRefs: TypenameInsideWithOverlappingFields$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type TypenameInsideWithOverlappingFields$ref: FragmentReference; -declare export opaque type TypenameInsideWithOverlappingFields$fragmentType: TypenameInsideWithOverlappingFields$ref; -export type TypenameInsideWithOverlappingFields = {| - +actor: ?({| - +__typename: "Page", - +id: string, - +name: ?string, - |} | {| - +__typename: "User", - +id: string, - +name: ?string, - +profile_picture: ?{| - +uri: ?string - |}, - |} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +__typename: "%other" - |}), - +$refType: TypenameInsideWithOverlappingFields$ref, -|}; -export type TypenameInsideWithOverlappingFields$data = TypenameInsideWithOverlappingFields; -export type TypenameInsideWithOverlappingFields$key = { - +$data?: TypenameInsideWithOverlappingFields$data, - +$fragmentRefs: TypenameInsideWithOverlappingFields$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import type { FragmentReference } from "relay-runtime"; declare export opaque type TypenameInsideWithOverlappingFields$ref: FragmentReference; declare export opaque type TypenameInsideWithOverlappingFields$fragmentType: TypenameInsideWithOverlappingFields$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected index 3a568585a4fe6..2c1958daed161 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected @@ -80,540 +80,6 @@ fragment TypenameAliases on Actor { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type TypenameAlias$ref: FragmentReference; -declare export opaque type TypenameAlias$fragmentType: TypenameAlias$ref; -export type TypenameAlias = {| - +_typeAlias: "User", - +firstName: ?string, - +$refType: TypenameAlias$ref, -|} | {| - +_typeAlias: "Page", - +username: ?string, - +$refType: TypenameAlias$ref, -|}; -export type TypenameAlias$data = TypenameAlias; -export type TypenameAlias$key = { - +$data?: TypenameAlias$data, - +$fragmentRefs: TypenameAlias$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type TypenameAliases$ref: FragmentReference; -declare export opaque type TypenameAliases$fragmentType: TypenameAliases$ref; -export type TypenameAliases = {| - +_typeAlias1: "User", - +_typeAlias2: "User", - +firstName: ?string, - +$refType: TypenameAliases$ref, -|} | {| - +_typeAlias1: "Page", - +_typeAlias2: "Page", - +username: ?string, - +$refType: TypenameAliases$ref, -|}; -export type TypenameAliases$data = TypenameAliases; -export type TypenameAliases$key = { - +$data?: TypenameAliases$data, - +$fragmentRefs: TypenameAliases$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type TypenameInside$ref: FragmentReference; -declare export opaque type TypenameInside$fragmentType: TypenameInside$ref; -export type TypenameInside = {| - +__typename: "User", - +firstName: ?string, - +$refType: TypenameInside$ref, -|} | {| - +__typename: "Page", - +username: ?string, - +$refType: TypenameInside$ref, -|}; -export type TypenameInside$data = TypenameInside; -export type TypenameInside$key = { - +$data?: TypenameInside$data, - +$fragmentRefs: TypenameInside$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type TypenameOutside$ref: FragmentReference; -declare export opaque type TypenameOutside$fragmentType: TypenameOutside$ref; -export type TypenameOutside = {| - +__typename: "User", - +firstName: ?string, - +$refType: TypenameOutside$ref, -|} | {| - +__typename: "Page", - +username: ?string, - +$refType: TypenameOutside$ref, -|}; -export type TypenameOutside$data = TypenameOutside; -export type TypenameOutside$key = { - +$data?: TypenameOutside$data, - +$fragmentRefs: TypenameOutside$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type TypenameOutsideWithAbstractType$ref: FragmentReference; -declare export opaque type TypenameOutsideWithAbstractType$fragmentType: TypenameOutsideWithAbstractType$ref; -export type TypenameOutsideWithAbstractType = {| - +__typename: "User", - +firstName: ?string, - +address: ?{| - +street: ?string, - +city: ?string, - |}, - +username?: ?string, - +address?: ?{| - +city: ?string, - +country: ?string, - |}, - +$refType: TypenameOutsideWithAbstractType$ref, -|} | {| - +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story", - +username?: ?string, - +address?: ?{| - +city: ?string, - +country: ?string, - |}, - +$refType: TypenameOutsideWithAbstractType$ref, -|}; -export type TypenameOutsideWithAbstractType$data = TypenameOutsideWithAbstractType; -export type TypenameOutsideWithAbstractType$key = { - +$data?: TypenameOutsideWithAbstractType$data, - +$fragmentRefs: TypenameOutsideWithAbstractType$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type TypenameWithCommonSelections$ref: FragmentReference; -declare export opaque type TypenameWithCommonSelections$fragmentType: TypenameWithCommonSelections$ref; -export type TypenameWithCommonSelections = {| - +__typename: "User", - +firstName: ?string, - +name: ?string, - +$refType: TypenameWithCommonSelections$ref, -|} | {| - +__typename: "Page", - +username: ?string, - +name: ?string, - +$refType: TypenameWithCommonSelections$ref, -|}; -export type TypenameWithCommonSelections$data = TypenameWithCommonSelections; -export type TypenameWithCommonSelections$key = { - +$data?: TypenameWithCommonSelections$data, - +$fragmentRefs: TypenameWithCommonSelections$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type TypenameWithoutSpreads$ref: FragmentReference; -declare export opaque type TypenameWithoutSpreads$fragmentType: TypenameWithoutSpreads$ref; -export type TypenameWithoutSpreads = {| - +__typename: "User", - +firstName: ?string, - +$refType: TypenameWithoutSpreads$ref, -|}; -export type TypenameWithoutSpreads$data = TypenameWithoutSpreads; -export type TypenameWithoutSpreads$key = { - +$data?: TypenameWithoutSpreads$data, - +$fragmentRefs: TypenameWithoutSpreads$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type TypenameWithoutSpreadsAbstractType$ref: FragmentReference; -declare export opaque type TypenameWithoutSpreadsAbstractType$fragmentType: TypenameWithoutSpreadsAbstractType$ref; -export type TypenameWithoutSpreadsAbstractType = {| - +__typename: string, - +id: string, - +$refType: TypenameWithoutSpreadsAbstractType$ref, -|}; -export type TypenameWithoutSpreadsAbstractType$data = TypenameWithoutSpreadsAbstractType; -export type TypenameWithoutSpreadsAbstractType$key = { - +$data?: TypenameWithoutSpreadsAbstractType$data, - +$fragmentRefs: TypenameWithoutSpreadsAbstractType$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type TypenameAlias$ref: FragmentReference; -declare export opaque type TypenameAlias$fragmentType: TypenameAlias$ref; -export type TypenameAlias = {| - +_typeAlias: "User", - +firstName: ?string, - +$refType: TypenameAlias$ref, -|} | {| - +_typeAlias: "Page", - +username: ?string, - +$refType: TypenameAlias$ref, -|}; -export type TypenameAlias$data = TypenameAlias; -export type TypenameAlias$key = { - +$data?: TypenameAlias$data, - +$fragmentRefs: TypenameAlias$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type TypenameAliases$ref: FragmentReference; -declare export opaque type TypenameAliases$fragmentType: TypenameAliases$ref; -export type TypenameAliases = {| - +_typeAlias1: "User", - +_typeAlias2: "User", - +firstName: ?string, - +$refType: TypenameAliases$ref, -|} | {| - +_typeAlias1: "Page", - +_typeAlias2: "Page", - +username: ?string, - +$refType: TypenameAliases$ref, -|}; -export type TypenameAliases$data = TypenameAliases; -export type TypenameAliases$key = { - +$data?: TypenameAliases$data, - +$fragmentRefs: TypenameAliases$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type TypenameInside$ref: FragmentReference; -declare export opaque type TypenameInside$fragmentType: TypenameInside$ref; -export type TypenameInside = {| - +__typename: "User", - +firstName: ?string, - +$refType: TypenameInside$ref, -|} | {| - +__typename: "Page", - +username: ?string, - +$refType: TypenameInside$ref, -|}; -export type TypenameInside$data = TypenameInside; -export type TypenameInside$key = { - +$data?: TypenameInside$data, - +$fragmentRefs: TypenameInside$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type TypenameOutside$ref: FragmentReference; -declare export opaque type TypenameOutside$fragmentType: TypenameOutside$ref; -export type TypenameOutside = {| - +__typename: "User", - +firstName: ?string, - +$refType: TypenameOutside$ref, -|} | {| - +__typename: "Page", - +username: ?string, - +$refType: TypenameOutside$ref, -|}; -export type TypenameOutside$data = TypenameOutside; -export type TypenameOutside$key = { - +$data?: TypenameOutside$data, - +$fragmentRefs: TypenameOutside$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type TypenameOutsideWithAbstractType$ref: FragmentReference; -declare export opaque type TypenameOutsideWithAbstractType$fragmentType: TypenameOutsideWithAbstractType$ref; -export type TypenameOutsideWithAbstractType = {| - +__typename: "User", - +firstName: ?string, - +address: ?{| - +street: ?string, - +city: ?string, - |}, - +username?: ?string, - +address?: ?{| - +city: ?string, - +country: ?string, - |}, - +$refType: TypenameOutsideWithAbstractType$ref, -|} | {| - +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story", - +username?: ?string, - +address?: ?{| - +city: ?string, - +country: ?string, - |}, - +$refType: TypenameOutsideWithAbstractType$ref, -|}; -export type TypenameOutsideWithAbstractType$data = TypenameOutsideWithAbstractType; -export type TypenameOutsideWithAbstractType$key = { - +$data?: TypenameOutsideWithAbstractType$data, - +$fragmentRefs: TypenameOutsideWithAbstractType$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type TypenameWithCommonSelections$ref: FragmentReference; -declare export opaque type TypenameWithCommonSelections$fragmentType: TypenameWithCommonSelections$ref; -export type TypenameWithCommonSelections = {| - +__typename: "User", - +firstName: ?string, - +name: ?string, - +$refType: TypenameWithCommonSelections$ref, -|} | {| - +__typename: "Page", - +username: ?string, - +name: ?string, - +$refType: TypenameWithCommonSelections$ref, -|}; -export type TypenameWithCommonSelections$data = TypenameWithCommonSelections; -export type TypenameWithCommonSelections$key = { - +$data?: TypenameWithCommonSelections$data, - +$fragmentRefs: TypenameWithCommonSelections$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type TypenameWithoutSpreads$ref: FragmentReference; -declare export opaque type TypenameWithoutSpreads$fragmentType: TypenameWithoutSpreads$ref; -export type TypenameWithoutSpreads = {| - +__typename: "User", - +firstName: ?string, - +$refType: TypenameWithoutSpreads$ref, -|}; -export type TypenameWithoutSpreads$data = TypenameWithoutSpreads; -export type TypenameWithoutSpreads$key = { - +$data?: TypenameWithoutSpreads$data, - +$fragmentRefs: TypenameWithoutSpreads$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type TypenameWithoutSpreadsAbstractType$ref: FragmentReference; -declare export opaque type TypenameWithoutSpreadsAbstractType$fragmentType: TypenameWithoutSpreadsAbstractType$ref; -export type TypenameWithoutSpreadsAbstractType = {| - +__typename: string, - +id: string, - +$refType: TypenameWithoutSpreadsAbstractType$ref, -|}; -export type TypenameWithoutSpreadsAbstractType$data = TypenameWithoutSpreadsAbstractType; -export type TypenameWithoutSpreadsAbstractType$key = { - +$data?: TypenameWithoutSpreadsAbstractType$data, - +$fragmentRefs: TypenameWithoutSpreadsAbstractType$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type TypenameAlias$ref: FragmentReference; -declare export opaque type TypenameAlias$fragmentType: TypenameAlias$ref; -export type TypenameAlias = {| - +_typeAlias: "User", - +firstName: ?string, - +$refType: TypenameAlias$ref, -|} | {| - +_typeAlias: "Page", - +username: ?string, - +$refType: TypenameAlias$ref, -|} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +_typeAlias: "%other", - +$refType: TypenameAlias$ref, -|}; -export type TypenameAlias$data = TypenameAlias; -export type TypenameAlias$key = { - +$data?: TypenameAlias$data, - +$fragmentRefs: TypenameAlias$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type TypenameAliases$ref: FragmentReference; -declare export opaque type TypenameAliases$fragmentType: TypenameAliases$ref; -export type TypenameAliases = {| - +_typeAlias1: "User", - +_typeAlias2: "User", - +firstName: ?string, - +$refType: TypenameAliases$ref, -|} | {| - +_typeAlias1: "Page", - +_typeAlias2: "Page", - +username: ?string, - +$refType: TypenameAliases$ref, -|} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +_typeAlias1: "%other", - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +_typeAlias2: "%other", - +$refType: TypenameAliases$ref, -|}; -export type TypenameAliases$data = TypenameAliases; -export type TypenameAliases$key = { - +$data?: TypenameAliases$data, - +$fragmentRefs: TypenameAliases$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type TypenameInside$ref: FragmentReference; -declare export opaque type TypenameInside$fragmentType: TypenameInside$ref; -export type TypenameInside = {| - +__typename: "User", - +firstName: ?string, - +$refType: TypenameInside$ref, -|} | {| - +__typename: "Page", - +username: ?string, - +$refType: TypenameInside$ref, -|} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +__typename: "%other", - +$refType: TypenameInside$ref, -|}; -export type TypenameInside$data = TypenameInside; -export type TypenameInside$key = { - +$data?: TypenameInside$data, - +$fragmentRefs: TypenameInside$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type TypenameOutside$ref: FragmentReference; -declare export opaque type TypenameOutside$fragmentType: TypenameOutside$ref; -export type TypenameOutside = {| - +__typename: "User", - +firstName: ?string, - +$refType: TypenameOutside$ref, -|} | {| - +__typename: "Page", - +username: ?string, - +$refType: TypenameOutside$ref, -|} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +__typename: "%other", - +$refType: TypenameOutside$ref, -|}; -export type TypenameOutside$data = TypenameOutside; -export type TypenameOutside$key = { - +$data?: TypenameOutside$data, - +$fragmentRefs: TypenameOutside$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type TypenameOutsideWithAbstractType$ref: FragmentReference; -declare export opaque type TypenameOutsideWithAbstractType$fragmentType: TypenameOutsideWithAbstractType$ref; -export type TypenameOutsideWithAbstractType = {| - +__typename: "User", - +firstName: ?string, - +address: ?{| - +street: ?string, - +city: ?string, - |}, - +username?: ?string, - +address?: ?{| - +city: ?string, - +country: ?string, - |}, - +$refType: TypenameOutsideWithAbstractType$ref, -|} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +__typename: "%other", - +username?: ?string, - +address?: ?{| - +city: ?string, - +country: ?string, - |}, - +$refType: TypenameOutsideWithAbstractType$ref, -|}; -export type TypenameOutsideWithAbstractType$data = TypenameOutsideWithAbstractType; -export type TypenameOutsideWithAbstractType$key = { - +$data?: TypenameOutsideWithAbstractType$data, - +$fragmentRefs: TypenameOutsideWithAbstractType$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type TypenameWithCommonSelections$ref: FragmentReference; -declare export opaque type TypenameWithCommonSelections$fragmentType: TypenameWithCommonSelections$ref; -export type TypenameWithCommonSelections = {| - +__typename: "User", - +firstName: ?string, - +name: ?string, - +$refType: TypenameWithCommonSelections$ref, -|} | {| - +__typename: "Page", - +username: ?string, - +name: ?string, - +$refType: TypenameWithCommonSelections$ref, -|} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +__typename: "%other", - +name: ?string, - +$refType: TypenameWithCommonSelections$ref, -|}; -export type TypenameWithCommonSelections$data = TypenameWithCommonSelections; -export type TypenameWithCommonSelections$key = { - +$data?: TypenameWithCommonSelections$data, - +$fragmentRefs: TypenameWithCommonSelections$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type TypenameWithoutSpreads$ref: FragmentReference; -declare export opaque type TypenameWithoutSpreads$fragmentType: TypenameWithoutSpreads$ref; -export type TypenameWithoutSpreads = {| - +__typename: "User", - +firstName: ?string, - +$refType: TypenameWithoutSpreads$ref, -|}; -export type TypenameWithoutSpreads$data = TypenameWithoutSpreads; -export type TypenameWithoutSpreads$key = { - +$data?: TypenameWithoutSpreads$data, - +$fragmentRefs: TypenameWithoutSpreads$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type TypenameWithoutSpreadsAbstractType$ref: FragmentReference; -declare export opaque type TypenameWithoutSpreadsAbstractType$fragmentType: TypenameWithoutSpreadsAbstractType$ref; -export type TypenameWithoutSpreadsAbstractType = {| - +__typename: string, - +id: string, - +$refType: TypenameWithoutSpreadsAbstractType$ref, -|}; -export type TypenameWithoutSpreadsAbstractType$data = TypenameWithoutSpreadsAbstractType; -export type TypenameWithoutSpreadsAbstractType$key = { - +$data?: TypenameWithoutSpreadsAbstractType$data, - +$fragmentRefs: TypenameWithoutSpreadsAbstractType$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import type { FragmentReference } from "relay-runtime"; declare export opaque type TypenameAlias$ref: FragmentReference; declare export opaque type TypenameAlias$fragmentType: TypenameAlias$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/unmasked-fragment-spreads.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/unmasked-fragment-spreads.expected index c2c7727c5bda3..76c43e1335d38 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/unmasked-fragment-spreads.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/unmasked-fragment-spreads.expected @@ -26,221 +26,6 @@ fragment AnotherRecursiveFragment on Image { height } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type AnotherRecursiveFragment$ref: FragmentReference; -declare export opaque type AnotherRecursiveFragment$fragmentType: AnotherRecursiveFragment$ref; -export type AnotherRecursiveFragment = {| - +uri: ?string, - +height: ?number, - +$refType: AnotherRecursiveFragment$ref, -|}; -export type AnotherRecursiveFragment$data = AnotherRecursiveFragment; -export type AnotherRecursiveFragment$key = { - +$data?: AnotherRecursiveFragment$data, - +$fragmentRefs: AnotherRecursiveFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type PhotoFragment$ref: FragmentReference; -declare export opaque type PhotoFragment$fragmentType: PhotoFragment$ref; -export type PhotoFragment = {| - +uri: ?string, - +width: ?number, - +$refType: PhotoFragment$ref, -|}; -export type PhotoFragment$data = PhotoFragment; -export type PhotoFragment$key = { - +$data?: PhotoFragment$data, - +$fragmentRefs: PhotoFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type RecursiveFragment$ref: FragmentReference; -declare export opaque type RecursiveFragment$fragmentType: RecursiveFragment$ref; -export type RecursiveFragment = { - +uri: ?string, - +width: ?number, - ... -}; -export type RecursiveFragment$data = RecursiveFragment; -export type RecursiveFragment$key = { - +$data?: RecursiveFragment$data, - +$fragmentRefs: RecursiveFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { PhotoFragment$ref } from "PhotoFragment.graphql"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type UserProfile$ref: FragmentReference; -declare export opaque type UserProfile$fragmentType: UserProfile$ref; -export type UserProfile = {| - +profilePicture: ?{| - +uri: ?string, - +width: ?number, - +height: ?number, - +$fragmentRefs: PhotoFragment$ref, - |}, - +$refType: UserProfile$ref, -|}; -export type UserProfile$data = UserProfile; -export type UserProfile$key = { - +$data?: UserProfile$data, - +$fragmentRefs: UserProfile$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type AnotherRecursiveFragment$ref: FragmentReference; -declare export opaque type AnotherRecursiveFragment$fragmentType: AnotherRecursiveFragment$ref; -export type AnotherRecursiveFragment = {| - +uri: ?string, - +height: ?number, - +$refType: AnotherRecursiveFragment$ref, -|}; -export type AnotherRecursiveFragment$data = AnotherRecursiveFragment; -export type AnotherRecursiveFragment$key = { - +$data?: AnotherRecursiveFragment$data, - +$fragmentRefs: AnotherRecursiveFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type PhotoFragment$ref: FragmentReference; -declare export opaque type PhotoFragment$fragmentType: PhotoFragment$ref; -export type PhotoFragment = {| - +uri: ?string, - +width: ?number, - +$refType: PhotoFragment$ref, -|}; -export type PhotoFragment$data = PhotoFragment; -export type PhotoFragment$key = { - +$data?: PhotoFragment$data, - +$fragmentRefs: PhotoFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type RecursiveFragment$ref: FragmentReference; -declare export opaque type RecursiveFragment$fragmentType: RecursiveFragment$ref; -export type RecursiveFragment = { - +uri: ?string, - +width: ?number, - ... -}; -export type RecursiveFragment$data = RecursiveFragment; -export type RecursiveFragment$key = { - +$data?: RecursiveFragment$data, - +$fragmentRefs: RecursiveFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { PhotoFragment$ref } from "PhotoFragment.graphql"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type UserProfile$ref: FragmentReference; -declare export opaque type UserProfile$fragmentType: UserProfile$ref; -export type UserProfile = {| - +profilePicture: ?{| - +uri: ?string, - +width: ?number, - +height: ?number, - +$fragmentRefs: PhotoFragment$ref, - |}, - +$refType: UserProfile$ref, -|}; -export type UserProfile$data = UserProfile; -export type UserProfile$key = { - +$data?: UserProfile$data, - +$fragmentRefs: UserProfile$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import type { FragmentReference } from "relay-runtime"; -declare export opaque type AnotherRecursiveFragment$ref: FragmentReference; -declare export opaque type AnotherRecursiveFragment$fragmentType: AnotherRecursiveFragment$ref; -export type AnotherRecursiveFragment = {| - +uri: ?string, - +height: ?number, - +$refType: AnotherRecursiveFragment$ref, -|}; -export type AnotherRecursiveFragment$data = AnotherRecursiveFragment; -export type AnotherRecursiveFragment$key = { - +$data?: AnotherRecursiveFragment$data, - +$fragmentRefs: AnotherRecursiveFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type PhotoFragment$ref: FragmentReference; -declare export opaque type PhotoFragment$fragmentType: PhotoFragment$ref; -export type PhotoFragment = {| - +uri: ?string, - +width: ?number, - +$refType: PhotoFragment$ref, -|}; -export type PhotoFragment$data = PhotoFragment; -export type PhotoFragment$key = { - +$data?: PhotoFragment$data, - +$fragmentRefs: PhotoFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { FragmentReference } from "relay-runtime"; -declare export opaque type RecursiveFragment$ref: FragmentReference; -declare export opaque type RecursiveFragment$fragmentType: RecursiveFragment$ref; -export type RecursiveFragment = { - +uri: ?string, - +width: ?number, - ... -}; -export type RecursiveFragment$data = RecursiveFragment; -export type RecursiveFragment$key = { - +$data?: RecursiveFragment$data, - +$fragmentRefs: RecursiveFragment$ref, - ... -}; -------------------------------------------------------------------------------- -import type { PhotoFragment$ref } from "PhotoFragment.graphql"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type UserProfile$ref: FragmentReference; -declare export opaque type UserProfile$fragmentType: UserProfile$ref; -export type UserProfile = {| - +profilePicture: ?{| - +uri: ?string, - +width: ?number, - +height: ?number, - +$fragmentRefs: PhotoFragment$ref, - |}, - +$refType: UserProfile$ref, -|}; -export type UserProfile$data = UserProfile; -export type UserProfile$key = { - +$data?: UserProfile$data, - +$fragmentRefs: UserProfile$ref, - ... -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import type { FragmentReference } from "relay-runtime"; declare export opaque type AnotherRecursiveFragment$ref: FragmentReference; declare export opaque type AnotherRecursiveFragment$fragmentType: AnotherRecursiveFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/mod.rs b/compiler/crates/relay-typegen/tests/generate_flow/mod.rs index 686944f7e72d6..edbef55f5b979 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/mod.rs +++ b/compiler/crates/relay-typegen/tests/generate_flow/mod.rs @@ -45,51 +45,36 @@ pub fn transform_fixture(fixture: &Fixture<'_>) -> Result { ) .unwrap(); - let separator = - "-------------------------------------------------------------------------------\n"; - Ok(vec![false, false, true, false, false, true, true, true] - .chunks(2) - .map(|bools| (bools[0], bools[1])) - .map(|(future_proof_enums, future_proof_abstract_types)| { - let typegen_config = TypegenConfig { - language: TypegenLanguage::Flow, - haste: true, - future_proof_abstract_types, - future_proof_enums, - ..Default::default() - }; + let typegen_config = TypegenConfig { + language: TypegenLanguage::Flow, + haste: true, + ..Default::default() + }; - let mut operations: Vec<_> = programs.typegen.operations().collect(); - operations.sort_by_key(|op| op.name.item); - let operation_strings = operations.into_iter().map(|typegen_operation| { - let normalization_operation = programs - .normalization - .operation(typegen_operation.name.item) - .unwrap(); - relay_typegen::generate_operation_type( - typegen_operation, - normalization_operation, - &schema, - &typegen_config, - ) - }); + let mut operations: Vec<_> = programs.typegen.operations().collect(); + operations.sort_by_key(|op| op.name.item); + let operation_strings = operations.into_iter().map(|typegen_operation| { + let normalization_operation = programs + .normalization + .operation(typegen_operation.name.item) + .unwrap(); + relay_typegen::generate_operation_type( + typegen_operation, + normalization_operation, + &schema, + &typegen_config, + ) + }); - let mut fragments: Vec<_> = programs.typegen.fragments().collect(); - fragments.sort_by_key(|frag| frag.name.item); - let fragment_strings = fragments - .into_iter() - .map(|frag| relay_typegen::generate_fragment_type(frag, &schema, &typegen_config)); + let mut fragments: Vec<_> = programs.typegen.fragments().collect(); + fragments.sort_by_key(|frag| frag.name.item); + let fragment_strings = fragments + .into_iter() + .map(|frag| relay_typegen::generate_fragment_type(frag, &schema, &typegen_config)); - let mut result: Vec = operation_strings.collect(); - result.extend(fragment_strings); + let mut result: Vec = operation_strings.collect(); + result.extend(fragment_strings); - format!( - "/*\n * future proof enums: {}\n * future proof abstract types: {}\n */\n\n{}", - future_proof_enums, - future_proof_abstract_types, - result.join(separator) - ) - }) - .collect::>() - .join(separator)) + Ok(result + .join("-------------------------------------------------------------------------------\n")) } diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/conditional.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/conditional.expected index 212454356d435..3bf28a089d997 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/conditional.expected @@ -9,92 +9,6 @@ fragment NestedCondition on Node { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import { FragmentRefs } from "relay-runtime"; -export type ConditionField = { - readonly id?: string, - readonly " $refType": FragmentRefs<"ConditionField">, -}; -export type ConditionField$data = ConditionField; -export type ConditionField$key = { - readonly " $data"?: ConditionField$data, - readonly " $fragmentRefs": FragmentRefs<"ConditionField">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type NestedCondition = { - readonly id?: string, - readonly " $refType": FragmentRefs<"NestedCondition">, -}; -export type NestedCondition$data = NestedCondition; -export type NestedCondition$key = { - readonly " $data"?: NestedCondition$data, - readonly " $fragmentRefs": FragmentRefs<"NestedCondition">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import { FragmentRefs } from "relay-runtime"; -export type ConditionField = { - readonly id?: string, - readonly " $refType": FragmentRefs<"ConditionField">, -}; -export type ConditionField$data = ConditionField; -export type ConditionField$key = { - readonly " $data"?: ConditionField$data, - readonly " $fragmentRefs": FragmentRefs<"ConditionField">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type NestedCondition = { - readonly id?: string, - readonly " $refType": FragmentRefs<"NestedCondition">, -}; -export type NestedCondition$data = NestedCondition; -export type NestedCondition$key = { - readonly " $data"?: NestedCondition$data, - readonly " $fragmentRefs": FragmentRefs<"NestedCondition">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import { FragmentRefs } from "relay-runtime"; -export type ConditionField = { - readonly id?: string, - readonly " $refType": FragmentRefs<"ConditionField">, -}; -export type ConditionField$data = ConditionField; -export type ConditionField$key = { - readonly " $data"?: ConditionField$data, - readonly " $fragmentRefs": FragmentRefs<"ConditionField">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type NestedCondition = { - readonly id?: string, - readonly " $refType": FragmentRefs<"NestedCondition">, -}; -export type NestedCondition$data = NestedCondition; -export type NestedCondition$key = { - readonly " $data"?: NestedCondition$data, - readonly " $fragmentRefs": FragmentRefs<"NestedCondition">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import { FragmentRefs } from "relay-runtime"; export type ConditionField = { readonly id?: string, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected index 504f6738653fa..9ab36dfa076be 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected @@ -48,306 +48,6 @@ fragment UserFrag2 on User { __typename } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import { FragmentRefs } from "relay-runtime"; -export type ConcreateTypes = { - readonly actor: { - readonly __typename: "Page", - readonly id: string, - readonly " $fragmentRefs": FragmentRefs<"PageFragment">, - } | { - readonly __typename: "User", - readonly name: string | null, - } | null, - readonly " $refType": FragmentRefs<"ConcreateTypes">, -}; -export type ConcreateTypes$data = ConcreateTypes; -export type ConcreateTypes$key = { - readonly " $data"?: ConcreateTypes$data, - readonly " $fragmentRefs": FragmentRefs<"ConcreateTypes">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type FragmentSpread = { - readonly id: string, - readonly justFrag: { - readonly " $fragmentRefs": FragmentRefs<"PictureFragment"> - } | null, - readonly fragAndField: { - readonly uri: string | null, - readonly " $fragmentRefs": FragmentRefs<"PictureFragment">, - } | null, - readonly " $fragmentRefs": FragmentRefs<"OtherFragment" | "UserFrag1" | "UserFrag2">, - readonly " $refType": FragmentRefs<"FragmentSpread">, -}; -export type FragmentSpread$data = FragmentSpread; -export type FragmentSpread$key = { - readonly " $data"?: FragmentSpread$data, - readonly " $fragmentRefs": FragmentRefs<"FragmentSpread">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type OtherFragment = { - readonly __typename: string, - readonly " $refType": FragmentRefs<"OtherFragment">, -}; -export type OtherFragment$data = OtherFragment; -export type OtherFragment$key = { - readonly " $data"?: OtherFragment$data, - readonly " $fragmentRefs": FragmentRefs<"OtherFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type PageFragment = { - readonly __typename: "Page", - readonly " $refType": FragmentRefs<"PageFragment">, -}; -export type PageFragment$data = PageFragment; -export type PageFragment$key = { - readonly " $data"?: PageFragment$data, - readonly " $fragmentRefs": FragmentRefs<"PageFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type PictureFragment = { - readonly __typename: "Image", - readonly " $refType": FragmentRefs<"PictureFragment">, -}; -export type PictureFragment$data = PictureFragment; -export type PictureFragment$key = { - readonly " $data"?: PictureFragment$data, - readonly " $fragmentRefs": FragmentRefs<"PictureFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type UserFrag1 = { - readonly __typename: "User", - readonly " $refType": FragmentRefs<"UserFrag1">, -}; -export type UserFrag1$data = UserFrag1; -export type UserFrag1$key = { - readonly " $data"?: UserFrag1$data, - readonly " $fragmentRefs": FragmentRefs<"UserFrag1">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type UserFrag2 = { - readonly __typename: "User", - readonly " $refType": FragmentRefs<"UserFrag2">, -}; -export type UserFrag2$data = UserFrag2; -export type UserFrag2$key = { - readonly " $data"?: UserFrag2$data, - readonly " $fragmentRefs": FragmentRefs<"UserFrag2">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import { FragmentRefs } from "relay-runtime"; -export type ConcreateTypes = { - readonly actor: { - readonly __typename: "Page", - readonly id: string, - readonly " $fragmentRefs": FragmentRefs<"PageFragment">, - } | { - readonly __typename: "User", - readonly name: string | null, - } | null, - readonly " $refType": FragmentRefs<"ConcreateTypes">, -}; -export type ConcreateTypes$data = ConcreateTypes; -export type ConcreateTypes$key = { - readonly " $data"?: ConcreateTypes$data, - readonly " $fragmentRefs": FragmentRefs<"ConcreateTypes">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type FragmentSpread = { - readonly id: string, - readonly justFrag: { - readonly " $fragmentRefs": FragmentRefs<"PictureFragment"> - } | null, - readonly fragAndField: { - readonly uri: string | null, - readonly " $fragmentRefs": FragmentRefs<"PictureFragment">, - } | null, - readonly " $fragmentRefs": FragmentRefs<"OtherFragment" | "UserFrag1" | "UserFrag2">, - readonly " $refType": FragmentRefs<"FragmentSpread">, -}; -export type FragmentSpread$data = FragmentSpread; -export type FragmentSpread$key = { - readonly " $data"?: FragmentSpread$data, - readonly " $fragmentRefs": FragmentRefs<"FragmentSpread">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type OtherFragment = { - readonly __typename: string, - readonly " $refType": FragmentRefs<"OtherFragment">, -}; -export type OtherFragment$data = OtherFragment; -export type OtherFragment$key = { - readonly " $data"?: OtherFragment$data, - readonly " $fragmentRefs": FragmentRefs<"OtherFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type PageFragment = { - readonly __typename: "Page", - readonly " $refType": FragmentRefs<"PageFragment">, -}; -export type PageFragment$data = PageFragment; -export type PageFragment$key = { - readonly " $data"?: PageFragment$data, - readonly " $fragmentRefs": FragmentRefs<"PageFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type PictureFragment = { - readonly __typename: "Image", - readonly " $refType": FragmentRefs<"PictureFragment">, -}; -export type PictureFragment$data = PictureFragment; -export type PictureFragment$key = { - readonly " $data"?: PictureFragment$data, - readonly " $fragmentRefs": FragmentRefs<"PictureFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type UserFrag1 = { - readonly __typename: "User", - readonly " $refType": FragmentRefs<"UserFrag1">, -}; -export type UserFrag1$data = UserFrag1; -export type UserFrag1$key = { - readonly " $data"?: UserFrag1$data, - readonly " $fragmentRefs": FragmentRefs<"UserFrag1">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type UserFrag2 = { - readonly __typename: "User", - readonly " $refType": FragmentRefs<"UserFrag2">, -}; -export type UserFrag2$data = UserFrag2; -export type UserFrag2$key = { - readonly " $data"?: UserFrag2$data, - readonly " $fragmentRefs": FragmentRefs<"UserFrag2">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import { FragmentRefs } from "relay-runtime"; -export type ConcreateTypes = { - readonly actor: { - readonly __typename: "Page", - readonly id: string, - readonly " $fragmentRefs": FragmentRefs<"PageFragment">, - } | { - readonly __typename: "User", - readonly name: string | null, - } | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly __typename: "%other" - } | null, - readonly " $refType": FragmentRefs<"ConcreateTypes">, -}; -export type ConcreateTypes$data = ConcreateTypes; -export type ConcreateTypes$key = { - readonly " $data"?: ConcreateTypes$data, - readonly " $fragmentRefs": FragmentRefs<"ConcreateTypes">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type FragmentSpread = { - readonly id: string, - readonly justFrag: { - readonly " $fragmentRefs": FragmentRefs<"PictureFragment"> - } | null, - readonly fragAndField: { - readonly uri: string | null, - readonly " $fragmentRefs": FragmentRefs<"PictureFragment">, - } | null, - readonly " $fragmentRefs": FragmentRefs<"OtherFragment" | "UserFrag1" | "UserFrag2">, - readonly " $refType": FragmentRefs<"FragmentSpread">, -}; -export type FragmentSpread$data = FragmentSpread; -export type FragmentSpread$key = { - readonly " $data"?: FragmentSpread$data, - readonly " $fragmentRefs": FragmentRefs<"FragmentSpread">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type OtherFragment = { - readonly __typename: string, - readonly " $refType": FragmentRefs<"OtherFragment">, -}; -export type OtherFragment$data = OtherFragment; -export type OtherFragment$key = { - readonly " $data"?: OtherFragment$data, - readonly " $fragmentRefs": FragmentRefs<"OtherFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type PageFragment = { - readonly __typename: "Page", - readonly " $refType": FragmentRefs<"PageFragment">, -}; -export type PageFragment$data = PageFragment; -export type PageFragment$key = { - readonly " $data"?: PageFragment$data, - readonly " $fragmentRefs": FragmentRefs<"PageFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type PictureFragment = { - readonly __typename: "Image", - readonly " $refType": FragmentRefs<"PictureFragment">, -}; -export type PictureFragment$data = PictureFragment; -export type PictureFragment$key = { - readonly " $data"?: PictureFragment$data, - readonly " $fragmentRefs": FragmentRefs<"PictureFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type UserFrag1 = { - readonly __typename: "User", - readonly " $refType": FragmentRefs<"UserFrag1">, -}; -export type UserFrag1$data = UserFrag1; -export type UserFrag1$key = { - readonly " $data"?: UserFrag1$data, - readonly " $fragmentRefs": FragmentRefs<"UserFrag1">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type UserFrag2 = { - readonly __typename: "User", - readonly " $refType": FragmentRefs<"UserFrag2">, -}; -export type UserFrag2$data = UserFrag2; -export type UserFrag2$key = { - readonly " $data"?: UserFrag2$data, - readonly " $fragmentRefs": FragmentRefs<"UserFrag2">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import { FragmentRefs } from "relay-runtime"; export type ConcreateTypes = { readonly actor: { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected index f6513306a3c10..b0cf3ecd79eab 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected @@ -64,254 +64,6 @@ fragment SomeFragment on User { __typename } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import { FragmentRefs } from "relay-runtime"; -export type InlineFragment = { - readonly id: string, - readonly name?: string | null, - readonly message?: { - readonly text: string | null - } | null, - readonly " $refType": FragmentRefs<"InlineFragment">, -}; -export type InlineFragment$data = InlineFragment; -export type InlineFragment$key = { - readonly " $data"?: InlineFragment$data, - readonly " $fragmentRefs": FragmentRefs<"InlineFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type InlineFragmentConditionalID = { - readonly id?: string, - readonly name?: string | null, - readonly " $refType": FragmentRefs<"InlineFragmentConditionalID">, -}; -export type InlineFragmentConditionalID$data = InlineFragmentConditionalID; -export type InlineFragmentConditionalID$key = { - readonly " $data"?: InlineFragmentConditionalID$data, - readonly " $fragmentRefs": FragmentRefs<"InlineFragmentConditionalID">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type InlineFragmentKitchenSink = { - readonly actor: { - readonly id: string, - readonly profilePicture: { - readonly uri: string | null, - readonly width?: number | null, - readonly height?: number | null, - } | null, - readonly name?: string | null, - readonly " $fragmentRefs": FragmentRefs<"SomeFragment">, - } | null, - readonly " $refType": FragmentRefs<"InlineFragmentKitchenSink">, -}; -export type InlineFragmentKitchenSink$data = InlineFragmentKitchenSink; -export type InlineFragmentKitchenSink$key = { - readonly " $data"?: InlineFragmentKitchenSink$data, - readonly " $fragmentRefs": FragmentRefs<"InlineFragmentKitchenSink">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type InlineFragmentWithOverlappingFields = { - readonly hometown?: { - readonly id: string, - readonly name: string | null, - readonly message?: { - readonly text: string | null - } | null, - } | null, - readonly name?: string | null, - readonly " $refType": FragmentRefs<"InlineFragmentWithOverlappingFields">, -}; -export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; -export type InlineFragmentWithOverlappingFields$key = { - readonly " $data"?: InlineFragmentWithOverlappingFields$data, - readonly " $fragmentRefs": FragmentRefs<"InlineFragmentWithOverlappingFields">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type SomeFragment = { - readonly __typename: "User", - readonly " $refType": FragmentRefs<"SomeFragment">, -}; -export type SomeFragment$data = SomeFragment; -export type SomeFragment$key = { - readonly " $data"?: SomeFragment$data, - readonly " $fragmentRefs": FragmentRefs<"SomeFragment">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import { FragmentRefs } from "relay-runtime"; -export type InlineFragment = { - readonly id: string, - readonly name?: string | null, - readonly message?: { - readonly text: string | null - } | null, - readonly " $refType": FragmentRefs<"InlineFragment">, -}; -export type InlineFragment$data = InlineFragment; -export type InlineFragment$key = { - readonly " $data"?: InlineFragment$data, - readonly " $fragmentRefs": FragmentRefs<"InlineFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type InlineFragmentConditionalID = { - readonly id?: string, - readonly name?: string | null, - readonly " $refType": FragmentRefs<"InlineFragmentConditionalID">, -}; -export type InlineFragmentConditionalID$data = InlineFragmentConditionalID; -export type InlineFragmentConditionalID$key = { - readonly " $data"?: InlineFragmentConditionalID$data, - readonly " $fragmentRefs": FragmentRefs<"InlineFragmentConditionalID">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type InlineFragmentKitchenSink = { - readonly actor: { - readonly id: string, - readonly profilePicture: { - readonly uri: string | null, - readonly width?: number | null, - readonly height?: number | null, - } | null, - readonly name?: string | null, - readonly " $fragmentRefs": FragmentRefs<"SomeFragment">, - } | null, - readonly " $refType": FragmentRefs<"InlineFragmentKitchenSink">, -}; -export type InlineFragmentKitchenSink$data = InlineFragmentKitchenSink; -export type InlineFragmentKitchenSink$key = { - readonly " $data"?: InlineFragmentKitchenSink$data, - readonly " $fragmentRefs": FragmentRefs<"InlineFragmentKitchenSink">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type InlineFragmentWithOverlappingFields = { - readonly hometown?: { - readonly id: string, - readonly name: string | null, - readonly message?: { - readonly text: string | null - } | null, - } | null, - readonly name?: string | null, - readonly " $refType": FragmentRefs<"InlineFragmentWithOverlappingFields">, -}; -export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; -export type InlineFragmentWithOverlappingFields$key = { - readonly " $data"?: InlineFragmentWithOverlappingFields$data, - readonly " $fragmentRefs": FragmentRefs<"InlineFragmentWithOverlappingFields">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type SomeFragment = { - readonly __typename: "User", - readonly " $refType": FragmentRefs<"SomeFragment">, -}; -export type SomeFragment$data = SomeFragment; -export type SomeFragment$key = { - readonly " $data"?: SomeFragment$data, - readonly " $fragmentRefs": FragmentRefs<"SomeFragment">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import { FragmentRefs } from "relay-runtime"; -export type InlineFragment = { - readonly id: string, - readonly name?: string | null, - readonly message?: { - readonly text: string | null - } | null, - readonly " $refType": FragmentRefs<"InlineFragment">, -}; -export type InlineFragment$data = InlineFragment; -export type InlineFragment$key = { - readonly " $data"?: InlineFragment$data, - readonly " $fragmentRefs": FragmentRefs<"InlineFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type InlineFragmentConditionalID = { - readonly id?: string, - readonly name?: string | null, - readonly " $refType": FragmentRefs<"InlineFragmentConditionalID">, -}; -export type InlineFragmentConditionalID$data = InlineFragmentConditionalID; -export type InlineFragmentConditionalID$key = { - readonly " $data"?: InlineFragmentConditionalID$data, - readonly " $fragmentRefs": FragmentRefs<"InlineFragmentConditionalID">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type InlineFragmentKitchenSink = { - readonly actor: { - readonly id: string, - readonly profilePicture: { - readonly uri: string | null, - readonly width?: number | null, - readonly height?: number | null, - } | null, - readonly name?: string | null, - readonly " $fragmentRefs": FragmentRefs<"SomeFragment">, - } | null, - readonly " $refType": FragmentRefs<"InlineFragmentKitchenSink">, -}; -export type InlineFragmentKitchenSink$data = InlineFragmentKitchenSink; -export type InlineFragmentKitchenSink$key = { - readonly " $data"?: InlineFragmentKitchenSink$data, - readonly " $fragmentRefs": FragmentRefs<"InlineFragmentKitchenSink">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type InlineFragmentWithOverlappingFields = { - readonly hometown?: { - readonly id: string, - readonly name: string | null, - readonly message?: { - readonly text: string | null - } | null, - } | null, - readonly name?: string | null, - readonly " $refType": FragmentRefs<"InlineFragmentWithOverlappingFields">, -}; -export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; -export type InlineFragmentWithOverlappingFields$key = { - readonly " $data"?: InlineFragmentWithOverlappingFields$data, - readonly " $fragmentRefs": FragmentRefs<"InlineFragmentWithOverlappingFields">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type SomeFragment = { - readonly __typename: "User", - readonly " $refType": FragmentRefs<"SomeFragment">, -}; -export type SomeFragment$data = SomeFragment; -export type SomeFragment$key = { - readonly " $data"?: SomeFragment$data, - readonly " $fragmentRefs": FragmentRefs<"SomeFragment">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import { FragmentRefs } from "relay-runtime"; export type InlineFragment = { readonly id: string, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected index d36a8e4a9eb8e..bdeff5e9fa4a7 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected @@ -27,142 +27,6 @@ query UnionTypeTest { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type UnionTypeTestVariables = {}; -export type UnionTypeTestResponse = { - readonly neverNode: { - readonly __typename: "FakeNode", - readonly id: string, - } | { - readonly __typename: "NonNode" - } | null -}; -export type UnionTypeTest = { - variables: UnionTypeTestVariables, - response: UnionTypeTestResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type LinkedField = { - readonly profilePicture: { - readonly uri: string | null, - readonly width: number | null, - readonly height: number | null, - } | null, - readonly hometown: { - readonly id: string, - readonly profilePicture: { - readonly uri: string | null - } | null, - } | null, - readonly actor: { - readonly id: string - } | null, - readonly " $refType": FragmentRefs<"LinkedField">, -}; -export type LinkedField$data = LinkedField; -export type LinkedField$key = { - readonly " $data"?: LinkedField$data, - readonly " $fragmentRefs": FragmentRefs<"LinkedField">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type UnionTypeTestVariables = {}; -export type UnionTypeTestResponse = { - readonly neverNode: { - readonly __typename: "FakeNode", - readonly id: string, - } | { - readonly __typename: "NonNode" - } | null -}; -export type UnionTypeTest = { - variables: UnionTypeTestVariables, - response: UnionTypeTestResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type LinkedField = { - readonly profilePicture: { - readonly uri: string | null, - readonly width: number | null, - readonly height: number | null, - } | null, - readonly hometown: { - readonly id: string, - readonly profilePicture: { - readonly uri: string | null - } | null, - } | null, - readonly actor: { - readonly id: string - } | null, - readonly " $refType": FragmentRefs<"LinkedField">, -}; -export type LinkedField$data = LinkedField; -export type LinkedField$key = { - readonly " $data"?: LinkedField$data, - readonly " $fragmentRefs": FragmentRefs<"LinkedField">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type UnionTypeTestVariables = {}; -export type UnionTypeTestResponse = { - readonly neverNode: { - readonly __typename: "FakeNode", - readonly id: string, - } | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly __typename: "%other" - } | null -}; -export type UnionTypeTest = { - variables: UnionTypeTestVariables, - response: UnionTypeTestResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type LinkedField = { - readonly profilePicture: { - readonly uri: string | null, - readonly width: number | null, - readonly height: number | null, - } | null, - readonly hometown: { - readonly id: string, - readonly profilePicture: { - readonly uri: string | null - } | null, - } | null, - readonly actor: { - readonly id: string - } | null, - readonly " $refType": FragmentRefs<"LinkedField">, -}; -export type LinkedField$data = LinkedField; -export type LinkedField$key = { - readonly " $data"?: LinkedField$data, - readonly " $fragmentRefs": FragmentRefs<"LinkedField">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type UnionTypeTestVariables = {}; export type UnionTypeTestResponse = { readonly neverNode: { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected index 9b99933d405e7..b47cd4dd41b54 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected @@ -23,155 +23,6 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type NameRendererQueryVariables = {}; -export type NameRendererQueryResponse = { - readonly me: { - readonly nameRenderer: { - readonly __fragmentPropName?: string | null, - readonly __module_component?: string | null, - readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, - } | null - } | null -}; -export type NameRendererQuery = { - variables: NameRendererQueryVariables, - response: NameRendererQueryResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type MarkdownUserNameRenderer_name = { - readonly markdown: string | null, - readonly data: { - readonly markup: string | null - } | null, - readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">, -}; -export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; -export type MarkdownUserNameRenderer_name$key = { - readonly " $data"?: MarkdownUserNameRenderer_name$data, - readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type PlainUserNameRenderer_name = { - readonly plaintext: string | null, - readonly data: { - readonly text: string | null - } | null, - readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">, -}; -export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; -export type PlainUserNameRenderer_name$key = { - readonly " $data"?: PlainUserNameRenderer_name$data, - readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type NameRendererQueryVariables = {}; -export type NameRendererQueryResponse = { - readonly me: { - readonly nameRenderer: { - readonly __fragmentPropName?: string | null, - readonly __module_component?: string | null, - readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, - } | null - } | null -}; -export type NameRendererQuery = { - variables: NameRendererQueryVariables, - response: NameRendererQueryResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type MarkdownUserNameRenderer_name = { - readonly markdown: string | null, - readonly data: { - readonly markup: string | null - } | null, - readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">, -}; -export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; -export type MarkdownUserNameRenderer_name$key = { - readonly " $data"?: MarkdownUserNameRenderer_name$data, - readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type PlainUserNameRenderer_name = { - readonly plaintext: string | null, - readonly data: { - readonly text: string | null - } | null, - readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">, -}; -export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; -export type PlainUserNameRenderer_name$key = { - readonly " $data"?: PlainUserNameRenderer_name$data, - readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type NameRendererQueryVariables = {}; -export type NameRendererQueryResponse = { - readonly me: { - readonly nameRenderer: { - readonly __fragmentPropName?: string | null, - readonly __module_component?: string | null, - readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, - } | null - } | null -}; -export type NameRendererQuery = { - variables: NameRendererQueryVariables, - response: NameRendererQueryResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type MarkdownUserNameRenderer_name = { - readonly markdown: string | null, - readonly data: { - readonly markup: string | null - } | null, - readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">, -}; -export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; -export type MarkdownUserNameRenderer_name$key = { - readonly " $data"?: MarkdownUserNameRenderer_name$data, - readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type PlainUserNameRenderer_name = { - readonly plaintext: string | null, - readonly data: { - readonly text: string | null - } | null, - readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">, -}; -export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; -export type PlainUserNameRenderer_name$key = { - readonly " $data"?: PlainUserNameRenderer_name$data, - readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type NameRendererQueryVariables = {}; export type NameRendererQueryResponse = { readonly me: { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected index 2a48f5a9c4f5a..d342f3675fb52 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected @@ -22,158 +22,6 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import { FragmentRefs } from "relay-runtime"; -export type MarkdownUserNameRenderer_name = { - readonly markdown: string | null, - readonly data: { - readonly markup: string | null - } | null, - readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">, -}; -export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; -export type MarkdownUserNameRenderer_name$key = { - readonly " $data"?: MarkdownUserNameRenderer_name$data, - readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type NameRendererFragment = { - readonly id: string, - readonly nameRenderer: { - readonly __fragmentPropName?: string | null, - readonly __module_component?: string | null, - readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, - } | null, - readonly " $refType": FragmentRefs<"NameRendererFragment">, -}; -export type NameRendererFragment$data = NameRendererFragment; -export type NameRendererFragment$key = { - readonly " $data"?: NameRendererFragment$data, - readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type PlainUserNameRenderer_name = { - readonly plaintext: string | null, - readonly data: { - readonly text: string | null - } | null, - readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">, -}; -export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; -export type PlainUserNameRenderer_name$key = { - readonly " $data"?: PlainUserNameRenderer_name$data, - readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import { FragmentRefs } from "relay-runtime"; -export type MarkdownUserNameRenderer_name = { - readonly markdown: string | null, - readonly data: { - readonly markup: string | null - } | null, - readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">, -}; -export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; -export type MarkdownUserNameRenderer_name$key = { - readonly " $data"?: MarkdownUserNameRenderer_name$data, - readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type NameRendererFragment = { - readonly id: string, - readonly nameRenderer: { - readonly __fragmentPropName?: string | null, - readonly __module_component?: string | null, - readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, - } | null, - readonly " $refType": FragmentRefs<"NameRendererFragment">, -}; -export type NameRendererFragment$data = NameRendererFragment; -export type NameRendererFragment$key = { - readonly " $data"?: NameRendererFragment$data, - readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type PlainUserNameRenderer_name = { - readonly plaintext: string | null, - readonly data: { - readonly text: string | null - } | null, - readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">, -}; -export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; -export type PlainUserNameRenderer_name$key = { - readonly " $data"?: PlainUserNameRenderer_name$data, - readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import { FragmentRefs } from "relay-runtime"; -export type MarkdownUserNameRenderer_name = { - readonly markdown: string | null, - readonly data: { - readonly markup: string | null - } | null, - readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">, -}; -export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; -export type MarkdownUserNameRenderer_name$key = { - readonly " $data"?: MarkdownUserNameRenderer_name$data, - readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type NameRendererFragment = { - readonly id: string, - readonly nameRenderer: { - readonly __fragmentPropName?: string | null, - readonly __module_component?: string | null, - readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, - } | null, - readonly " $refType": FragmentRefs<"NameRendererFragment">, -}; -export type NameRendererFragment$data = NameRendererFragment; -export type NameRendererFragment$key = { - readonly " $data"?: NameRendererFragment$data, - readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type PlainUserNameRenderer_name = { - readonly plaintext: string | null, - readonly data: { - readonly text: string | null - } | null, - readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">, -}; -export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; -export type PlainUserNameRenderer_name$key = { - readonly " $data"?: PlainUserNameRenderer_name$data, - readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import { FragmentRefs } from "relay-runtime"; export type MarkdownUserNameRenderer_name = { readonly markdown: string | null, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-input-has-array.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-input-has-array.expected index a074afbad07d7..402600925e076 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-input-has-array.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-input-has-array.expected @@ -7,110 +7,6 @@ mutation InputHasArray($input: UpdateAllSeenStateInput) @raw_response_type { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type UpdateAllSeenStateInput = { - clientMutationId?: string | null, - storyIds?: ReadonlyArray | null, -}; -export type InputHasArrayVariables = { - input?: UpdateAllSeenStateInput | null -}; -export type InputHasArrayResponse = { - readonly viewerNotificationsUpdateAllSeenState: { - readonly stories: ReadonlyArray<{ - readonly actorCount: number | null - } | null> | null - } | null -}; -export type InputHasArrayRawResponse = { - readonly viewerNotificationsUpdateAllSeenState: { - readonly stories: ReadonlyArray<{ - readonly actorCount: number | null, - readonly id: string, - } | null> | null - } | null -}; -export type InputHasArray = { - variables: InputHasArrayVariables, - response: InputHasArrayResponse, - rawResponse: InputHasArrayRawResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type UpdateAllSeenStateInput = { - clientMutationId?: string | null, - storyIds?: ReadonlyArray | null, -}; -export type InputHasArrayVariables = { - input?: UpdateAllSeenStateInput | null -}; -export type InputHasArrayResponse = { - readonly viewerNotificationsUpdateAllSeenState: { - readonly stories: ReadonlyArray<{ - readonly actorCount: number | null - } | null> | null - } | null -}; -export type InputHasArrayRawResponse = { - readonly viewerNotificationsUpdateAllSeenState: { - readonly stories: ReadonlyArray<{ - readonly actorCount: number | null, - readonly id: string, - } | null> | null - } | null -}; -export type InputHasArray = { - variables: InputHasArrayVariables, - response: InputHasArrayResponse, - rawResponse: InputHasArrayRawResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type UpdateAllSeenStateInput = { - clientMutationId?: string | null, - storyIds?: ReadonlyArray | null, -}; -export type InputHasArrayVariables = { - input?: UpdateAllSeenStateInput | null -}; -export type InputHasArrayResponse = { - readonly viewerNotificationsUpdateAllSeenState: { - readonly stories: ReadonlyArray<{ - readonly actorCount: number | null - } | null> | null - } | null -}; -export type InputHasArrayRawResponse = { - readonly viewerNotificationsUpdateAllSeenState: { - readonly stories: ReadonlyArray<{ - readonly actorCount: number | null, - readonly id: string, - } | null> | null - } | null -}; -export type InputHasArray = { - variables: InputHasArrayVariables, - response: InputHasArrayResponse, - rawResponse: InputHasArrayRawResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type UpdateAllSeenStateInput = { clientMutationId?: string | null, storyIds?: ReadonlyArray | null, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-client-extension.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-client-extension.expected index ebf6a3ca335b2..80c474f6a5059 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-client-extension.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-client-extension.expected @@ -19,122 +19,6 @@ type Foo { bar: String } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type UpdateAllSeenStateInput = { - clientMutationId?: string | null, - storyIds?: ReadonlyArray | null, -}; -export type TestVariables = { - input?: UpdateAllSeenStateInput | null -}; -export type TestResponse = { - readonly viewerNotificationsUpdateAllSeenState: { - readonly stories: ReadonlyArray<{ - readonly foos: ReadonlyArray<{ - readonly bar: string | null - } | null> | null - } | null> | null - } | null -}; -export type TestRawResponse = { - readonly viewerNotificationsUpdateAllSeenState: { - readonly stories: ReadonlyArray<{ - readonly id: string, - readonly foos?: ReadonlyArray<{ - readonly bar: string | null - } | null> | null, - } | null> | null - } | null -}; -export type Test = { - variables: TestVariables, - response: TestResponse, - rawResponse: TestRawResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type UpdateAllSeenStateInput = { - clientMutationId?: string | null, - storyIds?: ReadonlyArray | null, -}; -export type TestVariables = { - input?: UpdateAllSeenStateInput | null -}; -export type TestResponse = { - readonly viewerNotificationsUpdateAllSeenState: { - readonly stories: ReadonlyArray<{ - readonly foos: ReadonlyArray<{ - readonly bar: string | null - } | null> | null - } | null> | null - } | null -}; -export type TestRawResponse = { - readonly viewerNotificationsUpdateAllSeenState: { - readonly stories: ReadonlyArray<{ - readonly id: string, - readonly foos?: ReadonlyArray<{ - readonly bar: string | null - } | null> | null, - } | null> | null - } | null -}; -export type Test = { - variables: TestVariables, - response: TestResponse, - rawResponse: TestRawResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type UpdateAllSeenStateInput = { - clientMutationId?: string | null, - storyIds?: ReadonlyArray | null, -}; -export type TestVariables = { - input?: UpdateAllSeenStateInput | null -}; -export type TestResponse = { - readonly viewerNotificationsUpdateAllSeenState: { - readonly stories: ReadonlyArray<{ - readonly foos: ReadonlyArray<{ - readonly bar: string | null - } | null> | null - } | null> | null - } | null -}; -export type TestRawResponse = { - readonly viewerNotificationsUpdateAllSeenState: { - readonly stories: ReadonlyArray<{ - readonly id: string, - readonly foos?: ReadonlyArray<{ - readonly bar: string | null - } | null> | null, - } | null> | null - } | null -}; -export type Test = { - variables: TestVariables, - response: TestResponse, - rawResponse: TestRawResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type UpdateAllSeenStateInput = { clientMutationId?: string | null, storyIds?: ReadonlyArray | null, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected index 1c60fb80485af..e5f57f07824df 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected @@ -27,248 +27,6 @@ fragment FriendFragment on User { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type TestEnums = "mark" | "zuck"; -export type CommentCreateInput = { - clientMutationId?: string | null, - feedbackId?: string | null, - feedback?: CommentfeedbackFeedback | null, -}; -export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null -}; -export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null -}; -export type CommentCreateMutationVariables = { - input: CommentCreateInput, - first?: number | null, - orderBy?: ReadonlyArray | null, -}; -export type CommentCreateMutationResponse = { - readonly commentCreate: { - readonly comment: { - readonly friends: { - readonly edges: ReadonlyArray<{ - readonly node: { - readonly id: string, - readonly __typename: string, - readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, - } | null - } | null> | null - } | null - } | null - } | null -}; -export type CommentCreateMutationRawResponse = { - readonly commentCreate: { - readonly comment: { - readonly friends: { - readonly edges: ReadonlyArray<{ - readonly node: { - readonly id: string, - readonly __typename: "User", - readonly name: string | null, - readonly lastName: string | null, - readonly profilePicture2: { - readonly test_enums: TestEnums | null - } | null, - } | null - } | null> | null - } | null, - readonly id: string, - } | null - } | null -}; -export type CommentCreateMutation = { - variables: CommentCreateMutationVariables, - response: CommentCreateMutationResponse, - rawResponse: CommentCreateMutationRawResponse, -}; -------------------------------------------------------------------------------- -export type TestEnums = "mark" | "zuck"; -import { FragmentRefs } from "relay-runtime"; -export type FriendFragment = { - readonly name: string | null, - readonly lastName: string | null, - readonly profilePicture2: { - readonly test_enums: TestEnums | null - } | null, - readonly " $refType": FragmentRefs<"FriendFragment">, -}; -export type FriendFragment$data = FriendFragment; -export type FriendFragment$key = { - readonly " $data"?: FriendFragment$data, - readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type TestEnums = "mark" | "zuck" | "%future added value"; -export type CommentCreateInput = { - clientMutationId?: string | null, - feedbackId?: string | null, - feedback?: CommentfeedbackFeedback | null, -}; -export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null -}; -export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null -}; -export type CommentCreateMutationVariables = { - input: CommentCreateInput, - first?: number | null, - orderBy?: ReadonlyArray | null, -}; -export type CommentCreateMutationResponse = { - readonly commentCreate: { - readonly comment: { - readonly friends: { - readonly edges: ReadonlyArray<{ - readonly node: { - readonly id: string, - readonly __typename: string, - readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, - } | null - } | null> | null - } | null - } | null - } | null -}; -export type CommentCreateMutationRawResponse = { - readonly commentCreate: { - readonly comment: { - readonly friends: { - readonly edges: ReadonlyArray<{ - readonly node: { - readonly id: string, - readonly __typename: "User", - readonly name: string | null, - readonly lastName: string | null, - readonly profilePicture2: { - readonly test_enums: TestEnums | null - } | null, - } | null - } | null> | null - } | null, - readonly id: string, - } | null - } | null -}; -export type CommentCreateMutation = { - variables: CommentCreateMutationVariables, - response: CommentCreateMutationResponse, - rawResponse: CommentCreateMutationRawResponse, -}; -------------------------------------------------------------------------------- -export type TestEnums = "mark" | "zuck" | "%future added value"; -import { FragmentRefs } from "relay-runtime"; -export type FriendFragment = { - readonly name: string | null, - readonly lastName: string | null, - readonly profilePicture2: { - readonly test_enums: TestEnums | null - } | null, - readonly " $refType": FragmentRefs<"FriendFragment">, -}; -export type FriendFragment$data = FriendFragment; -export type FriendFragment$key = { - readonly " $data"?: FriendFragment$data, - readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type TestEnums = "mark" | "zuck"; -export type CommentCreateInput = { - clientMutationId?: string | null, - feedbackId?: string | null, - feedback?: CommentfeedbackFeedback | null, -}; -export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null -}; -export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null -}; -export type CommentCreateMutationVariables = { - input: CommentCreateInput, - first?: number | null, - orderBy?: ReadonlyArray | null, -}; -export type CommentCreateMutationResponse = { - readonly commentCreate: { - readonly comment: { - readonly friends: { - readonly edges: ReadonlyArray<{ - readonly node: { - readonly id: string, - readonly __typename: string, - readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, - } | null - } | null> | null - } | null - } | null - } | null -}; -export type CommentCreateMutationRawResponse = { - readonly commentCreate: { - readonly comment: { - readonly friends: { - readonly edges: ReadonlyArray<{ - readonly node: { - readonly id: string, - readonly __typename: "User", - readonly name: string | null, - readonly lastName: string | null, - readonly profilePicture2: { - readonly test_enums: TestEnums | null - } | null, - } | null - } | null> | null - } | null, - readonly id: string, - } | null - } | null -}; -export type CommentCreateMutation = { - variables: CommentCreateMutationVariables, - response: CommentCreateMutationResponse, - rawResponse: CommentCreateMutationRawResponse, -}; -------------------------------------------------------------------------------- -export type TestEnums = "mark" | "zuck"; -import { FragmentRefs } from "relay-runtime"; -export type FriendFragment = { - readonly name: string | null, - readonly lastName: string | null, - readonly profilePicture2: { - readonly test_enums: TestEnums | null - } | null, - readonly " $refType": FragmentRefs<"FriendFragment">, -}; -export type FriendFragment$data = FriendFragment; -export type FriendFragment$key = { - readonly " $data"?: FriendFragment$data, - readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type TestEnums = "mark" | "zuck" | "%future added value"; export type CommentCreateInput = { clientMutationId?: string | null, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected index ffc2b4de2d413..3af2033897974 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected @@ -31,275 +31,6 @@ fragment FeedbackFragment on Feedback { name } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type CommentCreateInput = { - clientMutationId?: string | null, - feedbackId?: string | null, - feedback?: CommentfeedbackFeedback | null, -}; -export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null -}; -export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null -}; -export type CommentCreateMutationVariables = { - input: CommentCreateInput, - first?: number | null, - orderBy?: ReadonlyArray | null, -}; -export type CommentCreateMutationResponse = { - readonly commentCreate: { - readonly comment: { - readonly friends: { - readonly edges: ReadonlyArray<{ - readonly node: { - readonly lastName: string | null, - readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, - } | null - } | null> | null - } | null - } | null - } | null -}; -export type CommentCreateMutationRawResponse = { - readonly commentCreate: { - readonly comment: { - readonly friends: { - readonly edges: ReadonlyArray<{ - readonly node: { - readonly lastName: string | null, - readonly name: string | null, - readonly feedback: { - readonly id: string, - readonly name: string | null, - } | null, - readonly id: string, - } | null - } | null> | null - } | null, - readonly id: string, - } | null - } | null -}; -export type CommentCreateMutation = { - variables: CommentCreateMutationVariables, - response: CommentCreateMutationResponse, - rawResponse: CommentCreateMutationRawResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type FeedbackFragment = { - readonly id: string, - readonly name: string | null, - readonly " $refType": FragmentRefs<"FeedbackFragment">, -}; -export type FeedbackFragment$data = FeedbackFragment; -export type FeedbackFragment$key = { - readonly " $data"?: FeedbackFragment$data, - readonly " $fragmentRefs": FragmentRefs<"FeedbackFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type FriendFragment = { - readonly name: string | null, - readonly lastName: string | null, - readonly feedback: { - readonly " $fragmentRefs": FragmentRefs<"FeedbackFragment"> - } | null, - readonly " $refType": FragmentRefs<"FriendFragment">, -}; -export type FriendFragment$data = FriendFragment; -export type FriendFragment$key = { - readonly " $data"?: FriendFragment$data, - readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type CommentCreateInput = { - clientMutationId?: string | null, - feedbackId?: string | null, - feedback?: CommentfeedbackFeedback | null, -}; -export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null -}; -export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null -}; -export type CommentCreateMutationVariables = { - input: CommentCreateInput, - first?: number | null, - orderBy?: ReadonlyArray | null, -}; -export type CommentCreateMutationResponse = { - readonly commentCreate: { - readonly comment: { - readonly friends: { - readonly edges: ReadonlyArray<{ - readonly node: { - readonly lastName: string | null, - readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, - } | null - } | null> | null - } | null - } | null - } | null -}; -export type CommentCreateMutationRawResponse = { - readonly commentCreate: { - readonly comment: { - readonly friends: { - readonly edges: ReadonlyArray<{ - readonly node: { - readonly lastName: string | null, - readonly name: string | null, - readonly feedback: { - readonly id: string, - readonly name: string | null, - } | null, - readonly id: string, - } | null - } | null> | null - } | null, - readonly id: string, - } | null - } | null -}; -export type CommentCreateMutation = { - variables: CommentCreateMutationVariables, - response: CommentCreateMutationResponse, - rawResponse: CommentCreateMutationRawResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type FeedbackFragment = { - readonly id: string, - readonly name: string | null, - readonly " $refType": FragmentRefs<"FeedbackFragment">, -}; -export type FeedbackFragment$data = FeedbackFragment; -export type FeedbackFragment$key = { - readonly " $data"?: FeedbackFragment$data, - readonly " $fragmentRefs": FragmentRefs<"FeedbackFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type FriendFragment = { - readonly name: string | null, - readonly lastName: string | null, - readonly feedback: { - readonly " $fragmentRefs": FragmentRefs<"FeedbackFragment"> - } | null, - readonly " $refType": FragmentRefs<"FriendFragment">, -}; -export type FriendFragment$data = FriendFragment; -export type FriendFragment$key = { - readonly " $data"?: FriendFragment$data, - readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type CommentCreateInput = { - clientMutationId?: string | null, - feedbackId?: string | null, - feedback?: CommentfeedbackFeedback | null, -}; -export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null -}; -export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null -}; -export type CommentCreateMutationVariables = { - input: CommentCreateInput, - first?: number | null, - orderBy?: ReadonlyArray | null, -}; -export type CommentCreateMutationResponse = { - readonly commentCreate: { - readonly comment: { - readonly friends: { - readonly edges: ReadonlyArray<{ - readonly node: { - readonly lastName: string | null, - readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, - } | null - } | null> | null - } | null - } | null - } | null -}; -export type CommentCreateMutationRawResponse = { - readonly commentCreate: { - readonly comment: { - readonly friends: { - readonly edges: ReadonlyArray<{ - readonly node: { - readonly lastName: string | null, - readonly name: string | null, - readonly feedback: { - readonly id: string, - readonly name: string | null, - } | null, - readonly id: string, - } | null - } | null> | null - } | null, - readonly id: string, - } | null - } | null -}; -export type CommentCreateMutation = { - variables: CommentCreateMutationVariables, - response: CommentCreateMutationResponse, - rawResponse: CommentCreateMutationRawResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type FeedbackFragment = { - readonly id: string, - readonly name: string | null, - readonly " $refType": FragmentRefs<"FeedbackFragment">, -}; -export type FeedbackFragment$data = FeedbackFragment; -export type FeedbackFragment$key = { - readonly " $data"?: FeedbackFragment$data, - readonly " $fragmentRefs": FragmentRefs<"FeedbackFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type FriendFragment = { - readonly name: string | null, - readonly lastName: string | null, - readonly feedback: { - readonly " $fragmentRefs": FragmentRefs<"FeedbackFragment"> - } | null, - readonly " $refType": FragmentRefs<"FriendFragment">, -}; -export type FriendFragment$data = FriendFragment; -export type FriendFragment$key = { - readonly " $data"?: FriendFragment$data, - readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type CommentCreateInput = { clientMutationId?: string | null, feedbackId?: string | null, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected index 32be5fa414a00..e6a99c5a06228 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected @@ -27,257 +27,6 @@ fragment InlineFragmentWithOverlappingFields on Actor { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type CommentCreateInput = { - clientMutationId?: string | null, - feedbackId?: string | null, - feedback?: CommentfeedbackFeedback | null, -}; -export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null -}; -export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null -}; -export type TestMutationVariables = { - input: CommentCreateInput -}; -export type TestMutationResponse = { - readonly commentCreate: { - readonly viewer: { - readonly actor: { - readonly " $fragmentRefs": FragmentRefs<"InlineFragmentWithOverlappingFields"> - } | null - } | null - } | null -}; -export type TestMutationRawResponse = { - readonly commentCreate: { - readonly viewer: { - readonly actor: { - readonly __typename: "User", - readonly __isActor: "User", - readonly id: string, - readonly hometown: { - readonly id: string, - readonly name: string | null, - } | null, - } | { - readonly __typename: "Page", - readonly __isActor: "Page", - readonly id: string, - readonly name: string | null, - readonly hometown: { - readonly id: string, - readonly message: { - readonly text: string | null - } | null, - } | null, - } | { - readonly __typename: string, - readonly __isActor: string, - readonly id: string, - } | null - } | null - } | null -}; -export type TestMutation = { - variables: TestMutationVariables, - response: TestMutationResponse, - rawResponse: TestMutationRawResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type InlineFragmentWithOverlappingFields = { - readonly hometown?: { - readonly id: string, - readonly name: string | null, - readonly message?: { - readonly text: string | null - } | null, - } | null, - readonly name?: string | null, - readonly " $refType": FragmentRefs<"InlineFragmentWithOverlappingFields">, -}; -export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; -export type InlineFragmentWithOverlappingFields$key = { - readonly " $data"?: InlineFragmentWithOverlappingFields$data, - readonly " $fragmentRefs": FragmentRefs<"InlineFragmentWithOverlappingFields">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type CommentCreateInput = { - clientMutationId?: string | null, - feedbackId?: string | null, - feedback?: CommentfeedbackFeedback | null, -}; -export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null -}; -export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null -}; -export type TestMutationVariables = { - input: CommentCreateInput -}; -export type TestMutationResponse = { - readonly commentCreate: { - readonly viewer: { - readonly actor: { - readonly " $fragmentRefs": FragmentRefs<"InlineFragmentWithOverlappingFields"> - } | null - } | null - } | null -}; -export type TestMutationRawResponse = { - readonly commentCreate: { - readonly viewer: { - readonly actor: { - readonly __typename: "User", - readonly __isActor: "User", - readonly id: string, - readonly hometown: { - readonly id: string, - readonly name: string | null, - } | null, - } | { - readonly __typename: "Page", - readonly __isActor: "Page", - readonly id: string, - readonly name: string | null, - readonly hometown: { - readonly id: string, - readonly message: { - readonly text: string | null - } | null, - } | null, - } | { - readonly __typename: string, - readonly __isActor: string, - readonly id: string, - } | null - } | null - } | null -}; -export type TestMutation = { - variables: TestMutationVariables, - response: TestMutationResponse, - rawResponse: TestMutationRawResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type InlineFragmentWithOverlappingFields = { - readonly hometown?: { - readonly id: string, - readonly name: string | null, - readonly message?: { - readonly text: string | null - } | null, - } | null, - readonly name?: string | null, - readonly " $refType": FragmentRefs<"InlineFragmentWithOverlappingFields">, -}; -export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; -export type InlineFragmentWithOverlappingFields$key = { - readonly " $data"?: InlineFragmentWithOverlappingFields$data, - readonly " $fragmentRefs": FragmentRefs<"InlineFragmentWithOverlappingFields">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type CommentCreateInput = { - clientMutationId?: string | null, - feedbackId?: string | null, - feedback?: CommentfeedbackFeedback | null, -}; -export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null -}; -export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null -}; -export type TestMutationVariables = { - input: CommentCreateInput -}; -export type TestMutationResponse = { - readonly commentCreate: { - readonly viewer: { - readonly actor: { - readonly " $fragmentRefs": FragmentRefs<"InlineFragmentWithOverlappingFields"> - } | null - } | null - } | null -}; -export type TestMutationRawResponse = { - readonly commentCreate: { - readonly viewer: { - readonly actor: { - readonly __typename: "User", - readonly __isActor: "User", - readonly id: string, - readonly hometown: { - readonly id: string, - readonly name: string | null, - } | null, - } | { - readonly __typename: "Page", - readonly __isActor: "Page", - readonly id: string, - readonly name: string | null, - readonly hometown: { - readonly id: string, - readonly message: { - readonly text: string | null - } | null, - } | null, - } | { - readonly __typename: string, - readonly __isActor: string, - readonly id: string, - } | null - } | null - } | null -}; -export type TestMutation = { - variables: TestMutationVariables, - response: TestMutationResponse, - rawResponse: TestMutationRawResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type InlineFragmentWithOverlappingFields = { - readonly hometown?: { - readonly id: string, - readonly name: string | null, - readonly message?: { - readonly text: string | null - } | null, - } | null, - readonly name?: string | null, - readonly " $refType": FragmentRefs<"InlineFragmentWithOverlappingFields">, -}; -export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; -export type InlineFragmentWithOverlappingFields$key = { - readonly " $data"?: InlineFragmentWithOverlappingFields$data, - readonly " $fragmentRefs": FragmentRefs<"InlineFragmentWithOverlappingFields">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type CommentCreateInput = { clientMutationId?: string | null, feedbackId?: string | null, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation.expected index 82b541571339d..58af9cf555905 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation.expected @@ -15,122 +15,6 @@ mutation CommentCreateMutation( } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type CommentCreateInput = { - clientMutationId?: string | null, - feedbackId?: string | null, - feedback?: CommentfeedbackFeedback | null, -}; -export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null -}; -export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null -}; -export type CommentCreateMutationVariables = { - input: CommentCreateInput, - first?: number | null, - orderBy?: ReadonlyArray | null, -}; -export type CommentCreateMutationResponse = { - readonly commentCreate: { - readonly comment: { - readonly id: string, - readonly name: string | null, - readonly friends: { - readonly count: number | null - } | null, - } | null - } | null -}; -export type CommentCreateMutation = { - variables: CommentCreateMutationVariables, - response: CommentCreateMutationResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type CommentCreateInput = { - clientMutationId?: string | null, - feedbackId?: string | null, - feedback?: CommentfeedbackFeedback | null, -}; -export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null -}; -export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null -}; -export type CommentCreateMutationVariables = { - input: CommentCreateInput, - first?: number | null, - orderBy?: ReadonlyArray | null, -}; -export type CommentCreateMutationResponse = { - readonly commentCreate: { - readonly comment: { - readonly id: string, - readonly name: string | null, - readonly friends: { - readonly count: number | null - } | null, - } | null - } | null -}; -export type CommentCreateMutation = { - variables: CommentCreateMutationVariables, - response: CommentCreateMutationResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type CommentCreateInput = { - clientMutationId?: string | null, - feedbackId?: string | null, - feedback?: CommentfeedbackFeedback | null, -}; -export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null -}; -export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null -}; -export type CommentCreateMutationVariables = { - input: CommentCreateInput, - first?: number | null, - orderBy?: ReadonlyArray | null, -}; -export type CommentCreateMutationResponse = { - readonly commentCreate: { - readonly comment: { - readonly id: string, - readonly name: string | null, - readonly friends: { - readonly count: number | null - } | null, - } | null - } | null -}; -export type CommentCreateMutation = { - variables: CommentCreateMutationVariables, - response: CommentCreateMutationResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type CommentCreateInput = { clientMutationId?: string | null, feedbackId?: string | null, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/plural-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/plural-fragment.expected index d897e605deb74..7a6199b62aac6 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/plural-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/plural-fragment.expected @@ -3,59 +3,6 @@ fragment PluralFragment on Node @relay(plural: true) { id } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import { FragmentRefs } from "relay-runtime"; -export type PluralFragment = ReadonlyArray<{ - readonly id: string, - readonly " $refType": FragmentRefs<"PluralFragment">, -}>; -export type PluralFragment$data = PluralFragment; -export type PluralFragment$key = ReadonlyArray<{ - readonly " $data"?: PluralFragment$data, - readonly " $fragmentRefs": FragmentRefs<"PluralFragment">, -}>; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import { FragmentRefs } from "relay-runtime"; -export type PluralFragment = ReadonlyArray<{ - readonly id: string, - readonly " $refType": FragmentRefs<"PluralFragment">, -}>; -export type PluralFragment$data = PluralFragment; -export type PluralFragment$key = ReadonlyArray<{ - readonly " $data"?: PluralFragment$data, - readonly " $fragmentRefs": FragmentRefs<"PluralFragment">, -}>; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import { FragmentRefs } from "relay-runtime"; -export type PluralFragment = ReadonlyArray<{ - readonly id: string, - readonly " $refType": FragmentRefs<"PluralFragment">, -}>; -export type PluralFragment$data = PluralFragment; -export type PluralFragment$key = ReadonlyArray<{ - readonly " $data"?: PluralFragment$data, - readonly " $fragmentRefs": FragmentRefs<"PluralFragment">, -}>; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import { FragmentRefs } from "relay-runtime"; export type PluralFragment = ReadonlyArray<{ readonly id: string, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-handles.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-handles.expected index 0bfda6fdd9803..6fb55a9ec73a2 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-handles.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-handles.expected @@ -17,182 +17,6 @@ query ScalarHandleField($id: ID!) @raw_response_type { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type LinkedHandleFieldVariables = { - id: string -}; -export type LinkedHandleFieldResponse = { - readonly node: { - readonly friends?: { - readonly count: number | null - } | null - } | null -}; -export type LinkedHandleFieldRawResponse = { - readonly node: { - readonly __typename: "User", - readonly id: string, - readonly friends: { - readonly count: number | null - } | null, - } | { - readonly __typename: string, - readonly id: string, - } | null -}; -export type LinkedHandleField = { - variables: LinkedHandleFieldVariables, - response: LinkedHandleFieldResponse, - rawResponse: LinkedHandleFieldRawResponse, -}; -------------------------------------------------------------------------------- -export type ScalarHandleFieldVariables = { - id: string -}; -export type ScalarHandleFieldResponse = { - readonly node: { - readonly name?: string | null - } | null -}; -export type ScalarHandleFieldRawResponse = { - readonly node: { - readonly __typename: "User", - readonly id: string, - readonly name: string | null, - } | { - readonly __typename: string, - readonly id: string, - } | null -}; -export type ScalarHandleField = { - variables: ScalarHandleFieldVariables, - response: ScalarHandleFieldResponse, - rawResponse: ScalarHandleFieldRawResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type LinkedHandleFieldVariables = { - id: string -}; -export type LinkedHandleFieldResponse = { - readonly node: { - readonly friends?: { - readonly count: number | null - } | null - } | null -}; -export type LinkedHandleFieldRawResponse = { - readonly node: { - readonly __typename: "User", - readonly id: string, - readonly friends: { - readonly count: number | null - } | null, - } | { - readonly __typename: string, - readonly id: string, - } | null -}; -export type LinkedHandleField = { - variables: LinkedHandleFieldVariables, - response: LinkedHandleFieldResponse, - rawResponse: LinkedHandleFieldRawResponse, -}; -------------------------------------------------------------------------------- -export type ScalarHandleFieldVariables = { - id: string -}; -export type ScalarHandleFieldResponse = { - readonly node: { - readonly name?: string | null - } | null -}; -export type ScalarHandleFieldRawResponse = { - readonly node: { - readonly __typename: "User", - readonly id: string, - readonly name: string | null, - } | { - readonly __typename: string, - readonly id: string, - } | null -}; -export type ScalarHandleField = { - variables: ScalarHandleFieldVariables, - response: ScalarHandleFieldResponse, - rawResponse: ScalarHandleFieldRawResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type LinkedHandleFieldVariables = { - id: string -}; -export type LinkedHandleFieldResponse = { - readonly node: { - readonly friends?: { - readonly count: number | null - } | null - } | null -}; -export type LinkedHandleFieldRawResponse = { - readonly node: { - readonly __typename: "User", - readonly id: string, - readonly friends: { - readonly count: number | null - } | null, - } | { - readonly __typename: string, - readonly id: string, - } | null -}; -export type LinkedHandleField = { - variables: LinkedHandleFieldVariables, - response: LinkedHandleFieldResponse, - rawResponse: LinkedHandleFieldRawResponse, -}; -------------------------------------------------------------------------------- -export type ScalarHandleFieldVariables = { - id: string -}; -export type ScalarHandleFieldResponse = { - readonly node: { - readonly name?: string | null - } | null -}; -export type ScalarHandleFieldRawResponse = { - readonly node: { - readonly __typename: "User", - readonly id: string, - readonly name: string | null, - } | { - readonly __typename: string, - readonly id: string, - } | null -}; -export type ScalarHandleField = { - variables: ScalarHandleFieldVariables, - response: ScalarHandleFieldResponse, - rawResponse: ScalarHandleFieldRawResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type LinkedHandleFieldVariables = { id: string }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected index abec731066827..74c6d7c27e022 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected @@ -28,311 +28,6 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import { Local3DPayload } from "relay-runtime"; -export type TestVariables = {}; -export type TestResponse = { - readonly node: { - readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment"> - } | null -}; -export type PlainUserNameRenderer_name = { - readonly plaintext: string | null, - readonly data: { - readonly text: string | null, - readonly id: string | null, - } | null, -}; -export type MarkdownUserNameRenderer_name = { - readonly markdown: string | null, - readonly data: { - readonly markup: string | null, - readonly id: string | null, - } | null, -}; -export type TestRawResponse = { - readonly node: { - readonly __typename: "User", - readonly id: string, - readonly nameRenderer: { - readonly __typename: "PlainUserNameRenderer", - readonly __module_operation_NameRendererFragment: any | null, - readonly __module_component_NameRendererFragment: any | null, - } | Local3DPayload<"NameRendererFragment", { - readonly __typename: "PlainUserNameRenderer", - }> | { - readonly __typename: "MarkdownUserNameRenderer", - readonly __module_operation_NameRendererFragment: any | null, - readonly __module_component_NameRendererFragment: any | null, - } | Local3DPayload<"NameRendererFragment", { - readonly __typename: "MarkdownUserNameRenderer", - }> | { - readonly __typename: string - } | null, - } | { - readonly __typename: string, - readonly id: string, - } | null -}; -export type Test = { - variables: TestVariables, - response: TestResponse, - rawResponse: TestRawResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type MarkdownUserNameRenderer_name = { - readonly markdown: string | null, - readonly data: { - readonly markup: string | null - } | null, - readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">, -}; -export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; -export type MarkdownUserNameRenderer_name$key = { - readonly " $data"?: MarkdownUserNameRenderer_name$data, - readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type NameRendererFragment = { - readonly id: string, - readonly nameRenderer: { - readonly __fragmentPropName?: string | null, - readonly __module_component?: string | null, - readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, - } | null, - readonly " $refType": FragmentRefs<"NameRendererFragment">, -}; -export type NameRendererFragment$data = NameRendererFragment; -export type NameRendererFragment$key = { - readonly " $data"?: NameRendererFragment$data, - readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type PlainUserNameRenderer_name = { - readonly plaintext: string | null, - readonly data: { - readonly text: string | null - } | null, - readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">, -}; -export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; -export type PlainUserNameRenderer_name$key = { - readonly " $data"?: PlainUserNameRenderer_name$data, - readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import { Local3DPayload } from "relay-runtime"; -export type TestVariables = {}; -export type TestResponse = { - readonly node: { - readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment"> - } | null -}; -export type PlainUserNameRenderer_name = { - readonly plaintext: string | null, - readonly data: { - readonly text: string | null, - readonly id: string | null, - } | null, -}; -export type MarkdownUserNameRenderer_name = { - readonly markdown: string | null, - readonly data: { - readonly markup: string | null, - readonly id: string | null, - } | null, -}; -export type TestRawResponse = { - readonly node: { - readonly __typename: "User", - readonly id: string, - readonly nameRenderer: { - readonly __typename: "PlainUserNameRenderer", - readonly __module_operation_NameRendererFragment: any | null, - readonly __module_component_NameRendererFragment: any | null, - } | Local3DPayload<"NameRendererFragment", { - readonly __typename: "PlainUserNameRenderer", - }> | { - readonly __typename: "MarkdownUserNameRenderer", - readonly __module_operation_NameRendererFragment: any | null, - readonly __module_component_NameRendererFragment: any | null, - } | Local3DPayload<"NameRendererFragment", { - readonly __typename: "MarkdownUserNameRenderer", - }> | { - readonly __typename: string - } | null, - } | { - readonly __typename: string, - readonly id: string, - } | null -}; -export type Test = { - variables: TestVariables, - response: TestResponse, - rawResponse: TestRawResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type MarkdownUserNameRenderer_name = { - readonly markdown: string | null, - readonly data: { - readonly markup: string | null - } | null, - readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">, -}; -export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; -export type MarkdownUserNameRenderer_name$key = { - readonly " $data"?: MarkdownUserNameRenderer_name$data, - readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type NameRendererFragment = { - readonly id: string, - readonly nameRenderer: { - readonly __fragmentPropName?: string | null, - readonly __module_component?: string | null, - readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, - } | null, - readonly " $refType": FragmentRefs<"NameRendererFragment">, -}; -export type NameRendererFragment$data = NameRendererFragment; -export type NameRendererFragment$key = { - readonly " $data"?: NameRendererFragment$data, - readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type PlainUserNameRenderer_name = { - readonly plaintext: string | null, - readonly data: { - readonly text: string | null - } | null, - readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">, -}; -export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; -export type PlainUserNameRenderer_name$key = { - readonly " $data"?: PlainUserNameRenderer_name$data, - readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import { Local3DPayload } from "relay-runtime"; -export type TestVariables = {}; -export type TestResponse = { - readonly node: { - readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment"> - } | null -}; -export type PlainUserNameRenderer_name = { - readonly plaintext: string | null, - readonly data: { - readonly text: string | null, - readonly id: string | null, - } | null, -}; -export type MarkdownUserNameRenderer_name = { - readonly markdown: string | null, - readonly data: { - readonly markup: string | null, - readonly id: string | null, - } | null, -}; -export type TestRawResponse = { - readonly node: { - readonly __typename: "User", - readonly id: string, - readonly nameRenderer: { - readonly __typename: "PlainUserNameRenderer", - readonly __module_operation_NameRendererFragment: any | null, - readonly __module_component_NameRendererFragment: any | null, - } | Local3DPayload<"NameRendererFragment", { - readonly __typename: "PlainUserNameRenderer", - }> | { - readonly __typename: "MarkdownUserNameRenderer", - readonly __module_operation_NameRendererFragment: any | null, - readonly __module_component_NameRendererFragment: any | null, - } | Local3DPayload<"NameRendererFragment", { - readonly __typename: "MarkdownUserNameRenderer", - }> | { - readonly __typename: string - } | null, - } | { - readonly __typename: string, - readonly id: string, - } | null -}; -export type Test = { - variables: TestVariables, - response: TestResponse, - rawResponse: TestRawResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type MarkdownUserNameRenderer_name = { - readonly markdown: string | null, - readonly data: { - readonly markup: string | null - } | null, - readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">, -}; -export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; -export type MarkdownUserNameRenderer_name$key = { - readonly " $data"?: MarkdownUserNameRenderer_name$data, - readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type NameRendererFragment = { - readonly id: string, - readonly nameRenderer: { - readonly __fragmentPropName?: string | null, - readonly __module_component?: string | null, - readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, - } | null, - readonly " $refType": FragmentRefs<"NameRendererFragment">, -}; -export type NameRendererFragment$data = NameRendererFragment; -export type NameRendererFragment$key = { - readonly " $data"?: NameRendererFragment$data, - readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type PlainUserNameRenderer_name = { - readonly plaintext: string | null, - readonly data: { - readonly text: string | null - } | null, - readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">, -}; -export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; -export type PlainUserNameRenderer_name$key = { - readonly " $data"?: PlainUserNameRenderer_name$data, - readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import { Local3DPayload } from "relay-runtime"; export type TestVariables = {}; export type TestResponse = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected index 91d2d58fb2e3c..1efcd9e1b2cc9 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected @@ -17,206 +17,6 @@ fragment Test_userRenderer on PlainUserRenderer { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import { Local3DPayload } from "relay-runtime"; -export type TestVariables = {}; -export type TestResponse = { - readonly node: { - readonly " $fragmentRefs": FragmentRefs<"Test_user"> - } | null -}; -export type Test_userRenderer = { - readonly user: { - readonly username: string | null, - readonly id: string, - } | null -}; -export type TestRawResponse = { - readonly node: { - readonly __typename: "User", - readonly id: string, - readonly plainUserRenderer: { - readonly __module_operation_Test_user: any | null, - readonly __module_component_Test_user: any | null, - } | Local3DPayload<"Test_user", {}> | null, - } | { - readonly __typename: string, - readonly id: string, - } | null -}; -export type Test = { - variables: TestVariables, - response: TestResponse, - rawResponse: TestRawResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type Test_user = { - readonly plainUserRenderer: { - readonly __fragmentPropName?: string | null, - readonly __module_component?: string | null, - readonly " $fragmentRefs": FragmentRefs<"Test_userRenderer">, - } | null, - readonly " $refType": FragmentRefs<"Test_user">, -}; -export type Test_user$data = Test_user; -export type Test_user$key = { - readonly " $data"?: Test_user$data, - readonly " $fragmentRefs": FragmentRefs<"Test_user">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type Test_userRenderer = { - readonly user: { - readonly username: string | null - } | null, - readonly " $refType": FragmentRefs<"Test_userRenderer">, -}; -export type Test_userRenderer$data = Test_userRenderer; -export type Test_userRenderer$key = { - readonly " $data"?: Test_userRenderer$data, - readonly " $fragmentRefs": FragmentRefs<"Test_userRenderer">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import { Local3DPayload } from "relay-runtime"; -export type TestVariables = {}; -export type TestResponse = { - readonly node: { - readonly " $fragmentRefs": FragmentRefs<"Test_user"> - } | null -}; -export type Test_userRenderer = { - readonly user: { - readonly username: string | null, - readonly id: string, - } | null -}; -export type TestRawResponse = { - readonly node: { - readonly __typename: "User", - readonly id: string, - readonly plainUserRenderer: { - readonly __module_operation_Test_user: any | null, - readonly __module_component_Test_user: any | null, - } | Local3DPayload<"Test_user", {}> | null, - } | { - readonly __typename: string, - readonly id: string, - } | null -}; -export type Test = { - variables: TestVariables, - response: TestResponse, - rawResponse: TestRawResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type Test_user = { - readonly plainUserRenderer: { - readonly __fragmentPropName?: string | null, - readonly __module_component?: string | null, - readonly " $fragmentRefs": FragmentRefs<"Test_userRenderer">, - } | null, - readonly " $refType": FragmentRefs<"Test_user">, -}; -export type Test_user$data = Test_user; -export type Test_user$key = { - readonly " $data"?: Test_user$data, - readonly " $fragmentRefs": FragmentRefs<"Test_user">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type Test_userRenderer = { - readonly user: { - readonly username: string | null - } | null, - readonly " $refType": FragmentRefs<"Test_userRenderer">, -}; -export type Test_userRenderer$data = Test_userRenderer; -export type Test_userRenderer$key = { - readonly " $data"?: Test_userRenderer$data, - readonly " $fragmentRefs": FragmentRefs<"Test_userRenderer">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import { Local3DPayload } from "relay-runtime"; -export type TestVariables = {}; -export type TestResponse = { - readonly node: { - readonly " $fragmentRefs": FragmentRefs<"Test_user"> - } | null -}; -export type Test_userRenderer = { - readonly user: { - readonly username: string | null, - readonly id: string, - } | null -}; -export type TestRawResponse = { - readonly node: { - readonly __typename: "User", - readonly id: string, - readonly plainUserRenderer: { - readonly __module_operation_Test_user: any | null, - readonly __module_component_Test_user: any | null, - } | Local3DPayload<"Test_user", {}> | null, - } | { - readonly __typename: string, - readonly id: string, - } | null -}; -export type Test = { - variables: TestVariables, - response: TestResponse, - rawResponse: TestRawResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type Test_user = { - readonly plainUserRenderer: { - readonly __fragmentPropName?: string | null, - readonly __module_component?: string | null, - readonly " $fragmentRefs": FragmentRefs<"Test_userRenderer">, - } | null, - readonly " $refType": FragmentRefs<"Test_user">, -}; -export type Test_user$data = Test_user; -export type Test_user$key = { - readonly " $data"?: Test_user$data, - readonly " $fragmentRefs": FragmentRefs<"Test_user">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type Test_userRenderer = { - readonly user: { - readonly username: string | null - } | null, - readonly " $refType": FragmentRefs<"Test_userRenderer">, -}; -export type Test_userRenderer$data = Test_userRenderer; -export type Test_userRenderer$key = { - readonly " $data"?: Test_userRenderer$data, - readonly " $fragmentRefs": FragmentRefs<"Test_userRenderer">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import { Local3DPayload } from "relay-runtime"; export type TestVariables = {}; export type TestResponse = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected index e7e21f0eb0705..3f30ae8c30d19 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected @@ -48,458 +48,6 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import { Local3DPayload } from "relay-runtime"; -export type TestVariables = {}; -export type TestResponse = { - readonly node: { - readonly username?: string | null, - readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment">, - } | null, - readonly viewer: { - readonly actor: { - readonly name?: string | null, - readonly " $fragmentRefs": FragmentRefs<"AnotherNameRendererFragment">, - } | null - } | null, -}; -export type PlainUserNameRenderer_name = { - readonly plaintext: string | null, - readonly data: { - readonly text: string | null, - readonly id: string | null, - } | null, -}; -export type MarkdownUserNameRenderer_name = { - readonly markdown: string | null, - readonly data: { - readonly markup: string | null, - readonly id: string | null, - } | null, -}; -export type TestRawResponse = { - readonly node: { - readonly __typename: "User", - readonly id: string, - readonly username: string | null, - readonly nameRenderer: { - readonly __typename: "PlainUserNameRenderer", - readonly __module_operation_NameRendererFragment: any | null, - readonly __module_component_NameRendererFragment: any | null, - } | Local3DPayload<"NameRendererFragment", { - readonly __typename: "PlainUserNameRenderer", - }> | { - readonly __typename: "MarkdownUserNameRenderer", - readonly __module_operation_NameRendererFragment: any | null, - readonly __module_component_NameRendererFragment: any | null, - } | Local3DPayload<"NameRendererFragment", { - readonly __typename: "MarkdownUserNameRenderer", - }> | { - readonly __typename: string - } | null, - } | { - readonly __typename: string, - readonly id: string, - } | null, - readonly viewer: { - readonly actor: { - readonly __typename: "User", - readonly id: string, - readonly name: string | null, - readonly nameRenderer: { - readonly __typename: "PlainUserNameRenderer", - readonly __module_operation_AnotherNameRendererFragment: any | null, - readonly __module_component_AnotherNameRendererFragment: any | null, - } | Local3DPayload<"AnotherNameRendererFragment", { - readonly __typename: "PlainUserNameRenderer", - }> | { - readonly __typename: "MarkdownUserNameRenderer", - readonly __module_operation_AnotherNameRendererFragment: any | null, - readonly __module_component_AnotherNameRendererFragment: any | null, - } | Local3DPayload<"AnotherNameRendererFragment", { - readonly __typename: "MarkdownUserNameRenderer", - }> | { - readonly __typename: string - } | null, - } | { - readonly __typename: string, - readonly id: string, - } | null - } | null, -}; -export type Test = { - variables: TestVariables, - response: TestResponse, - rawResponse: TestRawResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type AnotherNameRendererFragment = { - readonly name: string | null, - readonly nameRenderer: { - readonly __fragmentPropName?: string | null, - readonly __module_component?: string | null, - readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, - } | null, - readonly " $refType": FragmentRefs<"AnotherNameRendererFragment">, -}; -export type AnotherNameRendererFragment$data = AnotherNameRendererFragment; -export type AnotherNameRendererFragment$key = { - readonly " $data"?: AnotherNameRendererFragment$data, - readonly " $fragmentRefs": FragmentRefs<"AnotherNameRendererFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type MarkdownUserNameRenderer_name = { - readonly markdown: string | null, - readonly data: { - readonly markup: string | null - } | null, - readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">, -}; -export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; -export type MarkdownUserNameRenderer_name$key = { - readonly " $data"?: MarkdownUserNameRenderer_name$data, - readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type NameRendererFragment = { - readonly id: string, - readonly nameRenderer: { - readonly __fragmentPropName?: string | null, - readonly __module_component?: string | null, - readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, - } | null, - readonly " $refType": FragmentRefs<"NameRendererFragment">, -}; -export type NameRendererFragment$data = NameRendererFragment; -export type NameRendererFragment$key = { - readonly " $data"?: NameRendererFragment$data, - readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type PlainUserNameRenderer_name = { - readonly plaintext: string | null, - readonly data: { - readonly text: string | null - } | null, - readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">, -}; -export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; -export type PlainUserNameRenderer_name$key = { - readonly " $data"?: PlainUserNameRenderer_name$data, - readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import { Local3DPayload } from "relay-runtime"; -export type TestVariables = {}; -export type TestResponse = { - readonly node: { - readonly username?: string | null, - readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment">, - } | null, - readonly viewer: { - readonly actor: { - readonly name?: string | null, - readonly " $fragmentRefs": FragmentRefs<"AnotherNameRendererFragment">, - } | null - } | null, -}; -export type PlainUserNameRenderer_name = { - readonly plaintext: string | null, - readonly data: { - readonly text: string | null, - readonly id: string | null, - } | null, -}; -export type MarkdownUserNameRenderer_name = { - readonly markdown: string | null, - readonly data: { - readonly markup: string | null, - readonly id: string | null, - } | null, -}; -export type TestRawResponse = { - readonly node: { - readonly __typename: "User", - readonly id: string, - readonly username: string | null, - readonly nameRenderer: { - readonly __typename: "PlainUserNameRenderer", - readonly __module_operation_NameRendererFragment: any | null, - readonly __module_component_NameRendererFragment: any | null, - } | Local3DPayload<"NameRendererFragment", { - readonly __typename: "PlainUserNameRenderer", - }> | { - readonly __typename: "MarkdownUserNameRenderer", - readonly __module_operation_NameRendererFragment: any | null, - readonly __module_component_NameRendererFragment: any | null, - } | Local3DPayload<"NameRendererFragment", { - readonly __typename: "MarkdownUserNameRenderer", - }> | { - readonly __typename: string - } | null, - } | { - readonly __typename: string, - readonly id: string, - } | null, - readonly viewer: { - readonly actor: { - readonly __typename: "User", - readonly id: string, - readonly name: string | null, - readonly nameRenderer: { - readonly __typename: "PlainUserNameRenderer", - readonly __module_operation_AnotherNameRendererFragment: any | null, - readonly __module_component_AnotherNameRendererFragment: any | null, - } | Local3DPayload<"AnotherNameRendererFragment", { - readonly __typename: "PlainUserNameRenderer", - }> | { - readonly __typename: "MarkdownUserNameRenderer", - readonly __module_operation_AnotherNameRendererFragment: any | null, - readonly __module_component_AnotherNameRendererFragment: any | null, - } | Local3DPayload<"AnotherNameRendererFragment", { - readonly __typename: "MarkdownUserNameRenderer", - }> | { - readonly __typename: string - } | null, - } | { - readonly __typename: string, - readonly id: string, - } | null - } | null, -}; -export type Test = { - variables: TestVariables, - response: TestResponse, - rawResponse: TestRawResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type AnotherNameRendererFragment = { - readonly name: string | null, - readonly nameRenderer: { - readonly __fragmentPropName?: string | null, - readonly __module_component?: string | null, - readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, - } | null, - readonly " $refType": FragmentRefs<"AnotherNameRendererFragment">, -}; -export type AnotherNameRendererFragment$data = AnotherNameRendererFragment; -export type AnotherNameRendererFragment$key = { - readonly " $data"?: AnotherNameRendererFragment$data, - readonly " $fragmentRefs": FragmentRefs<"AnotherNameRendererFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type MarkdownUserNameRenderer_name = { - readonly markdown: string | null, - readonly data: { - readonly markup: string | null - } | null, - readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">, -}; -export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; -export type MarkdownUserNameRenderer_name$key = { - readonly " $data"?: MarkdownUserNameRenderer_name$data, - readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type NameRendererFragment = { - readonly id: string, - readonly nameRenderer: { - readonly __fragmentPropName?: string | null, - readonly __module_component?: string | null, - readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, - } | null, - readonly " $refType": FragmentRefs<"NameRendererFragment">, -}; -export type NameRendererFragment$data = NameRendererFragment; -export type NameRendererFragment$key = { - readonly " $data"?: NameRendererFragment$data, - readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type PlainUserNameRenderer_name = { - readonly plaintext: string | null, - readonly data: { - readonly text: string | null - } | null, - readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">, -}; -export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; -export type PlainUserNameRenderer_name$key = { - readonly " $data"?: PlainUserNameRenderer_name$data, - readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import { Local3DPayload } from "relay-runtime"; -export type TestVariables = {}; -export type TestResponse = { - readonly node: { - readonly username?: string | null, - readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment">, - } | null, - readonly viewer: { - readonly actor: { - readonly name?: string | null, - readonly " $fragmentRefs": FragmentRefs<"AnotherNameRendererFragment">, - } | null - } | null, -}; -export type PlainUserNameRenderer_name = { - readonly plaintext: string | null, - readonly data: { - readonly text: string | null, - readonly id: string | null, - } | null, -}; -export type MarkdownUserNameRenderer_name = { - readonly markdown: string | null, - readonly data: { - readonly markup: string | null, - readonly id: string | null, - } | null, -}; -export type TestRawResponse = { - readonly node: { - readonly __typename: "User", - readonly id: string, - readonly username: string | null, - readonly nameRenderer: { - readonly __typename: "PlainUserNameRenderer", - readonly __module_operation_NameRendererFragment: any | null, - readonly __module_component_NameRendererFragment: any | null, - } | Local3DPayload<"NameRendererFragment", { - readonly __typename: "PlainUserNameRenderer", - }> | { - readonly __typename: "MarkdownUserNameRenderer", - readonly __module_operation_NameRendererFragment: any | null, - readonly __module_component_NameRendererFragment: any | null, - } | Local3DPayload<"NameRendererFragment", { - readonly __typename: "MarkdownUserNameRenderer", - }> | { - readonly __typename: string - } | null, - } | { - readonly __typename: string, - readonly id: string, - } | null, - readonly viewer: { - readonly actor: { - readonly __typename: "User", - readonly id: string, - readonly name: string | null, - readonly nameRenderer: { - readonly __typename: "PlainUserNameRenderer", - readonly __module_operation_AnotherNameRendererFragment: any | null, - readonly __module_component_AnotherNameRendererFragment: any | null, - } | Local3DPayload<"AnotherNameRendererFragment", { - readonly __typename: "PlainUserNameRenderer", - }> | { - readonly __typename: "MarkdownUserNameRenderer", - readonly __module_operation_AnotherNameRendererFragment: any | null, - readonly __module_component_AnotherNameRendererFragment: any | null, - } | Local3DPayload<"AnotherNameRendererFragment", { - readonly __typename: "MarkdownUserNameRenderer", - }> | { - readonly __typename: string - } | null, - } | { - readonly __typename: string, - readonly id: string, - } | null - } | null, -}; -export type Test = { - variables: TestVariables, - response: TestResponse, - rawResponse: TestRawResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type AnotherNameRendererFragment = { - readonly name: string | null, - readonly nameRenderer: { - readonly __fragmentPropName?: string | null, - readonly __module_component?: string | null, - readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, - } | null, - readonly " $refType": FragmentRefs<"AnotherNameRendererFragment">, -}; -export type AnotherNameRendererFragment$data = AnotherNameRendererFragment; -export type AnotherNameRendererFragment$key = { - readonly " $data"?: AnotherNameRendererFragment$data, - readonly " $fragmentRefs": FragmentRefs<"AnotherNameRendererFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type MarkdownUserNameRenderer_name = { - readonly markdown: string | null, - readonly data: { - readonly markup: string | null - } | null, - readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">, -}; -export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; -export type MarkdownUserNameRenderer_name$key = { - readonly " $data"?: MarkdownUserNameRenderer_name$data, - readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type NameRendererFragment = { - readonly id: string, - readonly nameRenderer: { - readonly __fragmentPropName?: string | null, - readonly __module_component?: string | null, - readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">, - } | null, - readonly " $refType": FragmentRefs<"NameRendererFragment">, -}; -export type NameRendererFragment$data = NameRendererFragment; -export type NameRendererFragment$key = { - readonly " $data"?: NameRendererFragment$data, - readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type PlainUserNameRenderer_name = { - readonly plaintext: string | null, - readonly data: { - readonly text: string | null - } | null, - readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">, -}; -export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; -export type PlainUserNameRenderer_name$key = { - readonly " $data"?: PlainUserNameRenderer_name$data, - readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import { Local3DPayload } from "relay-runtime"; export type TestVariables = {}; export type TestResponse = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected index edca0f4806cef..ee0bae98d057e 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected @@ -16,164 +16,6 @@ fragment FriendFragment on User { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type ExampleQueryVariables = { - id: string, - condition: boolean, -}; -export type ExampleQueryResponse = { - readonly node: { - readonly " $fragmentRefs": FragmentRefs<"FriendFragment"> - } | null -}; -export type ExampleQueryRawResponse = { - readonly node: { - readonly __typename: "User", - readonly id: string, - readonly name: string | null, - readonly lastName: string | null, - readonly feedback: { - readonly id: string, - readonly name: string | null, - } | null, - } | { - readonly __typename: string, - readonly id: string, - } | null -}; -export type ExampleQuery = { - variables: ExampleQueryVariables, - response: ExampleQueryResponse, - rawResponse: ExampleQueryRawResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type FriendFragment = { - readonly name?: string | null, - readonly lastName?: string | null, - readonly feedback?: { - readonly id: string, - readonly name: string | null, - } | null, - readonly " $refType": FragmentRefs<"FriendFragment">, -}; -export type FriendFragment$data = FriendFragment; -export type FriendFragment$key = { - readonly " $data"?: FriendFragment$data, - readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type ExampleQueryVariables = { - id: string, - condition: boolean, -}; -export type ExampleQueryResponse = { - readonly node: { - readonly " $fragmentRefs": FragmentRefs<"FriendFragment"> - } | null -}; -export type ExampleQueryRawResponse = { - readonly node: { - readonly __typename: "User", - readonly id: string, - readonly name: string | null, - readonly lastName: string | null, - readonly feedback: { - readonly id: string, - readonly name: string | null, - } | null, - } | { - readonly __typename: string, - readonly id: string, - } | null -}; -export type ExampleQuery = { - variables: ExampleQueryVariables, - response: ExampleQueryResponse, - rawResponse: ExampleQueryRawResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type FriendFragment = { - readonly name?: string | null, - readonly lastName?: string | null, - readonly feedback?: { - readonly id: string, - readonly name: string | null, - } | null, - readonly " $refType": FragmentRefs<"FriendFragment">, -}; -export type FriendFragment$data = FriendFragment; -export type FriendFragment$key = { - readonly " $data"?: FriendFragment$data, - readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type ExampleQueryVariables = { - id: string, - condition: boolean, -}; -export type ExampleQueryResponse = { - readonly node: { - readonly " $fragmentRefs": FragmentRefs<"FriendFragment"> - } | null -}; -export type ExampleQueryRawResponse = { - readonly node: { - readonly __typename: "User", - readonly id: string, - readonly name: string | null, - readonly lastName: string | null, - readonly feedback: { - readonly id: string, - readonly name: string | null, - } | null, - } | { - readonly __typename: string, - readonly id: string, - } | null -}; -export type ExampleQuery = { - variables: ExampleQueryVariables, - response: ExampleQueryResponse, - rawResponse: ExampleQueryRawResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type FriendFragment = { - readonly name?: string | null, - readonly lastName?: string | null, - readonly feedback?: { - readonly id: string, - readonly name: string | null, - } | null, - readonly " $refType": FragmentRefs<"FriendFragment">, -}; -export type FriendFragment$data = FriendFragment; -export type FriendFragment$key = { - readonly " $data"?: FriendFragment$data, - readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type ExampleQueryVariables = { id: string, condition: boolean, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected index 1948f6a61fd76..50c980ed33975 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected @@ -22,149 +22,6 @@ fragment FriendFragment on User { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type ExampleQueryVariables = { - id: string -}; -export type ExampleQueryResponse = { - readonly node: { - readonly username: string | null, - readonly friends?: { - readonly count: number | null - } | null, - readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, - } | null -}; -export type ExampleQueryRawResponse = { - readonly node: { - readonly __typename: string, - readonly username: string | null, - readonly id: string, - } | null -}; -export type ExampleQuery = { - variables: ExampleQueryVariables, - response: ExampleQueryResponse, - rawResponse: ExampleQueryRawResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type FriendFragment = { - readonly name?: string | null, - readonly lastName?: string | null, - readonly feedback?: { - readonly id: string, - readonly name: string | null, - } | null, - readonly " $refType": FragmentRefs<"FriendFragment">, -}; -export type FriendFragment$data = FriendFragment; -export type FriendFragment$key = { - readonly " $data"?: FriendFragment$data, - readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type ExampleQueryVariables = { - id: string -}; -export type ExampleQueryResponse = { - readonly node: { - readonly username: string | null, - readonly friends?: { - readonly count: number | null - } | null, - readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, - } | null -}; -export type ExampleQueryRawResponse = { - readonly node: { - readonly __typename: string, - readonly username: string | null, - readonly id: string, - } | null -}; -export type ExampleQuery = { - variables: ExampleQueryVariables, - response: ExampleQueryResponse, - rawResponse: ExampleQueryRawResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type FriendFragment = { - readonly name?: string | null, - readonly lastName?: string | null, - readonly feedback?: { - readonly id: string, - readonly name: string | null, - } | null, - readonly " $refType": FragmentRefs<"FriendFragment">, -}; -export type FriendFragment$data = FriendFragment; -export type FriendFragment$key = { - readonly " $data"?: FriendFragment$data, - readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type ExampleQueryVariables = { - id: string -}; -export type ExampleQueryResponse = { - readonly node: { - readonly username: string | null, - readonly friends?: { - readonly count: number | null - } | null, - readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, - } | null -}; -export type ExampleQueryRawResponse = { - readonly node: { - readonly __typename: string, - readonly username: string | null, - readonly id: string, - } | null -}; -export type ExampleQuery = { - variables: ExampleQueryVariables, - response: ExampleQueryResponse, - rawResponse: ExampleQueryRawResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type FriendFragment = { - readonly name?: string | null, - readonly lastName?: string | null, - readonly feedback?: { - readonly id: string, - readonly name: string | null, - } | null, - readonly " $refType": FragmentRefs<"FriendFragment">, -}; -export type FriendFragment$data = FriendFragment; -export type FriendFragment$key = { - readonly " $data"?: FriendFragment$data, - readonly " $fragmentRefs": FragmentRefs<"FriendFragment">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type ExampleQueryVariables = { id: string }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream-connection.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream-connection.expected index f17d6b36ea182..82ff2bfe6d861 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream-connection.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream-connection.expected @@ -17,173 +17,6 @@ query TestDefer @raw_response_type { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type TestDeferVariables = {}; -export type TestDeferResponse = { - readonly node: { - readonly name?: string | null, - readonly friends?: { - readonly edges: ReadonlyArray<{ - readonly node: { - readonly actor: { - readonly name: string | null - } | null - } | null - } | null> | null - } | null, - } | null -}; -export type TestDeferRawResponse = { - readonly node: { - readonly __typename: "User", - readonly id: string, - readonly name: string | null, - readonly friends: { - readonly edges: ReadonlyArray<{ - readonly node: { - readonly actor: { - readonly __typename: string, - readonly name: string | null, - readonly id: string, - } | null, - readonly id: string, - readonly __typename: "User", - } | null, - readonly cursor: string | null, - } | null> | null, - readonly pageInfo: { - readonly endCursor: string | null, - readonly hasNextPage: boolean | null, - } | null, - } | null, - } | { - readonly __typename: string, - readonly id: string, - } | null -}; -export type TestDefer = { - variables: TestDeferVariables, - response: TestDeferResponse, - rawResponse: TestDeferRawResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type TestDeferVariables = {}; -export type TestDeferResponse = { - readonly node: { - readonly name?: string | null, - readonly friends?: { - readonly edges: ReadonlyArray<{ - readonly node: { - readonly actor: { - readonly name: string | null - } | null - } | null - } | null> | null - } | null, - } | null -}; -export type TestDeferRawResponse = { - readonly node: { - readonly __typename: "User", - readonly id: string, - readonly name: string | null, - readonly friends: { - readonly edges: ReadonlyArray<{ - readonly node: { - readonly actor: { - readonly __typename: string, - readonly name: string | null, - readonly id: string, - } | null, - readonly id: string, - readonly __typename: "User", - } | null, - readonly cursor: string | null, - } | null> | null, - readonly pageInfo: { - readonly endCursor: string | null, - readonly hasNextPage: boolean | null, - } | null, - } | null, - } | { - readonly __typename: string, - readonly id: string, - } | null -}; -export type TestDefer = { - variables: TestDeferVariables, - response: TestDeferResponse, - rawResponse: TestDeferRawResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type TestDeferVariables = {}; -export type TestDeferResponse = { - readonly node: { - readonly name?: string | null, - readonly friends?: { - readonly edges: ReadonlyArray<{ - readonly node: { - readonly actor: { - readonly name: string | null - } | null - } | null - } | null> | null - } | null, - } | null -}; -export type TestDeferRawResponse = { - readonly node: { - readonly __typename: "User", - readonly id: string, - readonly name: string | null, - readonly friends: { - readonly edges: ReadonlyArray<{ - readonly node: { - readonly actor: { - readonly __typename: string, - readonly name: string | null, - readonly id: string, - } | null, - readonly id: string, - readonly __typename: "User", - } | null, - readonly cursor: string | null, - } | null> | null, - readonly pageInfo: { - readonly endCursor: string | null, - readonly hasNextPage: boolean | null, - } | null, - } | null, - } | { - readonly __typename: string, - readonly id: string, - } | null -}; -export type TestDefer = { - variables: TestDeferVariables, - response: TestDeferResponse, - rawResponse: TestDeferRawResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type TestDeferVariables = {}; export type TestDeferResponse = { readonly node: { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream.expected index 80845aabe0b2f..02344516afaf4 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream.expected @@ -18,152 +18,6 @@ query TestStream @raw_response_type { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type TestStreamVariables = {}; -export type TestStreamResponse = { - readonly node: { - readonly name?: string | null, - readonly friends?: { - readonly edges: ReadonlyArray<{ - readonly node: { - readonly id: string - } | null - } | null> | null - } | null, - } | null -}; -export type TestStreamRawResponse = { - readonly node: { - readonly __typename: "User", - readonly id: string, - readonly name: string | null, - readonly friends: { - readonly edges: ReadonlyArray<{ - readonly node: { - readonly id: string, - readonly __typename: "User", - } | null, - readonly cursor: string | null, - } | null> | null, - readonly pageInfo: { - readonly endCursor: string | null, - readonly hasNextPage: boolean | null, - } | null, - } | null, - } | { - readonly __typename: string, - readonly id: string, - } | null -}; -export type TestStream = { - variables: TestStreamVariables, - response: TestStreamResponse, - rawResponse: TestStreamRawResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type TestStreamVariables = {}; -export type TestStreamResponse = { - readonly node: { - readonly name?: string | null, - readonly friends?: { - readonly edges: ReadonlyArray<{ - readonly node: { - readonly id: string - } | null - } | null> | null - } | null, - } | null -}; -export type TestStreamRawResponse = { - readonly node: { - readonly __typename: "User", - readonly id: string, - readonly name: string | null, - readonly friends: { - readonly edges: ReadonlyArray<{ - readonly node: { - readonly id: string, - readonly __typename: "User", - } | null, - readonly cursor: string | null, - } | null> | null, - readonly pageInfo: { - readonly endCursor: string | null, - readonly hasNextPage: boolean | null, - } | null, - } | null, - } | { - readonly __typename: string, - readonly id: string, - } | null -}; -export type TestStream = { - variables: TestStreamVariables, - response: TestStreamResponse, - rawResponse: TestStreamRawResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type TestStreamVariables = {}; -export type TestStreamResponse = { - readonly node: { - readonly name?: string | null, - readonly friends?: { - readonly edges: ReadonlyArray<{ - readonly node: { - readonly id: string - } | null - } | null> | null - } | null, - } | null -}; -export type TestStreamRawResponse = { - readonly node: { - readonly __typename: "User", - readonly id: string, - readonly name: string | null, - readonly friends: { - readonly edges: ReadonlyArray<{ - readonly node: { - readonly id: string, - readonly __typename: "User", - } | null, - readonly cursor: string | null, - } | null> | null, - readonly pageInfo: { - readonly endCursor: string | null, - readonly hasNextPage: boolean | null, - } | null, - } | null, - } | { - readonly __typename: string, - readonly id: string, - } | null -}; -export type TestStream = { - variables: TestStreamVariables, - response: TestStreamResponse, - rawResponse: TestStreamRawResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type TestStreamVariables = {}; export type TestStreamResponse = { readonly node: { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/recursive-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/recursive-fragments.expected index 48623d69d0ed3..6186eb28510ea 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/recursive-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/recursive-fragments.expected @@ -6,62 +6,6 @@ fragment FragmentSpread on Node { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import { FragmentRefs } from "relay-runtime"; -export type FragmentSpread = { - readonly id: string, - readonly " $fragmentRefs": FragmentRefs<"FragmentSpread">, - readonly " $refType": FragmentRefs<"FragmentSpread">, -}; -export type FragmentSpread$data = FragmentSpread; -export type FragmentSpread$key = { - readonly " $data"?: FragmentSpread$data, - readonly " $fragmentRefs": FragmentRefs<"FragmentSpread">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import { FragmentRefs } from "relay-runtime"; -export type FragmentSpread = { - readonly id: string, - readonly " $fragmentRefs": FragmentRefs<"FragmentSpread">, - readonly " $refType": FragmentRefs<"FragmentSpread">, -}; -export type FragmentSpread$data = FragmentSpread; -export type FragmentSpread$key = { - readonly " $data"?: FragmentSpread$data, - readonly " $fragmentRefs": FragmentRefs<"FragmentSpread">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import { FragmentRefs } from "relay-runtime"; -export type FragmentSpread = { - readonly id: string, - readonly " $fragmentRefs": FragmentRefs<"FragmentSpread">, - readonly " $refType": FragmentRefs<"FragmentSpread">, -}; -export type FragmentSpread$data = FragmentSpread; -export type FragmentSpread$key = { - readonly " $data"?: FragmentSpread$data, - readonly " $fragmentRefs": FragmentRefs<"FragmentSpread">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import { FragmentRefs } from "relay-runtime"; export type FragmentSpread = { readonly id: string, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected index 15cbca8c4a7a8..092edbff12056 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected @@ -7,110 +7,6 @@ fragment RefetchableFragment on Node } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import { FragmentRefs } from "relay-runtime"; -export type RefetchableFragmentQueryVariables = { - id: string -}; -export type RefetchableFragmentQueryResponse = { - readonly node: { - readonly " $fragmentRefs": FragmentRefs<"RefetchableFragment"> - } | null -}; -export type RefetchableFragmentQuery = { - variables: RefetchableFragmentQueryVariables, - response: RefetchableFragmentQueryResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type RefetchableFragment = { - readonly id: string, - readonly fragAndField: { - readonly uri: string | null - } | null, - readonly " $refType": FragmentRefs<"RefetchableFragment">, -}; -export type RefetchableFragment$data = RefetchableFragment; -export type RefetchableFragment$key = { - readonly " $data"?: RefetchableFragment$data, - readonly " $fragmentRefs": FragmentRefs<"RefetchableFragment">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import { FragmentRefs } from "relay-runtime"; -export type RefetchableFragmentQueryVariables = { - id: string -}; -export type RefetchableFragmentQueryResponse = { - readonly node: { - readonly " $fragmentRefs": FragmentRefs<"RefetchableFragment"> - } | null -}; -export type RefetchableFragmentQuery = { - variables: RefetchableFragmentQueryVariables, - response: RefetchableFragmentQueryResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type RefetchableFragment = { - readonly id: string, - readonly fragAndField: { - readonly uri: string | null - } | null, - readonly " $refType": FragmentRefs<"RefetchableFragment">, -}; -export type RefetchableFragment$data = RefetchableFragment; -export type RefetchableFragment$key = { - readonly " $data"?: RefetchableFragment$data, - readonly " $fragmentRefs": FragmentRefs<"RefetchableFragment">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import { FragmentRefs } from "relay-runtime"; -export type RefetchableFragmentQueryVariables = { - id: string -}; -export type RefetchableFragmentQueryResponse = { - readonly node: { - readonly " $fragmentRefs": FragmentRefs<"RefetchableFragment"> - } | null -}; -export type RefetchableFragmentQuery = { - variables: RefetchableFragmentQueryVariables, - response: RefetchableFragmentQueryResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type RefetchableFragment = { - readonly id: string, - readonly fragAndField: { - readonly uri: string | null - } | null, - readonly " $refType": FragmentRefs<"RefetchableFragment">, -}; -export type RefetchableFragment$data = RefetchableFragment; -export type RefetchableFragment$key = { - readonly " $data"?: RefetchableFragment$data, - readonly " $fragmentRefs": FragmentRefs<"RefetchableFragment">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import { FragmentRefs } from "relay-runtime"; export type RefetchableFragmentQueryVariables = { id: string diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected index 5621468aaa08a..b128236bbe478 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected @@ -7,104 +7,6 @@ fragment FlowRefetchableFragment on Node } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import { FragmentRefs } from "relay-runtime"; -export type FlowRefetchableFragmentQueryVariables = { - id: string -}; -export type FlowRefetchableFragmentQueryResponse = { - readonly node: { - readonly " $fragmentRefs": FragmentRefs<"FlowRefetchableFragment"> - } | null -}; -export type FlowRefetchableFragmentQuery = { - variables: FlowRefetchableFragmentQueryVariables, - response: FlowRefetchableFragmentQueryResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type FlowRefetchableFragment = { - readonly id: string, - readonly name?: string | null, - readonly " $refType": FragmentRefs<"FlowRefetchableFragment">, -}; -export type FlowRefetchableFragment$data = FlowRefetchableFragment; -export type FlowRefetchableFragment$key = { - readonly " $data"?: FlowRefetchableFragment$data, - readonly " $fragmentRefs": FragmentRefs<"FlowRefetchableFragment">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import { FragmentRefs } from "relay-runtime"; -export type FlowRefetchableFragmentQueryVariables = { - id: string -}; -export type FlowRefetchableFragmentQueryResponse = { - readonly node: { - readonly " $fragmentRefs": FragmentRefs<"FlowRefetchableFragment"> - } | null -}; -export type FlowRefetchableFragmentQuery = { - variables: FlowRefetchableFragmentQueryVariables, - response: FlowRefetchableFragmentQueryResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type FlowRefetchableFragment = { - readonly id: string, - readonly name?: string | null, - readonly " $refType": FragmentRefs<"FlowRefetchableFragment">, -}; -export type FlowRefetchableFragment$data = FlowRefetchableFragment; -export type FlowRefetchableFragment$key = { - readonly " $data"?: FlowRefetchableFragment$data, - readonly " $fragmentRefs": FragmentRefs<"FlowRefetchableFragment">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import { FragmentRefs } from "relay-runtime"; -export type FlowRefetchableFragmentQueryVariables = { - id: string -}; -export type FlowRefetchableFragmentQueryResponse = { - readonly node: { - readonly " $fragmentRefs": FragmentRefs<"FlowRefetchableFragment"> - } | null -}; -export type FlowRefetchableFragmentQuery = { - variables: FlowRefetchableFragmentQueryVariables, - response: FlowRefetchableFragmentQueryResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type FlowRefetchableFragment = { - readonly id: string, - readonly name?: string | null, - readonly " $refType": FragmentRefs<"FlowRefetchableFragment">, -}; -export type FlowRefetchableFragment$data = FlowRefetchableFragment; -export type FlowRefetchableFragment$key = { - readonly " $data"?: FlowRefetchableFragment$data, - readonly " $fragmentRefs": FragmentRefs<"FlowRefetchableFragment">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import { FragmentRefs } from "relay-runtime"; export type FlowRefetchableFragmentQueryVariables = { id: string diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected index 4921970b5f81b..85356a4236135 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected @@ -27,141 +27,6 @@ query RelayClientIDFieldQuery($id: ID!) { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type RelayClientIDFieldQueryVariables = { - id: string -}; -export type RelayClientIDFieldQueryResponse = { - readonly __id: string, - readonly me: { - readonly __id: string, - readonly __typename: string, - readonly id: string, - } | null, - readonly node: ({ - readonly __typename: "Comment", - readonly commentBody: ({ - readonly __typename: "PlainCommentBody", - readonly __id: string, - readonly text: { - readonly __id: string, - readonly __typename: string, - readonly text: string | null, - } | null, - } | { - readonly __typename: "MarkdownCommentBody" - }) & { - readonly __id: string - } | null, - } | { - readonly __typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "User" - }) & { - readonly __id: string, - readonly id: string, - } | null, -}; -export type RelayClientIDFieldQuery = { - variables: RelayClientIDFieldQueryVariables, - response: RelayClientIDFieldQueryResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type RelayClientIDFieldQueryVariables = { - id: string -}; -export type RelayClientIDFieldQueryResponse = { - readonly __id: string, - readonly me: { - readonly __id: string, - readonly __typename: string, - readonly id: string, - } | null, - readonly node: ({ - readonly __typename: "Comment", - readonly commentBody: ({ - readonly __typename: "PlainCommentBody", - readonly __id: string, - readonly text: { - readonly __id: string, - readonly __typename: string, - readonly text: string | null, - } | null, - } | { - readonly __typename: "MarkdownCommentBody" - }) & { - readonly __id: string - } | null, - } | { - readonly __typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "User" - }) & { - readonly __id: string, - readonly id: string, - } | null, -}; -export type RelayClientIDFieldQuery = { - variables: RelayClientIDFieldQueryVariables, - response: RelayClientIDFieldQueryResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type RelayClientIDFieldQueryVariables = { - id: string -}; -export type RelayClientIDFieldQueryResponse = { - readonly __id: string, - readonly me: { - readonly __id: string, - readonly __typename: string, - readonly id: string, - } | null, - readonly node: ({ - readonly __typename: "Comment", - readonly commentBody: ({ - readonly __typename: "PlainCommentBody", - readonly __id: string, - readonly text: { - readonly __id: string, - readonly __typename: string, - readonly text: string | null, - } | null, - } | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly __typename: "%other" - }) & { - readonly __id: string - } | null, - } | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly __typename: "%other" - }) & { - readonly __id: string, - readonly id: string, - } | null, -}; -export type RelayClientIDFieldQuery = { - variables: RelayClientIDFieldQueryVariables, - response: RelayClientIDFieldQueryResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type RelayClientIDFieldQueryVariables = { id: string }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected index 702559b5333b7..732e75ee03ffc 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected @@ -8,73 +8,6 @@ fragment Foo on Node { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import { FragmentRefs } from "relay-runtime"; -export type Foo = ({ - readonly __typename: "User", - readonly name: string, -} | { - readonly __typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" -}) & { - readonly " $refType": FragmentRefs<"Foo"> -} | null; -export type Foo$data = Foo; -export type Foo$key = { - readonly " $data"?: Foo$data, - readonly " $fragmentRefs": FragmentRefs<"Foo">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import { FragmentRefs } from "relay-runtime"; -export type Foo = ({ - readonly __typename: "User", - readonly name: string, -} | { - readonly __typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" -}) & { - readonly " $refType": FragmentRefs<"Foo"> -} | null; -export type Foo$data = Foo; -export type Foo$key = { - readonly " $data"?: Foo$data, - readonly " $fragmentRefs": FragmentRefs<"Foo">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import { FragmentRefs } from "relay-runtime"; -export type Foo = ({ - readonly __typename: "User", - readonly name: string, -} | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly __typename: "%other" -}) & { - readonly " $refType": FragmentRefs<"Foo"> -} | null; -export type Foo$data = Foo; -export type Foo$key = { - readonly " $data"?: Foo$data, - readonly " $fragmentRefs": FragmentRefs<"Foo">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import { FragmentRefs } from "relay-runtime"; export type Foo = ({ readonly __typename: "User", diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-fragment.expected index 798b05224ad07..526785ee64ecb 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-fragment.expected @@ -4,62 +4,6 @@ fragment NonNullFragment on User { lastName @required(action: NONE) } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import { FragmentRefs } from "relay-runtime"; -export type NonNullFragment = { - readonly firstName: string | null, - readonly lastName: string, - readonly " $refType": FragmentRefs<"NonNullFragment">, -} | null; -export type NonNullFragment$data = NonNullFragment; -export type NonNullFragment$key = { - readonly " $data"?: NonNullFragment$data, - readonly " $fragmentRefs": FragmentRefs<"NonNullFragment">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import { FragmentRefs } from "relay-runtime"; -export type NonNullFragment = { - readonly firstName: string | null, - readonly lastName: string, - readonly " $refType": FragmentRefs<"NonNullFragment">, -} | null; -export type NonNullFragment$data = NonNullFragment; -export type NonNullFragment$key = { - readonly " $data"?: NonNullFragment$data, - readonly " $fragmentRefs": FragmentRefs<"NonNullFragment">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import { FragmentRefs } from "relay-runtime"; -export type NonNullFragment = { - readonly firstName: string | null, - readonly lastName: string, - readonly " $refType": FragmentRefs<"NonNullFragment">, -} | null; -export type NonNullFragment$data = NonNullFragment; -export type NonNullFragment$key = { - readonly " $data"?: NonNullFragment$data, - readonly " $fragmentRefs": FragmentRefs<"NonNullFragment">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import { FragmentRefs } from "relay-runtime"; export type NonNullFragment = { readonly firstName: string | null, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected index b2d41c07ff741..408ec1c6dba57 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected @@ -7,71 +7,6 @@ fragment NonNullFragment on User { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import { FragmentRefs } from "relay-runtime"; -export type NonNullFragment = { - readonly firstName: string | null, - readonly screennames: ReadonlyArray<{ - readonly name: string | null, - readonly service: string, - } | null> | null, - readonly " $refType": FragmentRefs<"NonNullFragment">, -}; -export type NonNullFragment$data = NonNullFragment; -export type NonNullFragment$key = { - readonly " $data"?: NonNullFragment$data, - readonly " $fragmentRefs": FragmentRefs<"NonNullFragment">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import { FragmentRefs } from "relay-runtime"; -export type NonNullFragment = { - readonly firstName: string | null, - readonly screennames: ReadonlyArray<{ - readonly name: string | null, - readonly service: string, - } | null> | null, - readonly " $refType": FragmentRefs<"NonNullFragment">, -}; -export type NonNullFragment$data = NonNullFragment; -export type NonNullFragment$key = { - readonly " $data"?: NonNullFragment$data, - readonly " $fragmentRefs": FragmentRefs<"NonNullFragment">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import { FragmentRefs } from "relay-runtime"; -export type NonNullFragment = { - readonly firstName: string | null, - readonly screennames: ReadonlyArray<{ - readonly name: string | null, - readonly service: string, - } | null> | null, - readonly " $refType": FragmentRefs<"NonNullFragment">, -}; -export type NonNullFragment$data = NonNullFragment; -export type NonNullFragment$key = { - readonly " $data"?: NonNullFragment$data, - readonly " $fragmentRefs": FragmentRefs<"NonNullFragment">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import { FragmentRefs } from "relay-runtime"; export type NonNullFragment = { readonly firstName: string | null, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-query.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-query.expected index d5bbbd5dee61e..e631795abe1fd 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-query.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-query.expected @@ -6,62 +6,6 @@ query FooQuery { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type FooQueryVariables = {}; -export type FooQueryResponse = { - readonly me: { - readonly firstName: string | null, - readonly lastName: string, - } -} | null; -export type FooQuery = { - variables: FooQueryVariables, - response: FooQueryResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type FooQueryVariables = {}; -export type FooQueryResponse = { - readonly me: { - readonly firstName: string | null, - readonly lastName: string, - } -} | null; -export type FooQuery = { - variables: FooQueryVariables, - response: FooQueryResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type FooQueryVariables = {}; -export type FooQueryResponse = { - readonly me: { - readonly firstName: string | null, - readonly lastName: string, - } -} | null; -export type FooQuery = { - variables: FooQueryVariables, - response: FooQueryResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type FooQueryVariables = {}; export type FooQueryResponse = { readonly me: { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-up-to-mutation-response.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-up-to-mutation-response.expected index 41854d95800e0..b222fb5b789aa 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-up-to-mutation-response.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-up-to-mutation-response.expected @@ -7,104 +7,6 @@ mutation CommentCreateMutation($input: CommentCreateInput!) { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type CommentCreateInput = { - clientMutationId?: string | null, - feedbackId?: string | null, - feedback?: CommentfeedbackFeedback | null, -}; -export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null -}; -export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null -}; -export type CommentCreateMutationVariables = { - input: CommentCreateInput -}; -export type CommentCreateMutationResponse = { - readonly commentCreate: { - readonly comment: { - readonly id: string - } - } -} | null; -export type CommentCreateMutation = { - variables: CommentCreateMutationVariables, - response: CommentCreateMutationResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type CommentCreateInput = { - clientMutationId?: string | null, - feedbackId?: string | null, - feedback?: CommentfeedbackFeedback | null, -}; -export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null -}; -export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null -}; -export type CommentCreateMutationVariables = { - input: CommentCreateInput -}; -export type CommentCreateMutationResponse = { - readonly commentCreate: { - readonly comment: { - readonly id: string - } - } -} | null; -export type CommentCreateMutation = { - variables: CommentCreateMutationVariables, - response: CommentCreateMutationResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type CommentCreateInput = { - clientMutationId?: string | null, - feedbackId?: string | null, - feedback?: CommentfeedbackFeedback | null, -}; -export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null -}; -export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null -}; -export type CommentCreateMutationVariables = { - input: CommentCreateInput -}; -export type CommentCreateMutationResponse = { - readonly commentCreate: { - readonly comment: { - readonly id: string - } - } -} | null; -export type CommentCreateMutation = { - variables: CommentCreateMutationVariables, - response: CommentCreateMutationResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type CommentCreateInput = { clientMutationId?: string | null, feedbackId?: string | null, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected index 1ea7befb69e15..3b9e4f238cb62 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected @@ -28,130 +28,6 @@ fragment Foo on Node { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import { FragmentRefs } from "relay-runtime"; -export type Bar = { - readonly name?: string, - readonly body?: { - readonly text: string | null - } | null, - readonly " $refType": FragmentRefs<"Bar">, -} | null; -export type Bar$data = Bar; -export type Bar$key = { - readonly " $data"?: Bar$data, - readonly " $fragmentRefs": FragmentRefs<"Bar">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type Foo = ({ - readonly __typename: "User", - readonly name: string, -} | { - readonly __typename: "Comment", - readonly body: { - readonly text: string | null - } | null, -} | { - readonly __typename: "Feedback" | "Page" | "PhotoStory" | "Story" -}) & { - readonly " $refType": FragmentRefs<"Foo"> -} | null; -export type Foo$data = Foo; -export type Foo$key = { - readonly " $data"?: Foo$data, - readonly " $fragmentRefs": FragmentRefs<"Foo">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import { FragmentRefs } from "relay-runtime"; -export type Bar = { - readonly name?: string, - readonly body?: { - readonly text: string | null - } | null, - readonly " $refType": FragmentRefs<"Bar">, -} | null; -export type Bar$data = Bar; -export type Bar$key = { - readonly " $data"?: Bar$data, - readonly " $fragmentRefs": FragmentRefs<"Bar">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type Foo = ({ - readonly __typename: "User", - readonly name: string, -} | { - readonly __typename: "Comment", - readonly body: { - readonly text: string | null - } | null, -} | { - readonly __typename: "Feedback" | "Page" | "PhotoStory" | "Story" -}) & { - readonly " $refType": FragmentRefs<"Foo"> -} | null; -export type Foo$data = Foo; -export type Foo$key = { - readonly " $data"?: Foo$data, - readonly " $fragmentRefs": FragmentRefs<"Foo">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import { FragmentRefs } from "relay-runtime"; -export type Bar = { - readonly name?: string, - readonly body?: { - readonly text: string | null - } | null, - readonly " $refType": FragmentRefs<"Bar">, -} | null; -export type Bar$data = Bar; -export type Bar$key = { - readonly " $data"?: Bar$data, - readonly " $fragmentRefs": FragmentRefs<"Bar">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type Foo = ({ - readonly __typename: "User", - readonly name: string, -} | { - readonly __typename: "Comment", - readonly body: { - readonly text: string | null - } | null, -} | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly __typename: "%other" -}) & { - readonly " $refType": FragmentRefs<"Foo"> -} | null; -export type Foo$data = Foo; -export type Foo$key = { - readonly " $data"?: Foo$data, - readonly " $fragmentRefs": FragmentRefs<"Foo">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import { FragmentRefs } from "relay-runtime"; export type Bar = { readonly name?: string, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-raw-response-type.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-raw-response-type.expected index d0f8aa88cc472..7429fe51144c0 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-raw-response-type.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-raw-response-type.expected @@ -6,83 +6,6 @@ query MyQuery @raw_response_type { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type MyQueryVariables = {}; -export type MyQueryResponse = { - readonly me: { - readonly id: string, - readonly name: string, - } -} | null; -export type MyQueryRawResponse = { - readonly me: { - readonly id: string, - readonly name: string | null, - } | null -}; -export type MyQuery = { - variables: MyQueryVariables, - response: MyQueryResponse, - rawResponse: MyQueryRawResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type MyQueryVariables = {}; -export type MyQueryResponse = { - readonly me: { - readonly id: string, - readonly name: string, - } -} | null; -export type MyQueryRawResponse = { - readonly me: { - readonly id: string, - readonly name: string | null, - } | null -}; -export type MyQuery = { - variables: MyQueryVariables, - response: MyQueryResponse, - rawResponse: MyQueryRawResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type MyQueryVariables = {}; -export type MyQueryResponse = { - readonly me: { - readonly id: string, - readonly name: string, - } -} | null; -export type MyQueryRawResponse = { - readonly me: { - readonly id: string, - readonly name: string | null, - } | null -}; -export type MyQuery = { - variables: MyQueryVariables, - response: MyQueryResponse, - rawResponse: MyQueryRawResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type MyQueryVariables = {}; export type MyQueryResponse = { readonly me: { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected index 0bee3dd662c15..e5d0421c64c03 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected @@ -4,62 +4,6 @@ fragment NonNullFragment on User { lastName @required(action: THROW) } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import { FragmentRefs } from "relay-runtime"; -export type NonNullFragment = { - readonly firstName: string | null, - readonly lastName: string, - readonly " $refType": FragmentRefs<"NonNullFragment">, -}; -export type NonNullFragment$data = NonNullFragment; -export type NonNullFragment$key = { - readonly " $data"?: NonNullFragment$data, - readonly " $fragmentRefs": FragmentRefs<"NonNullFragment">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import { FragmentRefs } from "relay-runtime"; -export type NonNullFragment = { - readonly firstName: string | null, - readonly lastName: string, - readonly " $refType": FragmentRefs<"NonNullFragment">, -}; -export type NonNullFragment$data = NonNullFragment; -export type NonNullFragment$key = { - readonly " $data"?: NonNullFragment$data, - readonly " $fragmentRefs": FragmentRefs<"NonNullFragment">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import { FragmentRefs } from "relay-runtime"; -export type NonNullFragment = { - readonly firstName: string | null, - readonly lastName: string, - readonly " $refType": FragmentRefs<"NonNullFragment">, -}; -export type NonNullFragment$data = NonNullFragment; -export type NonNullFragment$key = { - readonly " $data"?: NonNullFragment$data, - readonly " $fragmentRefs": FragmentRefs<"NonNullFragment">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import { FragmentRefs } from "relay-runtime"; export type NonNullFragment = { readonly firstName: string | null, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-query.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-query.expected index 18041e0b5d0b5..60509d2802b1e 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-query.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-query.expected @@ -6,62 +6,6 @@ query FooQuery { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type FooQueryVariables = {}; -export type FooQueryResponse = { - readonly me: { - readonly firstName: string | null, - readonly lastName: string | null, - } -}; -export type FooQuery = { - variables: FooQueryVariables, - response: FooQueryResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type FooQueryVariables = {}; -export type FooQueryResponse = { - readonly me: { - readonly firstName: string | null, - readonly lastName: string | null, - } -}; -export type FooQuery = { - variables: FooQueryVariables, - response: FooQueryResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type FooQueryVariables = {}; -export type FooQueryResponse = { - readonly me: { - readonly firstName: string | null, - readonly lastName: string | null, - } -}; -export type FooQuery = { - variables: FooQueryVariables, - response: FooQueryResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type FooQueryVariables = {}; export type FooQueryResponse = { readonly me: { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throws-nested.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throws-nested.expected index 3ce8cc0d4807c..fc4ab910867c0 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throws-nested.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throws-nested.expected @@ -6,62 +6,6 @@ query FooQuery { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type FooQueryVariables = {}; -export type FooQueryResponse = { - readonly me: { - readonly firstName: string | null, - readonly lastName: string, - } | null -}; -export type FooQuery = { - variables: FooQueryVariables, - response: FooQueryResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type FooQueryVariables = {}; -export type FooQueryResponse = { - readonly me: { - readonly firstName: string | null, - readonly lastName: string, - } | null -}; -export type FooQuery = { - variables: FooQueryVariables, - response: FooQueryResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type FooQueryVariables = {}; -export type FooQueryResponse = { - readonly me: { - readonly firstName: string | null, - readonly lastName: string, - } | null -}; -export type FooQuery = { - variables: FooQueryVariables, - response: FooQueryResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type FooQueryVariables = {}; export type FooQueryResponse = { readonly me: { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required.expected index 15c0fc9aa6aa9..0167018244b99 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required.expected @@ -6,62 +6,6 @@ query FooQuery { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type FooQueryVariables = {}; -export type FooQueryResponse = { - readonly me: { - readonly firstName: string | null, - readonly lastName: string, - } | null -}; -export type FooQuery = { - variables: FooQueryVariables, - response: FooQueryResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type FooQueryVariables = {}; -export type FooQueryResponse = { - readonly me: { - readonly firstName: string | null, - readonly lastName: string, - } | null -}; -export type FooQuery = { - variables: FooQueryVariables, - response: FooQueryResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type FooQueryVariables = {}; -export type FooQueryResponse = { - readonly me: { - readonly firstName: string | null, - readonly lastName: string, - } | null -}; -export type FooQuery = { - variables: FooQueryVariables, - response: FooQueryResponse, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type FooQueryVariables = {}; export type FooQueryResponse = { readonly me: { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected index f43d15f35057b..402317637da1c 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected @@ -25,233 +25,6 @@ subscription TestSubscription($input: FeedbackLikeInput) { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type ExampleQueryVariables = { - id: string -}; -export type ExampleQueryResponse = { - readonly node: { - readonly id: string - } | null -}; -export type ExampleQuery = { - variables: ExampleQueryVariables, - response: ExampleQueryResponse, -}; -------------------------------------------------------------------------------- -export type CommentCreateInput = { - clientMutationId?: string | null, - feedbackId?: string | null, - feedback?: CommentfeedbackFeedback | null, -}; -export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null -}; -export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null -}; -export type TestMutationVariables = { - input: CommentCreateInput -}; -export type TestMutationResponse = { - readonly commentCreate: { - readonly comment: { - readonly id: string - } | null - } | null -}; -export type TestMutation = { - variables: TestMutationVariables, - response: TestMutationResponse, -}; -------------------------------------------------------------------------------- -export type FeedbackLikeInput = { - clientMutationId?: string | null, - feedbackId?: string | null, -}; -export type TestSubscriptionVariables = { - input?: FeedbackLikeInput | null -}; -export type TestSubscriptionResponse = { - readonly feedbackLikeSubscribe: { - readonly feedback: { - readonly id: string - } | null - } | null -}; -export type TestSubscription = { - variables: TestSubscriptionVariables, - response: TestSubscriptionResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type ExampleFragment = { - readonly id: string, - readonly " $refType": FragmentRefs<"ExampleFragment">, -}; -export type ExampleFragment$data = ExampleFragment; -export type ExampleFragment$key = { - readonly " $data"?: ExampleFragment$data, - readonly " $fragmentRefs": FragmentRefs<"ExampleFragment">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type ExampleQueryVariables = { - id: string -}; -export type ExampleQueryResponse = { - readonly node: { - readonly id: string - } | null -}; -export type ExampleQuery = { - variables: ExampleQueryVariables, - response: ExampleQueryResponse, -}; -------------------------------------------------------------------------------- -export type CommentCreateInput = { - clientMutationId?: string | null, - feedbackId?: string | null, - feedback?: CommentfeedbackFeedback | null, -}; -export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null -}; -export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null -}; -export type TestMutationVariables = { - input: CommentCreateInput -}; -export type TestMutationResponse = { - readonly commentCreate: { - readonly comment: { - readonly id: string - } | null - } | null -}; -export type TestMutation = { - variables: TestMutationVariables, - response: TestMutationResponse, -}; -------------------------------------------------------------------------------- -export type FeedbackLikeInput = { - clientMutationId?: string | null, - feedbackId?: string | null, -}; -export type TestSubscriptionVariables = { - input?: FeedbackLikeInput | null -}; -export type TestSubscriptionResponse = { - readonly feedbackLikeSubscribe: { - readonly feedback: { - readonly id: string - } | null - } | null -}; -export type TestSubscription = { - variables: TestSubscriptionVariables, - response: TestSubscriptionResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type ExampleFragment = { - readonly id: string, - readonly " $refType": FragmentRefs<"ExampleFragment">, -}; -export type ExampleFragment$data = ExampleFragment; -export type ExampleFragment$key = { - readonly " $data"?: ExampleFragment$data, - readonly " $fragmentRefs": FragmentRefs<"ExampleFragment">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type ExampleQueryVariables = { - id: string -}; -export type ExampleQueryResponse = { - readonly node: { - readonly id: string - } | null -}; -export type ExampleQuery = { - variables: ExampleQueryVariables, - response: ExampleQueryResponse, -}; -------------------------------------------------------------------------------- -export type CommentCreateInput = { - clientMutationId?: string | null, - feedbackId?: string | null, - feedback?: CommentfeedbackFeedback | null, -}; -export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null -}; -export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null -}; -export type TestMutationVariables = { - input: CommentCreateInput -}; -export type TestMutationResponse = { - readonly commentCreate: { - readonly comment: { - readonly id: string - } | null - } | null -}; -export type TestMutation = { - variables: TestMutationVariables, - response: TestMutationResponse, -}; -------------------------------------------------------------------------------- -export type FeedbackLikeInput = { - clientMutationId?: string | null, - feedbackId?: string | null, -}; -export type TestSubscriptionVariables = { - input?: FeedbackLikeInput | null -}; -export type TestSubscriptionResponse = { - readonly feedbackLikeSubscribe: { - readonly feedback: { - readonly id: string - } | null - } | null -}; -export type TestSubscription = { - variables: TestSubscriptionVariables, - response: TestSubscriptionResponse, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type ExampleFragment = { - readonly id: string, - readonly " $refType": FragmentRefs<"ExampleFragment">, -}; -export type ExampleFragment$data = ExampleFragment; -export type ExampleFragment$key = { - readonly " $data"?: ExampleFragment$data, - readonly " $fragmentRefs": FragmentRefs<"ExampleFragment">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type ExampleQueryVariables = { id: string }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/scalar-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/scalar-field.expected index d08a0c5363c5f..601c3b4878f21 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/scalar-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/scalar-field.expected @@ -13,92 +13,6 @@ fragment ScalarField on User { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -export type PersonalityTraits = "CHEERFUL" | "DERISIVE" | "HELPFUL" | "SNARKY"; -import { FragmentRefs } from "relay-runtime"; -export type ScalarField = { - readonly id: string, - readonly name: string | null, - readonly websites: ReadonlyArray | null, - readonly traits: ReadonlyArray | null, - readonly aliasedLinkedField: { - readonly aliasedField: number | null - } | null, - readonly screennames: ReadonlyArray<{ - readonly name: string | null, - readonly service: string | null, - } | null> | null, - readonly " $refType": FragmentRefs<"ScalarField">, -}; -export type ScalarField$data = ScalarField; -export type ScalarField$key = { - readonly " $data"?: ScalarField$data, - readonly " $fragmentRefs": FragmentRefs<"ScalarField">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -export type PersonalityTraits = "CHEERFUL" | "DERISIVE" | "HELPFUL" | "SNARKY" | "%future added value"; -import { FragmentRefs } from "relay-runtime"; -export type ScalarField = { - readonly id: string, - readonly name: string | null, - readonly websites: ReadonlyArray | null, - readonly traits: ReadonlyArray | null, - readonly aliasedLinkedField: { - readonly aliasedField: number | null - } | null, - readonly screennames: ReadonlyArray<{ - readonly name: string | null, - readonly service: string | null, - } | null> | null, - readonly " $refType": FragmentRefs<"ScalarField">, -}; -export type ScalarField$data = ScalarField; -export type ScalarField$key = { - readonly " $data"?: ScalarField$data, - readonly " $fragmentRefs": FragmentRefs<"ScalarField">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -export type PersonalityTraits = "CHEERFUL" | "DERISIVE" | "HELPFUL" | "SNARKY"; -import { FragmentRefs } from "relay-runtime"; -export type ScalarField = { - readonly id: string, - readonly name: string | null, - readonly websites: ReadonlyArray | null, - readonly traits: ReadonlyArray | null, - readonly aliasedLinkedField: { - readonly aliasedField: number | null - } | null, - readonly screennames: ReadonlyArray<{ - readonly name: string | null, - readonly service: string | null, - } | null> | null, - readonly " $refType": FragmentRefs<"ScalarField">, -}; -export type ScalarField$data = ScalarField; -export type ScalarField$key = { - readonly " $data"?: ScalarField$data, - readonly " $fragmentRefs": FragmentRefs<"ScalarField">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - export type PersonalityTraits = "CHEERFUL" | "DERISIVE" | "HELPFUL" | "SNARKY" | "%future added value"; import { FragmentRefs } from "relay-runtime"; export type ScalarField = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/simple.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/simple.expected index 54121afda2b4a..5153945130434 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/simple.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/simple.expected @@ -8,74 +8,6 @@ fragment LinkedField on User { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import { FragmentRefs } from "relay-runtime"; -export type LinkedField = { - readonly name: string | null, - readonly profilePicture: { - readonly uri: string | null, - readonly width: number | null, - readonly height: number | null, - } | null, - readonly " $refType": FragmentRefs<"LinkedField">, -}; -export type LinkedField$data = LinkedField; -export type LinkedField$key = { - readonly " $data"?: LinkedField$data, - readonly " $fragmentRefs": FragmentRefs<"LinkedField">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import { FragmentRefs } from "relay-runtime"; -export type LinkedField = { - readonly name: string | null, - readonly profilePicture: { - readonly uri: string | null, - readonly width: number | null, - readonly height: number | null, - } | null, - readonly " $refType": FragmentRefs<"LinkedField">, -}; -export type LinkedField$data = LinkedField; -export type LinkedField$key = { - readonly " $data"?: LinkedField$data, - readonly " $fragmentRefs": FragmentRefs<"LinkedField">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import { FragmentRefs } from "relay-runtime"; -export type LinkedField = { - readonly name: string | null, - readonly profilePicture: { - readonly uri: string | null, - readonly width: number | null, - readonly height: number | null, - } | null, - readonly " $refType": FragmentRefs<"LinkedField">, -}; -export type LinkedField$data = LinkedField; -export type LinkedField$key = { - readonly " $data"?: LinkedField$data, - readonly " $fragmentRefs": FragmentRefs<"LinkedField">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import { FragmentRefs } from "relay-runtime"; export type LinkedField = { readonly name: string | null, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected index d6840e4adb4ac..29ebfa9a2c8f7 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected @@ -16,96 +16,6 @@ fragment TypenameInsideWithOverlappingFields on Viewer { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import { FragmentRefs } from "relay-runtime"; -export type TypenameInsideWithOverlappingFields = { - readonly actor: { - readonly __typename: "Page", - readonly id: string, - readonly name: string | null, - } | { - readonly __typename: "User", - readonly id: string, - readonly name: string | null, - readonly profile_picture: { - readonly uri: string | null - } | null, - } | null, - readonly " $refType": FragmentRefs<"TypenameInsideWithOverlappingFields">, -}; -export type TypenameInsideWithOverlappingFields$data = TypenameInsideWithOverlappingFields; -export type TypenameInsideWithOverlappingFields$key = { - readonly " $data"?: TypenameInsideWithOverlappingFields$data, - readonly " $fragmentRefs": FragmentRefs<"TypenameInsideWithOverlappingFields">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import { FragmentRefs } from "relay-runtime"; -export type TypenameInsideWithOverlappingFields = { - readonly actor: { - readonly __typename: "Page", - readonly id: string, - readonly name: string | null, - } | { - readonly __typename: "User", - readonly id: string, - readonly name: string | null, - readonly profile_picture: { - readonly uri: string | null - } | null, - } | null, - readonly " $refType": FragmentRefs<"TypenameInsideWithOverlappingFields">, -}; -export type TypenameInsideWithOverlappingFields$data = TypenameInsideWithOverlappingFields; -export type TypenameInsideWithOverlappingFields$key = { - readonly " $data"?: TypenameInsideWithOverlappingFields$data, - readonly " $fragmentRefs": FragmentRefs<"TypenameInsideWithOverlappingFields">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import { FragmentRefs } from "relay-runtime"; -export type TypenameInsideWithOverlappingFields = { - readonly actor: { - readonly __typename: "Page", - readonly id: string, - readonly name: string | null, - } | { - readonly __typename: "User", - readonly id: string, - readonly name: string | null, - readonly profile_picture: { - readonly uri: string | null - } | null, - } | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly __typename: "%other" - } | null, - readonly " $refType": FragmentRefs<"TypenameInsideWithOverlappingFields">, -}; -export type TypenameInsideWithOverlappingFields$data = TypenameInsideWithOverlappingFields; -export type TypenameInsideWithOverlappingFields$key = { - readonly " $data"?: TypenameInsideWithOverlappingFields$data, - readonly " $fragmentRefs": FragmentRefs<"TypenameInsideWithOverlappingFields">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import { FragmentRefs } from "relay-runtime"; export type TypenameInsideWithOverlappingFields = { readonly actor: { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected index 769dc9ce93cf1..b23b46bf9a903 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected @@ -80,444 +80,6 @@ fragment TypenameAliases on Actor { } } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import { FragmentRefs } from "relay-runtime"; -export type TypenameAlias = ({ - readonly _typeAlias: "User", - readonly firstName: string | null, -} | { - readonly _typeAlias: "Page", - readonly username: string | null, -}) & { - readonly " $refType": FragmentRefs<"TypenameAlias"> -}; -export type TypenameAlias$data = TypenameAlias; -export type TypenameAlias$key = { - readonly " $data"?: TypenameAlias$data, - readonly " $fragmentRefs": FragmentRefs<"TypenameAlias">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type TypenameAliases = ({ - readonly _typeAlias1: "User", - readonly _typeAlias2: "User", - readonly firstName: string | null, -} | { - readonly _typeAlias1: "Page", - readonly _typeAlias2: "Page", - readonly username: string | null, -}) & { - readonly " $refType": FragmentRefs<"TypenameAliases"> -}; -export type TypenameAliases$data = TypenameAliases; -export type TypenameAliases$key = { - readonly " $data"?: TypenameAliases$data, - readonly " $fragmentRefs": FragmentRefs<"TypenameAliases">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type TypenameInside = ({ - readonly __typename: "User", - readonly firstName: string | null, -} | { - readonly __typename: "Page", - readonly username: string | null, -}) & { - readonly " $refType": FragmentRefs<"TypenameInside"> -}; -export type TypenameInside$data = TypenameInside; -export type TypenameInside$key = { - readonly " $data"?: TypenameInside$data, - readonly " $fragmentRefs": FragmentRefs<"TypenameInside">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type TypenameOutside = ({ - readonly __typename: "User", - readonly firstName: string | null, -} | { - readonly __typename: "Page", - readonly username: string | null, -}) & { - readonly " $refType": FragmentRefs<"TypenameOutside"> -}; -export type TypenameOutside$data = TypenameOutside; -export type TypenameOutside$key = { - readonly " $data"?: TypenameOutside$data, - readonly " $fragmentRefs": FragmentRefs<"TypenameOutside">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type TypenameOutsideWithAbstractType = ({ - readonly __typename: "User", - readonly firstName: string | null, - readonly address: { - readonly street: string | null, - readonly city: string | null, - } | null, -} | { - readonly __typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" -}) & { - readonly username?: string | null, - readonly address?: { - readonly city: string | null, - readonly country: string | null, - } | null, - readonly " $refType": FragmentRefs<"TypenameOutsideWithAbstractType">, -}; -export type TypenameOutsideWithAbstractType$data = TypenameOutsideWithAbstractType; -export type TypenameOutsideWithAbstractType$key = { - readonly " $data"?: TypenameOutsideWithAbstractType$data, - readonly " $fragmentRefs": FragmentRefs<"TypenameOutsideWithAbstractType">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type TypenameWithCommonSelections = ({ - readonly __typename: "User", - readonly firstName: string | null, -} | { - readonly __typename: "Page", - readonly username: string | null, -}) & { - readonly name: string | null, - readonly " $refType": FragmentRefs<"TypenameWithCommonSelections">, -}; -export type TypenameWithCommonSelections$data = TypenameWithCommonSelections; -export type TypenameWithCommonSelections$key = { - readonly " $data"?: TypenameWithCommonSelections$data, - readonly " $fragmentRefs": FragmentRefs<"TypenameWithCommonSelections">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type TypenameWithoutSpreads = { - readonly __typename: "User", - readonly firstName: string | null, - readonly " $refType": FragmentRefs<"TypenameWithoutSpreads">, -}; -export type TypenameWithoutSpreads$data = TypenameWithoutSpreads; -export type TypenameWithoutSpreads$key = { - readonly " $data"?: TypenameWithoutSpreads$data, - readonly " $fragmentRefs": FragmentRefs<"TypenameWithoutSpreads">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type TypenameWithoutSpreadsAbstractType = { - readonly __typename: string, - readonly id: string, - readonly " $refType": FragmentRefs<"TypenameWithoutSpreadsAbstractType">, -}; -export type TypenameWithoutSpreadsAbstractType$data = TypenameWithoutSpreadsAbstractType; -export type TypenameWithoutSpreadsAbstractType$key = { - readonly " $data"?: TypenameWithoutSpreadsAbstractType$data, - readonly " $fragmentRefs": FragmentRefs<"TypenameWithoutSpreadsAbstractType">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import { FragmentRefs } from "relay-runtime"; -export type TypenameAlias = ({ - readonly _typeAlias: "User", - readonly firstName: string | null, -} | { - readonly _typeAlias: "Page", - readonly username: string | null, -}) & { - readonly " $refType": FragmentRefs<"TypenameAlias"> -}; -export type TypenameAlias$data = TypenameAlias; -export type TypenameAlias$key = { - readonly " $data"?: TypenameAlias$data, - readonly " $fragmentRefs": FragmentRefs<"TypenameAlias">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type TypenameAliases = ({ - readonly _typeAlias1: "User", - readonly _typeAlias2: "User", - readonly firstName: string | null, -} | { - readonly _typeAlias1: "Page", - readonly _typeAlias2: "Page", - readonly username: string | null, -}) & { - readonly " $refType": FragmentRefs<"TypenameAliases"> -}; -export type TypenameAliases$data = TypenameAliases; -export type TypenameAliases$key = { - readonly " $data"?: TypenameAliases$data, - readonly " $fragmentRefs": FragmentRefs<"TypenameAliases">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type TypenameInside = ({ - readonly __typename: "User", - readonly firstName: string | null, -} | { - readonly __typename: "Page", - readonly username: string | null, -}) & { - readonly " $refType": FragmentRefs<"TypenameInside"> -}; -export type TypenameInside$data = TypenameInside; -export type TypenameInside$key = { - readonly " $data"?: TypenameInside$data, - readonly " $fragmentRefs": FragmentRefs<"TypenameInside">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type TypenameOutside = ({ - readonly __typename: "User", - readonly firstName: string | null, -} | { - readonly __typename: "Page", - readonly username: string | null, -}) & { - readonly " $refType": FragmentRefs<"TypenameOutside"> -}; -export type TypenameOutside$data = TypenameOutside; -export type TypenameOutside$key = { - readonly " $data"?: TypenameOutside$data, - readonly " $fragmentRefs": FragmentRefs<"TypenameOutside">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type TypenameOutsideWithAbstractType = ({ - readonly __typename: "User", - readonly firstName: string | null, - readonly address: { - readonly street: string | null, - readonly city: string | null, - } | null, -} | { - readonly __typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" -}) & { - readonly username?: string | null, - readonly address?: { - readonly city: string | null, - readonly country: string | null, - } | null, - readonly " $refType": FragmentRefs<"TypenameOutsideWithAbstractType">, -}; -export type TypenameOutsideWithAbstractType$data = TypenameOutsideWithAbstractType; -export type TypenameOutsideWithAbstractType$key = { - readonly " $data"?: TypenameOutsideWithAbstractType$data, - readonly " $fragmentRefs": FragmentRefs<"TypenameOutsideWithAbstractType">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type TypenameWithCommonSelections = ({ - readonly __typename: "User", - readonly firstName: string | null, -} | { - readonly __typename: "Page", - readonly username: string | null, -}) & { - readonly name: string | null, - readonly " $refType": FragmentRefs<"TypenameWithCommonSelections">, -}; -export type TypenameWithCommonSelections$data = TypenameWithCommonSelections; -export type TypenameWithCommonSelections$key = { - readonly " $data"?: TypenameWithCommonSelections$data, - readonly " $fragmentRefs": FragmentRefs<"TypenameWithCommonSelections">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type TypenameWithoutSpreads = { - readonly __typename: "User", - readonly firstName: string | null, - readonly " $refType": FragmentRefs<"TypenameWithoutSpreads">, -}; -export type TypenameWithoutSpreads$data = TypenameWithoutSpreads; -export type TypenameWithoutSpreads$key = { - readonly " $data"?: TypenameWithoutSpreads$data, - readonly " $fragmentRefs": FragmentRefs<"TypenameWithoutSpreads">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type TypenameWithoutSpreadsAbstractType = { - readonly __typename: string, - readonly id: string, - readonly " $refType": FragmentRefs<"TypenameWithoutSpreadsAbstractType">, -}; -export type TypenameWithoutSpreadsAbstractType$data = TypenameWithoutSpreadsAbstractType; -export type TypenameWithoutSpreadsAbstractType$key = { - readonly " $data"?: TypenameWithoutSpreadsAbstractType$data, - readonly " $fragmentRefs": FragmentRefs<"TypenameWithoutSpreadsAbstractType">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import { FragmentRefs } from "relay-runtime"; -export type TypenameAlias = ({ - readonly _typeAlias: "User", - readonly firstName: string | null, -} | { - readonly _typeAlias: "Page", - readonly username: string | null, -} | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly _typeAlias: "%other" -}) & { - readonly " $refType": FragmentRefs<"TypenameAlias"> -}; -export type TypenameAlias$data = TypenameAlias; -export type TypenameAlias$key = { - readonly " $data"?: TypenameAlias$data, - readonly " $fragmentRefs": FragmentRefs<"TypenameAlias">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type TypenameAliases = ({ - readonly _typeAlias1: "User", - readonly _typeAlias2: "User", - readonly firstName: string | null, -} | { - readonly _typeAlias1: "Page", - readonly _typeAlias2: "Page", - readonly username: string | null, -} | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly _typeAlias1: "%other", - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly _typeAlias2: "%other", -}) & { - readonly " $refType": FragmentRefs<"TypenameAliases"> -}; -export type TypenameAliases$data = TypenameAliases; -export type TypenameAliases$key = { - readonly " $data"?: TypenameAliases$data, - readonly " $fragmentRefs": FragmentRefs<"TypenameAliases">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type TypenameInside = ({ - readonly __typename: "User", - readonly firstName: string | null, -} | { - readonly __typename: "Page", - readonly username: string | null, -} | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly __typename: "%other" -}) & { - readonly " $refType": FragmentRefs<"TypenameInside"> -}; -export type TypenameInside$data = TypenameInside; -export type TypenameInside$key = { - readonly " $data"?: TypenameInside$data, - readonly " $fragmentRefs": FragmentRefs<"TypenameInside">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type TypenameOutside = ({ - readonly __typename: "User", - readonly firstName: string | null, -} | { - readonly __typename: "Page", - readonly username: string | null, -} | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly __typename: "%other" -}) & { - readonly " $refType": FragmentRefs<"TypenameOutside"> -}; -export type TypenameOutside$data = TypenameOutside; -export type TypenameOutside$key = { - readonly " $data"?: TypenameOutside$data, - readonly " $fragmentRefs": FragmentRefs<"TypenameOutside">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type TypenameOutsideWithAbstractType = ({ - readonly __typename: "User", - readonly firstName: string | null, - readonly address: { - readonly street: string | null, - readonly city: string | null, - } | null, -} | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly __typename: "%other" -}) & { - readonly username?: string | null, - readonly address?: { - readonly city: string | null, - readonly country: string | null, - } | null, - readonly " $refType": FragmentRefs<"TypenameOutsideWithAbstractType">, -}; -export type TypenameOutsideWithAbstractType$data = TypenameOutsideWithAbstractType; -export type TypenameOutsideWithAbstractType$key = { - readonly " $data"?: TypenameOutsideWithAbstractType$data, - readonly " $fragmentRefs": FragmentRefs<"TypenameOutsideWithAbstractType">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type TypenameWithCommonSelections = ({ - readonly __typename: "User", - readonly firstName: string | null, -} | { - readonly __typename: "Page", - readonly username: string | null, -} | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly __typename: "%other" -}) & { - readonly name: string | null, - readonly " $refType": FragmentRefs<"TypenameWithCommonSelections">, -}; -export type TypenameWithCommonSelections$data = TypenameWithCommonSelections; -export type TypenameWithCommonSelections$key = { - readonly " $data"?: TypenameWithCommonSelections$data, - readonly " $fragmentRefs": FragmentRefs<"TypenameWithCommonSelections">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type TypenameWithoutSpreads = { - readonly __typename: "User", - readonly firstName: string | null, - readonly " $refType": FragmentRefs<"TypenameWithoutSpreads">, -}; -export type TypenameWithoutSpreads$data = TypenameWithoutSpreads; -export type TypenameWithoutSpreads$key = { - readonly " $data"?: TypenameWithoutSpreads$data, - readonly " $fragmentRefs": FragmentRefs<"TypenameWithoutSpreads">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type TypenameWithoutSpreadsAbstractType = { - readonly __typename: string, - readonly id: string, - readonly " $refType": FragmentRefs<"TypenameWithoutSpreadsAbstractType">, -}; -export type TypenameWithoutSpreadsAbstractType$data = TypenameWithoutSpreadsAbstractType; -export type TypenameWithoutSpreadsAbstractType$key = { - readonly " $data"?: TypenameWithoutSpreadsAbstractType$data, - readonly " $fragmentRefs": FragmentRefs<"TypenameWithoutSpreadsAbstractType">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import { FragmentRefs } from "relay-runtime"; export type TypenameAlias = ({ readonly _typeAlias: "User", diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected index 8fcbfcbd06506..f6ec1b48338e3 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected @@ -26,179 +26,6 @@ fragment AnotherRecursiveFragment on Image { height } ==================================== OUTPUT =================================== -/* - * future proof enums: false - * future proof abstract types: false - */ - -import { FragmentRefs } from "relay-runtime"; -export type AnotherRecursiveFragment = { - readonly uri: string | null, - readonly height: number | null, - readonly " $refType": FragmentRefs<"AnotherRecursiveFragment">, -}; -export type AnotherRecursiveFragment$data = AnotherRecursiveFragment; -export type AnotherRecursiveFragment$key = { - readonly " $data"?: AnotherRecursiveFragment$data, - readonly " $fragmentRefs": FragmentRefs<"AnotherRecursiveFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type PhotoFragment = { - readonly uri: string | null, - readonly width: number | null, - readonly " $refType": FragmentRefs<"PhotoFragment">, -}; -export type PhotoFragment$data = PhotoFragment; -export type PhotoFragment$key = { - readonly " $data"?: PhotoFragment$data, - readonly " $fragmentRefs": FragmentRefs<"PhotoFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type RecursiveFragment = { - readonly uri: string | null, - readonly width: number | null, -}; -export type RecursiveFragment$data = RecursiveFragment; -export type RecursiveFragment$key = { - readonly " $data"?: RecursiveFragment$data, - readonly " $fragmentRefs": FragmentRefs<"RecursiveFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type UserProfile = { - readonly profilePicture: { - readonly uri: string | null, - readonly width: number | null, - readonly height: number | null, - readonly " $fragmentRefs": FragmentRefs<"PhotoFragment">, - } | null, - readonly " $refType": FragmentRefs<"UserProfile">, -}; -export type UserProfile$data = UserProfile; -export type UserProfile$key = { - readonly " $data"?: UserProfile$data, - readonly " $fragmentRefs": FragmentRefs<"UserProfile">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: false - */ - -import { FragmentRefs } from "relay-runtime"; -export type AnotherRecursiveFragment = { - readonly uri: string | null, - readonly height: number | null, - readonly " $refType": FragmentRefs<"AnotherRecursiveFragment">, -}; -export type AnotherRecursiveFragment$data = AnotherRecursiveFragment; -export type AnotherRecursiveFragment$key = { - readonly " $data"?: AnotherRecursiveFragment$data, - readonly " $fragmentRefs": FragmentRefs<"AnotherRecursiveFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type PhotoFragment = { - readonly uri: string | null, - readonly width: number | null, - readonly " $refType": FragmentRefs<"PhotoFragment">, -}; -export type PhotoFragment$data = PhotoFragment; -export type PhotoFragment$key = { - readonly " $data"?: PhotoFragment$data, - readonly " $fragmentRefs": FragmentRefs<"PhotoFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type RecursiveFragment = { - readonly uri: string | null, - readonly width: number | null, -}; -export type RecursiveFragment$data = RecursiveFragment; -export type RecursiveFragment$key = { - readonly " $data"?: RecursiveFragment$data, - readonly " $fragmentRefs": FragmentRefs<"RecursiveFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type UserProfile = { - readonly profilePicture: { - readonly uri: string | null, - readonly width: number | null, - readonly height: number | null, - readonly " $fragmentRefs": FragmentRefs<"PhotoFragment">, - } | null, - readonly " $refType": FragmentRefs<"UserProfile">, -}; -export type UserProfile$data = UserProfile; -export type UserProfile$key = { - readonly " $data"?: UserProfile$data, - readonly " $fragmentRefs": FragmentRefs<"UserProfile">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: false - * future proof abstract types: true - */ - -import { FragmentRefs } from "relay-runtime"; -export type AnotherRecursiveFragment = { - readonly uri: string | null, - readonly height: number | null, - readonly " $refType": FragmentRefs<"AnotherRecursiveFragment">, -}; -export type AnotherRecursiveFragment$data = AnotherRecursiveFragment; -export type AnotherRecursiveFragment$key = { - readonly " $data"?: AnotherRecursiveFragment$data, - readonly " $fragmentRefs": FragmentRefs<"AnotherRecursiveFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type PhotoFragment = { - readonly uri: string | null, - readonly width: number | null, - readonly " $refType": FragmentRefs<"PhotoFragment">, -}; -export type PhotoFragment$data = PhotoFragment; -export type PhotoFragment$key = { - readonly " $data"?: PhotoFragment$data, - readonly " $fragmentRefs": FragmentRefs<"PhotoFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type RecursiveFragment = { - readonly uri: string | null, - readonly width: number | null, -}; -export type RecursiveFragment$data = RecursiveFragment; -export type RecursiveFragment$key = { - readonly " $data"?: RecursiveFragment$data, - readonly " $fragmentRefs": FragmentRefs<"RecursiveFragment">, -}; -------------------------------------------------------------------------------- -import { FragmentRefs } from "relay-runtime"; -export type UserProfile = { - readonly profilePicture: { - readonly uri: string | null, - readonly width: number | null, - readonly height: number | null, - readonly " $fragmentRefs": FragmentRefs<"PhotoFragment">, - } | null, - readonly " $refType": FragmentRefs<"UserProfile">, -}; -export type UserProfile$data = UserProfile; -export type UserProfile$key = { - readonly " $data"?: UserProfile$data, - readonly " $fragmentRefs": FragmentRefs<"UserProfile">, -}; -------------------------------------------------------------------------------- -/* - * future proof enums: true - * future proof abstract types: true - */ - import { FragmentRefs } from "relay-runtime"; export type AnotherRecursiveFragment = { readonly uri: string | null, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/mod.rs b/compiler/crates/relay-typegen/tests/generate_typescript/mod.rs index 8aae8825514fa..8bf1af96878d2 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/mod.rs +++ b/compiler/crates/relay-typegen/tests/generate_typescript/mod.rs @@ -45,51 +45,35 @@ pub fn transform_fixture(fixture: &Fixture<'_>) -> Result { ) .unwrap(); - let separator = - "-------------------------------------------------------------------------------\n"; - Ok(vec![false, false, true, false, false, true, true, true] - .chunks(2) - .map(|bools| (bools[0], bools[1])) - .map(|(future_proof_enums, future_proof_abstract_types)| { - let typegen_config = TypegenConfig { - language: TypegenLanguage::TypeScript, - haste: true, - future_proof_abstract_types, - future_proof_enums, - ..Default::default() - }; - - let mut operations: Vec<_> = programs.typegen.operations().collect(); - operations.sort_by_key(|op| op.name.item); - let operation_strings = operations.into_iter().map(|typegen_operation| { - let normalization_operation = programs - .normalization - .operation(typegen_operation.name.item) - .unwrap(); - relay_typegen::generate_operation_type( - typegen_operation, - normalization_operation, - &schema, - &typegen_config, - ) - }); + let typegen_config = TypegenConfig { + language: TypegenLanguage::TypeScript, + haste: true, + ..Default::default() + }; - let mut fragments: Vec<_> = programs.typegen.fragments().collect(); - fragments.sort_by_key(|frag| frag.name.item); - let fragment_strings = fragments - .into_iter() - .map(|frag| relay_typegen::generate_fragment_type(frag, &schema, &typegen_config)); + let mut operations: Vec<_> = programs.typegen.operations().collect(); + operations.sort_by_key(|op| op.name.item); + let operation_strings = operations.into_iter().map(|typegen_operation| { + let normalization_operation = programs + .normalization + .operation(typegen_operation.name.item) + .unwrap(); + relay_typegen::generate_operation_type( + typegen_operation, + normalization_operation, + &schema, + &typegen_config, + ) + }); - let mut result: Vec = operation_strings.collect(); - result.extend(fragment_strings); + let mut fragments: Vec<_> = programs.typegen.fragments().collect(); + fragments.sort_by_key(|frag| frag.name.item); + let fragment_strings = fragments + .into_iter() + .map(|frag| relay_typegen::generate_fragment_type(frag, &schema, &typegen_config)); - format!( - "/*\n * future proof enums: {}\n * future proof abstract types: {}\n */\n\n{}", - future_proof_enums, - future_proof_abstract_types, - result.join(separator) - ) - }) - .collect::>() - .join(separator)) + let mut result: Vec = operation_strings.collect(); + result.extend(fragment_strings); + Ok(result + .join("-------------------------------------------------------------------------------\n")) } From d769f2af4b4fb3fecbb0dc3a5b8ae58da98a9e63 Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Sun, 27 Dec 2020 18:10:44 +0100 Subject: [PATCH 24/41] Add an optional JSON header to typegen fixtures for customizable typegen config. --- compiler/Cargo.lock | 5 ++- compiler/crates/relay-typegen/Cargo.toml | 1 + .../mutation-with-enums-on-fragment.expected | 8 +++- .../mutation-with-enums-on-fragment.graphql | 4 ++ .../fixtures/relay-client-id-field.expected | 12 +++--- .../fixtures/relay-client-id-field.graphql | 4 ++ ...ough-inline-fragments-to-fragment.expected | 8 ++-- ...rough-inline-fragments-to-fragment.graphql | 4 ++ .../fixtures/typename-on-union.expected | 37 +++---------------- .../fixtures/typename-on-union.graphql | 4 ++ .../relay-typegen/tests/generate_flow/mod.rs | 23 +++++++++--- .../mutation-with-enums-on-fragment.expected | 8 +++- .../mutation-with-enums-on-fragment.graphql | 4 ++ .../fixtures/relay-client-id-field.expected | 12 +++--- .../fixtures/relay-client-id-field.graphql | 4 ++ ...ough-inline-fragments-to-fragment.expected | 8 ++-- ...rough-inline-fragments-to-fragment.graphql | 4 ++ .../fixtures/typename-on-union.expected | 31 +++------------- .../fixtures/typename-on-union.graphql | 4 ++ .../tests/generate_typescript/mod.rs | 23 +++++++++--- 20 files changed, 116 insertions(+), 92 deletions(-) diff --git a/compiler/Cargo.lock b/compiler/Cargo.lock index bf75d800eee22..be9b1b2bbece7 100644 --- a/compiler/Cargo.lock +++ b/compiler/Cargo.lock @@ -1843,6 +1843,7 @@ dependencies = [ "relay-transforms", "schema", "serde", + "serde_json", ] [[package]] @@ -2003,9 +2004,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.59" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcac07dbffa1c65e7f816ab9eba78eb142c6d44410f4eeba1e26e4f5dfa56b95" +checksum = "1500e84d27fe482ed1dc791a56eddc2f230046a040fa908c08bda1d9fb615779" dependencies = [ "itoa", "ryu", diff --git a/compiler/crates/relay-typegen/Cargo.toml b/compiler/crates/relay-typegen/Cargo.toml index ed5b0f46f5701..1cbe598a31982 100644 --- a/compiler/crates/relay-typegen/Cargo.toml +++ b/compiler/crates/relay-typegen/Cargo.toml @@ -28,6 +28,7 @@ fnv = "1.0" indexmap = { version = "1.3", features = ["serde-1", "rayon"] } lazy_static = "1.0" serde = { version = "1.0", features = ["derive", "rc"] } +serde_json = "1.0.60" [dev-dependencies] fixture-tests = { path = "../fixture-tests" } diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-enums-on-fragment.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-enums-on-fragment.expected index 9b0709bf2da7d..f917ecb57feeb 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-enums-on-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-enums-on-fragment.expected @@ -1,4 +1,8 @@ ==================================== INPUT ==================================== +{ + "futureProofEnums": false +} +%%% mutation CommentCreateMutation( $input: CommentCreateInput! $first: Int @@ -28,7 +32,7 @@ fragment FriendFragment on User { } ==================================== OUTPUT =================================== import type { FriendFragment$ref } from "FriendFragment.graphql"; -export type TestEnums = "mark" | "zuck" | "%future added value"; +export type TestEnums = "mark" | "zuck"; export type CommentCreateInput = {| clientMutationId?: ?string, feedbackId?: ?string, @@ -86,7 +90,7 @@ export type CommentCreateMutation = {| rawResponse: CommentCreateMutationRawResponse, |}; ------------------------------------------------------------------------------- -export type TestEnums = "mark" | "zuck" | "%future added value"; +export type TestEnums = "mark" | "zuck"; import type { FragmentReference } from "relay-runtime"; declare export opaque type FriendFragment$ref: FragmentReference; declare export opaque type FriendFragment$fragmentType: FriendFragment$ref; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-enums-on-fragment.graphql b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-enums-on-fragment.graphql index c611ff829c485..3d338dfdb3e82 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-enums-on-fragment.graphql +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-enums-on-fragment.graphql @@ -1,3 +1,7 @@ +{ + "futureProofEnums": false +} +%%% mutation CommentCreateMutation( $input: CommentCreateInput! $first: Int diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.expected index 8bb8a29dee859..5084f5dc7d1a2 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.expected @@ -1,4 +1,8 @@ ==================================== INPUT ==================================== +{ + "futureProofAbstractTypes": false +} +%%% query RelayClientIDFieldQuery($id: ID!) { __id # ok on query type me { @@ -49,17 +53,13 @@ export type RelayClientIDFieldQueryResponse = {| |}, +__id: string, |} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +__typename: "%other", + +__typename: "MarkdownCommentBody", +__id: string, |}), +__id: string, +id: string, |} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +__typename: "%other", + +__typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "User", +__id: string, +id: string, |}), diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.graphql b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.graphql index 819f708b8bb40..59cfcd8c3b1e2 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.graphql +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.graphql @@ -1,3 +1,7 @@ +{ + "futureProofAbstractTypes": false +} +%%% query RelayClientIDFieldQuery($id: ID!) { __id # ok on query type me { diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected index 36f1e3a8fe0ad..54a52e13f1232 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected @@ -1,4 +1,8 @@ ==================================== INPUT ==================================== +{ + "futureProofAbstractTypes": false +} +%%% fragment Foo on Node { __typename ... on User { @@ -16,9 +20,7 @@ export type Foo = ?({| +name: string, +$refType: Foo$ref, |} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +__typename: "%other", + +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story", +$refType: Foo$ref, |}); export type Foo$data = Foo; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-through-inline-fragments-to-fragment.graphql b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-through-inline-fragments-to-fragment.graphql index 01304b96f8eff..4cceb5981de5e 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-through-inline-fragments-to-fragment.graphql +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-through-inline-fragments-to-fragment.graphql @@ -1,3 +1,7 @@ +{ + "futureProofAbstractTypes": false +} +%%% fragment Foo on Node { __typename ... on User { diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected index 2c1958daed161..5499caec0d3b3 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected @@ -1,4 +1,8 @@ ==================================== INPUT ==================================== +{ + "futureProofAbstractTypes": false +} +%%% fragment TypenameInside on Actor { ... on User { __typename @@ -91,11 +95,6 @@ export type TypenameAlias = {| +_typeAlias: "Page", +username: ?string, +$refType: TypenameAlias$ref, -|} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +_typeAlias: "%other", - +$refType: TypenameAlias$ref, |}; export type TypenameAlias$data = TypenameAlias; export type TypenameAlias$key = { @@ -117,14 +116,6 @@ export type TypenameAliases = {| +_typeAlias2: "Page", +username: ?string, +$refType: TypenameAliases$ref, -|} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +_typeAlias1: "%other", - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +_typeAlias2: "%other", - +$refType: TypenameAliases$ref, |}; export type TypenameAliases$data = TypenameAliases; export type TypenameAliases$key = { @@ -144,11 +135,6 @@ export type TypenameInside = {| +__typename: "Page", +username: ?string, +$refType: TypenameInside$ref, -|} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +__typename: "%other", - +$refType: TypenameInside$ref, |}; export type TypenameInside$data = TypenameInside; export type TypenameInside$key = { @@ -168,11 +154,6 @@ export type TypenameOutside = {| +__typename: "Page", +username: ?string, +$refType: TypenameOutside$ref, -|} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +__typename: "%other", - +$refType: TypenameOutside$ref, |}; export type TypenameOutside$data = TypenameOutside; export type TypenameOutside$key = { @@ -198,9 +179,7 @@ export type TypenameOutsideWithAbstractType = {| |}, +$refType: TypenameOutsideWithAbstractType$ref, |} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +__typename: "%other", + +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story", +username?: ?string, +address?: ?{| +city: ?string, @@ -228,12 +207,6 @@ export type TypenameWithCommonSelections = {| +username: ?string, +name: ?string, +$refType: TypenameWithCommonSelections$ref, -|} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +__typename: "%other", - +name: ?string, - +$refType: TypenameWithCommonSelections$ref, |}; export type TypenameWithCommonSelections$data = TypenameWithCommonSelections; export type TypenameWithCommonSelections$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.graphql b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.graphql index 3c09d095aa67d..964760a972f0b 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.graphql +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.graphql @@ -1,3 +1,7 @@ +{ + "futureProofAbstractTypes": false +} +%%% fragment TypenameInside on Actor { ... on User { __typename diff --git a/compiler/crates/relay-typegen/tests/generate_flow/mod.rs b/compiler/crates/relay-typegen/tests/generate_flow/mod.rs index edbef55f5b979..49e571e0ed78c 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/mod.rs +++ b/compiler/crates/relay-typegen/tests/generate_flow/mod.rs @@ -24,6 +24,12 @@ pub fn transform_fixture(fixture: &Fixture<'_>) -> Result { [source] => (source, get_test_schema()), _ => panic!(), }; + let parts = source.split("%%%").collect::>(); + let (typegen_input, source) = match parts.as_slice() { + [typegen_input, source] => (Some(typegen_input), source), + [source] => (None, source), + _ => panic!(), + }; let source_location = SourceLocationKey::standalone(fixture.file_name); @@ -45,11 +51,18 @@ pub fn transform_fixture(fixture: &Fixture<'_>) -> Result { ) .unwrap(); - let typegen_config = TypegenConfig { - language: TypegenLanguage::Flow, - haste: true, - ..Default::default() - }; + let typegen_config = typegen_input + .and_then(|str| serde_json::from_str(str).unwrap()) + .map(|config| TypegenConfig { + language: TypegenLanguage::Flow, + haste: true, + ..config + }) + .unwrap_or_else(|| TypegenConfig { + language: TypegenLanguage::Flow, + haste: true, + ..Default::default() + }); let mut operations: Vec<_> = programs.typegen.operations().collect(); operations.sort_by_key(|op| op.name.item); diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected index e5f57f07824df..980005b4e345f 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected @@ -1,4 +1,8 @@ ==================================== INPUT ==================================== +{ + "futureProofEnums": false +} +%%% mutation CommentCreateMutation( $input: CommentCreateInput! $first: Int @@ -27,7 +31,7 @@ fragment FriendFragment on User { } } ==================================== OUTPUT =================================== -export type TestEnums = "mark" | "zuck" | "%future added value"; +export type TestEnums = "mark" | "zuck"; export type CommentCreateInput = { clientMutationId?: string | null, feedbackId?: string | null, @@ -85,7 +89,7 @@ export type CommentCreateMutation = { rawResponse: CommentCreateMutationRawResponse, }; ------------------------------------------------------------------------------- -export type TestEnums = "mark" | "zuck" | "%future added value"; +export type TestEnums = "mark" | "zuck"; import { FragmentRefs } from "relay-runtime"; export type FriendFragment = { readonly name: string | null, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.graphql b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.graphql index c611ff829c485..3d338dfdb3e82 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.graphql +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.graphql @@ -1,3 +1,7 @@ +{ + "futureProofEnums": false +} +%%% mutation CommentCreateMutation( $input: CommentCreateInput! $first: Int diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected index 85356a4236135..b720f1306d305 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected @@ -1,4 +1,8 @@ ==================================== INPUT ==================================== +{ + "futureProofAbstractTypes": false +} +%%% query RelayClientIDFieldQuery($id: ID!) { __id # ok on query type me { @@ -48,16 +52,12 @@ export type RelayClientIDFieldQueryResponse = { readonly text: string | null, } | null, } | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly __typename: "%other" + readonly __typename: "MarkdownCommentBody" }) & { readonly __id: string } | null, } | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly __typename: "%other" + readonly __typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "User" }) & { readonly __id: string, readonly id: string, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.graphql b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.graphql index 819f708b8bb40..59cfcd8c3b1e2 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.graphql +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.graphql @@ -1,3 +1,7 @@ +{ + "futureProofAbstractTypes": false +} +%%% query RelayClientIDFieldQuery($id: ID!) { __id # ok on query type me { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected index 732e75ee03ffc..729e186671b37 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected @@ -1,4 +1,8 @@ ==================================== INPUT ==================================== +{ + "futureProofAbstractTypes": false +} +%%% fragment Foo on Node { __typename ... on User { @@ -13,9 +17,7 @@ export type Foo = ({ readonly __typename: "User", readonly name: string, } | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly __typename: "%other" + readonly __typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" }) & { readonly " $refType": FragmentRefs<"Foo"> } | null; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.graphql b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.graphql index 01304b96f8eff..4cceb5981de5e 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.graphql +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.graphql @@ -1,3 +1,7 @@ +{ + "futureProofAbstractTypes": false +} +%%% fragment Foo on Node { __typename ... on User { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected index b23b46bf9a903..3fab86f6cbbcf 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected @@ -1,4 +1,8 @@ ==================================== INPUT ==================================== +{ + "futureProofAbstractTypes": false +} +%%% fragment TypenameInside on Actor { ... on User { __typename @@ -87,10 +91,6 @@ export type TypenameAlias = ({ } | { readonly _typeAlias: "Page", readonly username: string | null, -} | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly _typeAlias: "%other" }) & { readonly " $refType": FragmentRefs<"TypenameAlias"> }; @@ -109,13 +109,6 @@ export type TypenameAliases = ({ readonly _typeAlias1: "Page", readonly _typeAlias2: "Page", readonly username: string | null, -} | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly _typeAlias1: "%other", - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly _typeAlias2: "%other", }) & { readonly " $refType": FragmentRefs<"TypenameAliases"> }; @@ -132,10 +125,6 @@ export type TypenameInside = ({ } | { readonly __typename: "Page", readonly username: string | null, -} | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly __typename: "%other" }) & { readonly " $refType": FragmentRefs<"TypenameInside"> }; @@ -152,10 +141,6 @@ export type TypenameOutside = ({ } | { readonly __typename: "Page", readonly username: string | null, -} | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly __typename: "%other" }) & { readonly " $refType": FragmentRefs<"TypenameOutside"> }; @@ -174,9 +159,7 @@ export type TypenameOutsideWithAbstractType = ({ readonly city: string | null, } | null, } | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly __typename: "%other" + readonly __typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story" }) & { readonly username?: string | null, readonly address?: { @@ -198,10 +181,6 @@ export type TypenameWithCommonSelections = ({ } | { readonly __typename: "Page", readonly username: string | null, -} | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly __typename: "%other" }) & { readonly name: string | null, readonly " $refType": FragmentRefs<"TypenameWithCommonSelections">, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.graphql b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.graphql index 3c09d095aa67d..964760a972f0b 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.graphql +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.graphql @@ -1,3 +1,7 @@ +{ + "futureProofAbstractTypes": false +} +%%% fragment TypenameInside on Actor { ... on User { __typename diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/mod.rs b/compiler/crates/relay-typegen/tests/generate_typescript/mod.rs index 8bf1af96878d2..ad576ad3895be 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/mod.rs +++ b/compiler/crates/relay-typegen/tests/generate_typescript/mod.rs @@ -24,6 +24,12 @@ pub fn transform_fixture(fixture: &Fixture<'_>) -> Result { [source] => (source, get_test_schema()), _ => panic!(), }; + let parts = source.split("%%%").collect::>(); + let (typegen_input, source) = match parts.as_slice() { + [typegen_input, source] => (Some(typegen_input), source), + [source] => (None, source), + _ => panic!(), + }; let source_location = SourceLocationKey::standalone(fixture.file_name); @@ -45,11 +51,18 @@ pub fn transform_fixture(fixture: &Fixture<'_>) -> Result { ) .unwrap(); - let typegen_config = TypegenConfig { - language: TypegenLanguage::TypeScript, - haste: true, - ..Default::default() - }; + let typegen_config = typegen_input + .and_then(|str| serde_json::from_str(str).unwrap()) + .map(|config| TypegenConfig { + language: TypegenLanguage::TypeScript, + haste: true, + ..config + }) + .unwrap_or_else(|| TypegenConfig { + language: TypegenLanguage::TypeScript, + haste: true, + ..Default::default() + }); let mut operations: Vec<_> = programs.typegen.operations().collect(); operations.sort_by_key(|op| op.name.item); From ba2d3757d04cc11fdf58aca8e82bd2348ce94796 Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Sun, 27 Dec 2020 18:47:50 +0100 Subject: [PATCH 25/41] Remove outdated #[allow] attribute. --- compiler/crates/relay-typegen/src/writer.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/compiler/crates/relay-typegen/src/writer.rs b/compiler/crates/relay-typegen/src/writer.rs index b87a38e9d4f52..11c5a3b0e4710 100644 --- a/compiler/crates/relay-typegen/src/writer.rs +++ b/compiler/crates/relay-typegen/src/writer.rs @@ -12,7 +12,6 @@ use std::fmt::{Result, Write}; #[derive(Debug, Clone)] pub enum AST { Union(Vec), - #[allow(dead_code)] Intersection(Vec), ReadOnlyArray(Box), Nullable(Box), From 09ca96b8e8baf39eb8163928639a72e2cf71f773 Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Sun, 27 Dec 2020 19:03:16 +0100 Subject: [PATCH 26/41] Revert "remove unused intersection variant" This reverts commit c48e7d2393b2bdbfcac0ea3d786e4f024fd28155. --- compiler/crates/relay-typegen/src/flow.rs | 1 + .../crates/relay-typegen/src/typescript.rs | 87 +++++++++++++++++++ 2 files changed, 88 insertions(+) diff --git a/compiler/crates/relay-typegen/src/flow.rs b/compiler/crates/relay-typegen/src/flow.rs index dd972ff8e06dd..1f0f1c17c2bd9 100644 --- a/compiler/crates/relay-typegen/src/flow.rs +++ b/compiler/crates/relay-typegen/src/flow.rs @@ -25,6 +25,7 @@ impl Writer for FlowPrinter { AST::Identifier(identifier) => write!(writer, "{}", identifier), AST::RawType(raw) => write!(writer, "{}", raw), AST::Union(members) => self.write_union(writer, members), + AST::Intersection(members) => self.write_intersection(writer, members), AST::ReadOnlyArray(of_type) => self.write_read_only_array(writer, of_type), AST::Nullable(of_type) => self.write_nullable(writer, of_type), AST::ExactObject(props) => self.write_object(writer, props, true), diff --git a/compiler/crates/relay-typegen/src/typescript.rs b/compiler/crates/relay-typegen/src/typescript.rs index 27056039e0341..1900757f0f1c8 100644 --- a/compiler/crates/relay-typegen/src/typescript.rs +++ b/compiler/crates/relay-typegen/src/typescript.rs @@ -36,6 +36,7 @@ impl Writer for TypeScriptPrinter { AST::Identifier(identifier) => write!(writer, "{}", identifier), AST::RawType(raw) => write!(writer, "{}", raw), AST::Union(members) => self.write_union(writer, members), + AST::Intersection(members) => self.write_intersection(writer, members), AST::ReadOnlyArray(of_type) => self.write_read_only_array(writer, of_type), AST::Nullable(of_type) => self.write_nullable(writer, of_type), AST::ExactObject(props) => self.write_object(writer, props, true), @@ -78,6 +79,21 @@ impl TypeScriptPrinter { write!(writer, r#""%other""#) } + fn write_and_wrap_union(&mut self, writer: &mut dyn Write, ast: &AST) -> Result { + match ast { + AST::Union(members) if members.len() > 1 => { + write!(writer, "(")?; + self.write_union(writer, members)?; + write!(writer, ")")?; + } + _ => { + self.write(writer, ast)?; + } + } + + Ok(()) + } + fn write_union(&mut self, writer: &mut dyn Write, members: &[AST]) -> Result { let mut first = true; for member in members { @@ -91,6 +107,20 @@ impl TypeScriptPrinter { Ok(()) } + fn write_intersection(&mut self, writer: &mut dyn Write, members: &[AST]) -> Result { + let mut first = true; + for member in members { + if first { + first = false; + } else { + write!(writer, " & ")?; + } + + self.write_and_wrap_union(writer, member)?; + } + Ok(()) + } + fn write_read_only_array(&mut self, writer: &mut dyn Write, of_type: &AST) -> Result { write!(writer, "ReadonlyArray<")?; self.write(writer, of_type)?; @@ -308,6 +338,63 @@ mod tests { ) } + #[test] + fn intersections() { + assert_eq!( + print_type(&AST::Intersection(vec![ + AST::ExactObject(vec![Prop { + key: "first".intern(), + optional: false, + read_only: false, + value: AST::String + }]), + AST::ExactObject(vec![Prop { + key: "second".intern(), + optional: false, + read_only: false, + value: AST::Number + }]), + ])), + r"{ + first: string +} & { + second: number +}" + ); + + assert_eq!( + print_type(&AST::Intersection(vec![ + AST::Union(vec![ + AST::ExactObject(vec![Prop { + key: "first".intern(), + optional: false, + read_only: false, + value: AST::String + }]), + AST::ExactObject(vec![Prop { + key: "second".intern(), + optional: false, + read_only: false, + value: AST::Number + }]), + ]), + AST::ExactObject(vec![Prop { + key: "third".intern(), + optional: false, + read_only: false, + value: AST::Number + }]), + ],)), + r"({ + first: string +} | { + second: number +}) & { + third: number +}" + ); + } + #[test] fn exact_object() { assert_eq!(print_type(&AST::ExactObject(Vec::new())), r"{}".to_string()); From 5ebfe4d6275537f2d7b064d6b10f6e63c6594283 Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Tue, 19 Oct 2021 15:04:07 +0200 Subject: [PATCH 27/41] Update usage after merge of master. --- compiler/Cargo.lock | 8 ++++-- compiler/crates/relay-typegen/Cargo.toml | 1 + compiler/crates/relay-typegen/src/lib.rs | 29 +++++++++++--------- compiler/crates/schema/src/graphql_schema.rs | 20 ++++++++++++++ 4 files changed, 43 insertions(+), 15 deletions(-) diff --git a/compiler/Cargo.lock b/compiler/Cargo.lock index 91e7c2ea96ee5..0c08760b815aa 100644 --- a/compiler/Cargo.lock +++ b/compiler/Cargo.lock @@ -1,5 +1,7 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] name = "Inflector" version = "0.11.4" @@ -1838,6 +1840,7 @@ dependencies = [ "common", "crossbeam", "extract-graphql", + "fnv", "graphql-ir", "graphql-syntax", "graphql-text-printer", @@ -1900,6 +1903,7 @@ dependencies = [ "relay-test-schema", "schema", "serde", + "thiserror", ] [[package]] @@ -2136,9 +2140,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.62" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea1c6153794552ea7cf7cf63b1231a25de00ec90db326ba6264440fa08e31486" +checksum = "0f690853975602e1bfe1ccbf50504d67174e3bcf340f23b5ea9992e0587a52d8" dependencies = [ "itoa", "ryu", diff --git a/compiler/crates/relay-typegen/Cargo.toml b/compiler/crates/relay-typegen/Cargo.toml index a44da75c90fd0..aa2800d66b324 100644 --- a/compiler/crates/relay-typegen/Cargo.toml +++ b/compiler/crates/relay-typegen/Cargo.toml @@ -28,6 +28,7 @@ lazy_static = "1.0" relay-transforms = { path = "../relay-transforms" } schema = { path = "../schema" } serde = { version = "=1.0.118", features = ["derive", "rc"] } +serde_json = "1.0.68" [dev-dependencies] fixture-tests = { path = "../fixture-tests" } diff --git a/compiler/crates/relay-typegen/src/lib.rs b/compiler/crates/relay-typegen/src/lib.rs index bee4e12cc66e3..af2deac68687d 100644 --- a/compiler/crates/relay-typegen/src/lib.rs +++ b/compiler/crates/relay-typegen/src/lib.rs @@ -160,8 +160,12 @@ impl<'a> TypeGenerator<'a> { let input_variables_type = self.generate_input_variables_type(typegen_operation); let selections = self.visit_selections(&typegen_operation.selections); - let mut response_type = - self.selections_to_ast(Some(typegen_operation.type_), selections, false, None); + let mut response_type = self.selections_to_ast( + Some(typegen_operation.type_), + selections.into_iter(), + false, + None, + ); response_type = match typegen_operation .directives @@ -174,7 +178,7 @@ impl<'a> TypeGenerator<'a> { let raw_response_type = if has_raw_response_type_directive(normalization_operation) { let raw_response_selections = self.raw_response_visit_selections(&normalization_operation.selections); - Some(self.raw_response_selections_to_ast(raw_response_selections, None)) + Some(self.raw_response_selections_to_ast(raw_response_selections.into_iter(), None)) } else { None }; @@ -254,7 +258,7 @@ impl<'a> TypeGenerator<'a> { let raw_response_selections = self.raw_response_visit_selections(&normalization_operation.selections); let raw_response_type = - self.raw_response_selections_to_babel(raw_response_selections.into_iter(), None); + self.raw_response_selections_to_ast(raw_response_selections.into_iter(), None); self.write_runtime_imports()?; self.write_fragment_imports()?; @@ -316,7 +320,7 @@ impl<'a> TypeGenerator<'a> { let base_type = self.selections_to_ast( Some(node.type_condition), - selections, + selections.into_iter(), unmasked, if unmasked { None @@ -735,8 +739,7 @@ impl<'a> TypeGenerator<'a> { v.is_typename() && !selection_names.contains(&v.schema_name) }) .cloned() - .chain(selections.clone().into_iter()) - .collect(), + .chain(selections.clone().into_iter()), ) .into_iter() .map(|selection| { @@ -813,13 +816,14 @@ impl<'a> TypeGenerator<'a> { } } - let mut selection_map = selections_to_map(hashmap_into_value_vec(base_fields), false); + let mut selection_map = selections_to_map(hashmap_into_values(base_fields), false); if !type_fields_present_for_union { for concrete_type_selections in by_concrete_type.values() { selection_map = merge_selections( selection_map, selections_to_map( - concrete_type_selections.into_iter().map(|mut sel| { + concrete_type_selections.into_iter().map(|sel| { + let mut sel = sel.clone(); sel.conditional = true; sel }), @@ -835,8 +839,7 @@ impl<'a> TypeGenerator<'a> { .values() .chain(selection_map.values()) .filter(|selection| !type_fields_present_for_union || !selection.is_typename()) - .cloned() - .collect(), + .cloned(), ) .into_iter() .map(|selection| { @@ -1011,7 +1014,7 @@ impl<'a> TypeGenerator<'a> { let value = if let Some(node_type) = node_type { let object_props = self.selections_to_ast( Some(node_type.inner()), - hashmap_into_value_vec(node_selections.unwrap()), + hashmap_into_values(node_selections.unwrap()).into_iter(), unmasked, None, ); @@ -1077,7 +1080,7 @@ impl<'a> TypeGenerator<'a> { Some(node_type.inner()) }; let object_props = self.raw_response_selections_to_ast( - hashmap_into_value_vec(node_selections.unwrap()), + hashmap_into_values(node_selections.unwrap()), inner_concrete_type, ); self.transform_scalar_type(&node_type, Some(object_props)) diff --git a/compiler/crates/schema/src/graphql_schema.rs b/compiler/crates/schema/src/graphql_schema.rs index fc2856f86e047..60ad54008e365 100644 --- a/compiler/crates/schema/src/graphql_schema.rs +++ b/compiler/crates/schema/src/graphql_schema.rs @@ -24,6 +24,26 @@ pub trait Schema { fn get_type(&self, type_name: StringKey) -> Option; + fn get_possible_types(&self, type_: Type) -> Option> { + match type_ { + Type::Union(union) => Some( + self.union(union) + .members + .iter() + .map(|id| self.object(*id)) + .collect(), + ), + Type::Interface(interface) => Some( + self.interface(interface) + .implementing_objects + .iter() + .map(|id| self.object(*id)) + .collect(), + ), + _ => None, + } + } + fn get_directive(&self, name: StringKey) -> Option<&Directive>; fn input_object(&self, id: InputObjectID) -> &InputObject; From 853ac17cbc9aad03eedebfd65f6a998e627b4df3 Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Tue, 19 Oct 2021 16:11:24 +0200 Subject: [PATCH 28/41] Fix unused enum variant: FragmentReferenceType. --- compiler/crates/relay-typegen/src/lib.rs | 11 +++++--- .../fixtures/conditional.expected | 4 +-- .../fixtures/fragment-spread.expected | 14 +++++----- .../fixtures/inline-fragment.expected | 10 +++---- .../fixtures/linked-field.expected | 2 +- .../fixtures/match-field-in-query.expected | 4 +-- .../fixtures/match-field.expected | 6 ++-- .../mutation-with-enums-on-fragment.expected | 2 +- .../mutation-with-nested-fragments.expected | 4 +-- ...with-response-on-inline-fragments.expected | 2 +- .../fixtures/plural-fragment.expected | 2 +- .../fixtures/query-with-match-fields.expected | 6 ++-- .../fixtures/query-with-module-field.expected | 4 +-- .../query-with-multiple-match-fields.expected | 8 +++--- ...-with-raw-response-on-conditional.expected | 2 +- ...w-response-on-literal-conditional.expected | 2 +- .../fixtures/recursive-fragments.expected | 2 +- .../fixtures/refetchable-fragment.expected | 2 +- .../fixtures/refetchable.expected | 2 +- ...ough-inline-fragments-to-fragment.expected | 4 +-- .../required-bubbles-to-fragment.expected | 2 +- ...d-bubbles-to-item-in-plural-field.expected | 2 +- ...solates-concrete-inline-fragments.expected | 8 +++--- ...-throw-doesnt-bubbles-to-fragment.expected | 2 +- .../fixtures/roots.expected | 2 +- .../fixtures/scalar-field.expected | 2 +- .../fixtures/simple.expected | 2 +- ...me-inside-with-overlapping-fields.expected | 2 +- .../fixtures/typename-on-union.expected | 28 +++++++++---------- .../unmasked-fragment-spreads.expected | 6 ++-- 30 files changed, 76 insertions(+), 73 deletions(-) diff --git a/compiler/crates/relay-typegen/src/lib.rs b/compiler/crates/relay-typegen/src/lib.rs index f5d823ea1f039..17a89c50315cd 100644 --- a/compiler/crates/relay-typegen/src/lib.rs +++ b/compiler/crates/relay-typegen/src/lib.rs @@ -161,7 +161,6 @@ impl<'a> TypeGenerator<'a> { self.writer.into_string() } - fn generate_operation_type( &mut self, typegen_operation: &OperationDefinition, @@ -409,7 +408,6 @@ impl<'a> TypeGenerator<'a> { } } - self.writer.write_export_type(data_type, &type_)?; self.writer .write_export_type(data_type_name, &AST::RawType(data_type))?; @@ -599,7 +597,12 @@ impl<'a> TypeGenerator<'a> { schema_name: Some(schema_name), node_type: None, value: Some(AST::Nullable(Box::new(AST::ActorChangePoint(Box::new( - self.selections_to_ast(Some(field.type_.inner()), linked_field_selections.into_iter(), false, None), + self.selections_to_ast( + Some(field.type_.inner()), + linked_field_selections.into_iter(), + false, + None, + ), ))))), conditional: false, concrete_type: None, @@ -964,7 +967,7 @@ impl<'a> TypeGenerator<'a> { key: *KEY_REF_TYPE, optional: false, read_only: true, - value: AST::FragmentReference(vec![fragment_type_name]), + value: AST::FragmentReferenceType(fragment_type_name), }); } diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/conditional.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/conditional.expected index e5d9697f268ba..7050155d70cb1 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/conditional.expected @@ -12,7 +12,7 @@ fragment NestedCondition on Node { import { FragmentRefs } from "relay-runtime"; export type ConditionField = { readonly id?: string; - readonly " $refType": FragmentRefs<"ConditionField">; + readonly " $refType": "ConditionField"; }; export type ConditionField$data = ConditionField; export type ConditionField$key = { @@ -23,7 +23,7 @@ export type ConditionField$key = { import { FragmentRefs } from "relay-runtime"; export type NestedCondition = { readonly id?: string; - readonly " $refType": FragmentRefs<"NestedCondition">; + readonly " $refType": "NestedCondition"; }; export type NestedCondition$data = NestedCondition; export type NestedCondition$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected index e0befd1ab0f8c..65424f560b55d 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected @@ -62,7 +62,7 @@ export type ConcreateTypes = { // value in case none of the concrete values match. readonly __typename: "%other"; } | null; - readonly " $refType": FragmentRefs<"ConcreateTypes">; + readonly " $refType": "ConcreateTypes"; }; export type ConcreateTypes$data = ConcreateTypes; export type ConcreateTypes$key = { @@ -81,7 +81,7 @@ export type FragmentSpread = { readonly " $fragmentRefs": FragmentRefs<"PictureFragment">; } | null; readonly " $fragmentRefs": FragmentRefs<"OtherFragment" | "UserFrag1" | "UserFrag2">; - readonly " $refType": FragmentRefs<"FragmentSpread">; + readonly " $refType": "FragmentSpread"; }; export type FragmentSpread$data = FragmentSpread; export type FragmentSpread$key = { @@ -92,7 +92,7 @@ export type FragmentSpread$key = { import { FragmentRefs } from "relay-runtime"; export type OtherFragment = { readonly __typename: string; - readonly " $refType": FragmentRefs<"OtherFragment">; + readonly " $refType": "OtherFragment"; }; export type OtherFragment$data = OtherFragment; export type OtherFragment$key = { @@ -103,7 +103,7 @@ export type OtherFragment$key = { import { FragmentRefs } from "relay-runtime"; export type PageFragment = { readonly __typename: "Page"; - readonly " $refType": FragmentRefs<"PageFragment">; + readonly " $refType": "PageFragment"; }; export type PageFragment$data = PageFragment; export type PageFragment$key = { @@ -114,7 +114,7 @@ export type PageFragment$key = { import { FragmentRefs } from "relay-runtime"; export type PictureFragment = { readonly __typename: "Image"; - readonly " $refType": FragmentRefs<"PictureFragment">; + readonly " $refType": "PictureFragment"; }; export type PictureFragment$data = PictureFragment; export type PictureFragment$key = { @@ -125,7 +125,7 @@ export type PictureFragment$key = { import { FragmentRefs } from "relay-runtime"; export type UserFrag1 = { readonly __typename: "User"; - readonly " $refType": FragmentRefs<"UserFrag1">; + readonly " $refType": "UserFrag1"; }; export type UserFrag1$data = UserFrag1; export type UserFrag1$key = { @@ -136,7 +136,7 @@ export type UserFrag1$key = { import { FragmentRefs } from "relay-runtime"; export type UserFrag2 = { readonly __typename: "User"; - readonly " $refType": FragmentRefs<"UserFrag2">; + readonly " $refType": "UserFrag2"; }; export type UserFrag2$data = UserFrag2; export type UserFrag2$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected index f6db1e9d7a3c1..10a3c89b6ae07 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected @@ -71,7 +71,7 @@ export type InlineFragment = { readonly message?: { readonly text: string | null; } | null; - readonly " $refType": FragmentRefs<"InlineFragment">; + readonly " $refType": "InlineFragment"; }; export type InlineFragment$data = InlineFragment; export type InlineFragment$key = { @@ -83,7 +83,7 @@ import { FragmentRefs } from "relay-runtime"; export type InlineFragmentConditionalID = { readonly id?: string; readonly name?: string | null; - readonly " $refType": FragmentRefs<"InlineFragmentConditionalID">; + readonly " $refType": "InlineFragmentConditionalID"; }; export type InlineFragmentConditionalID$data = InlineFragmentConditionalID; export type InlineFragmentConditionalID$key = { @@ -103,7 +103,7 @@ export type InlineFragmentKitchenSink = { readonly name?: string | null; readonly " $fragmentRefs": FragmentRefs<"SomeFragment">; } | null; - readonly " $refType": FragmentRefs<"InlineFragmentKitchenSink">; + readonly " $refType": "InlineFragmentKitchenSink"; }; export type InlineFragmentKitchenSink$data = InlineFragmentKitchenSink; export type InlineFragmentKitchenSink$key = { @@ -121,7 +121,7 @@ export type InlineFragmentWithOverlappingFields = { } | null; } | null; readonly name?: string | null; - readonly " $refType": FragmentRefs<"InlineFragmentWithOverlappingFields">; + readonly " $refType": "InlineFragmentWithOverlappingFields"; }; export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; export type InlineFragmentWithOverlappingFields$key = { @@ -132,7 +132,7 @@ export type InlineFragmentWithOverlappingFields$key = { import { FragmentRefs } from "relay-runtime"; export type SomeFragment = { readonly __typename: "User"; - readonly " $refType": FragmentRefs<"SomeFragment">; + readonly " $refType": "SomeFragment"; }; export type SomeFragment$data = SomeFragment; export type SomeFragment$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected index 8c15e81582bc7..62f4e5098d222 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected @@ -59,7 +59,7 @@ export type LinkedField = { readonly actor: { readonly id: string; } | null; - readonly " $refType": FragmentRefs<"LinkedField">; + readonly " $refType": "LinkedField"; }; export type LinkedField$data = LinkedField; export type LinkedField$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected index b196ba9a3b86a..3a5f7703212a6 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected @@ -45,7 +45,7 @@ export type MarkdownUserNameRenderer_name = { readonly data: { readonly markup: string | null; } | null; - readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">; + readonly " $refType": "MarkdownUserNameRenderer_name"; }; export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; export type MarkdownUserNameRenderer_name$key = { @@ -59,7 +59,7 @@ export type PlainUserNameRenderer_name = { readonly data: { readonly text: string | null; } | null; - readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">; + readonly " $refType": "PlainUserNameRenderer_name"; }; export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; export type PlainUserNameRenderer_name$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected index 08204425e1af7..17e9a63a5c603 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected @@ -28,7 +28,7 @@ export type MarkdownUserNameRenderer_name = { readonly data: { readonly markup: string | null; } | null; - readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">; + readonly " $refType": "MarkdownUserNameRenderer_name"; }; export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; export type MarkdownUserNameRenderer_name$key = { @@ -44,7 +44,7 @@ export type NameRendererFragment = { readonly __module_component?: string | null; readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">; } | null; - readonly " $refType": FragmentRefs<"NameRendererFragment">; + readonly " $refType": "NameRendererFragment"; }; export type NameRendererFragment$data = NameRendererFragment; export type NameRendererFragment$key = { @@ -58,7 +58,7 @@ export type PlainUserNameRenderer_name = { readonly data: { readonly text: string | null; } | null; - readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">; + readonly " $refType": "PlainUserNameRenderer_name"; }; export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; export type PlainUserNameRenderer_name$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected index 4e6b485933124..f3f73316808e3 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected @@ -98,7 +98,7 @@ export type FriendFragment = { readonly profilePicture2: { readonly test_enums: TestEnums | null; } | null; - readonly " $refType": FragmentRefs<"FriendFragment">; + readonly " $refType": "FriendFragment"; }; export type FriendFragment$data = FriendFragment; export type FriendFragment$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected index 0c6887a45ba23..5176c76112733 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected @@ -92,7 +92,7 @@ import { FragmentRefs } from "relay-runtime"; export type FeedbackFragment = { readonly id: string; readonly name: string | null; - readonly " $refType": FragmentRefs<"FeedbackFragment">; + readonly " $refType": "FeedbackFragment"; }; export type FeedbackFragment$data = FeedbackFragment; export type FeedbackFragment$key = { @@ -107,7 +107,7 @@ export type FriendFragment = { readonly feedback: { readonly " $fragmentRefs": FragmentRefs<"FeedbackFragment">; } | null; - readonly " $refType": FragmentRefs<"FriendFragment">; + readonly " $refType": "FriendFragment"; }; export type FriendFragment$data = FriendFragment; export type FriendFragment$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected index 7b23b64dbcf7b..87e12bbdae565 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected @@ -97,7 +97,7 @@ export type InlineFragmentWithOverlappingFields = { } | null; } | null; readonly name?: string | null; - readonly " $refType": FragmentRefs<"InlineFragmentWithOverlappingFields">; + readonly " $refType": "InlineFragmentWithOverlappingFields"; }; export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; export type InlineFragmentWithOverlappingFields$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/plural-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/plural-fragment.expected index 5fa7e347e019a..47c10a9357702 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/plural-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/plural-fragment.expected @@ -6,7 +6,7 @@ fragment PluralFragment on Node @relay(plural: true) { import { FragmentRefs } from "relay-runtime"; export type PluralFragment = ReadonlyArray<{ readonly id: string; - readonly " $refType": FragmentRefs<"PluralFragment">; + readonly " $refType": "PluralFragment"; }>; export type PluralFragment$data = PluralFragment; export type PluralFragment$key = ReadonlyArray<{ diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected index 29192b9954289..eb18188e7b246 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected @@ -85,7 +85,7 @@ export type MarkdownUserNameRenderer_name = { readonly data: { readonly markup: string | null; } | null; - readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">; + readonly " $refType": "MarkdownUserNameRenderer_name"; }; export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; export type MarkdownUserNameRenderer_name$key = { @@ -101,7 +101,7 @@ export type NameRendererFragment = { readonly __module_component?: string | null; readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">; } | null; - readonly " $refType": FragmentRefs<"NameRendererFragment">; + readonly " $refType": "NameRendererFragment"; }; export type NameRendererFragment$data = NameRendererFragment; export type NameRendererFragment$key = { @@ -115,7 +115,7 @@ export type PlainUserNameRenderer_name = { readonly data: { readonly text: string | null; } | null; - readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">; + readonly " $refType": "PlainUserNameRenderer_name"; }; export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; export type PlainUserNameRenderer_name$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected index 772645ee1ce2c..bfc7208f2e340 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected @@ -56,7 +56,7 @@ export type Test_user = { readonly __module_component: string | null; readonly " $fragmentRefs": FragmentRefs<"Test_userRenderer">; } | null; - readonly " $refType": FragmentRefs<"Test_user">; + readonly " $refType": "Test_user"; }; export type Test_user$data = Test_user; export type Test_user$key = { @@ -69,7 +69,7 @@ export type Test_userRenderer = { readonly user: { readonly username: string | null; } | null; - readonly " $refType": FragmentRefs<"Test_userRenderer">; + readonly " $refType": "Test_userRenderer"; }; export type Test_userRenderer$data = Test_userRenderer; export type Test_userRenderer$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected index 3c9994c09d3b1..ed5263be45c84 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected @@ -140,7 +140,7 @@ export type AnotherNameRendererFragment = { readonly __module_component?: string | null; readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">; } | null; - readonly " $refType": FragmentRefs<"AnotherNameRendererFragment">; + readonly " $refType": "AnotherNameRendererFragment"; }; export type AnotherNameRendererFragment$data = AnotherNameRendererFragment; export type AnotherNameRendererFragment$key = { @@ -154,7 +154,7 @@ export type MarkdownUserNameRenderer_name = { readonly data: { readonly markup: string | null; } | null; - readonly " $refType": FragmentRefs<"MarkdownUserNameRenderer_name">; + readonly " $refType": "MarkdownUserNameRenderer_name"; }; export type MarkdownUserNameRenderer_name$data = MarkdownUserNameRenderer_name; export type MarkdownUserNameRenderer_name$key = { @@ -170,7 +170,7 @@ export type NameRendererFragment = { readonly __module_component?: string | null; readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">; } | null; - readonly " $refType": FragmentRefs<"NameRendererFragment">; + readonly " $refType": "NameRendererFragment"; }; export type NameRendererFragment$data = NameRendererFragment; export type NameRendererFragment$key = { @@ -184,7 +184,7 @@ export type PlainUserNameRenderer_name = { readonly data: { readonly text: string | null; } | null; - readonly " $refType": FragmentRefs<"PlainUserNameRenderer_name">; + readonly " $refType": "PlainUserNameRenderer_name"; }; export type PlainUserNameRenderer_name$data = PlainUserNameRenderer_name; export type PlainUserNameRenderer_name$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected index 6764730d695a1..327cc975f7e61 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected @@ -55,7 +55,7 @@ export type FriendFragment = { readonly id: string; readonly name: string | null; } | null; - readonly " $refType": FragmentRefs<"FriendFragment">; + readonly " $refType": "FriendFragment"; }; export type FriendFragment$data = FriendFragment; export type FriendFragment$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected index 40c9f527f04c3..6161a9f2511e6 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected @@ -56,7 +56,7 @@ export type FriendFragment = { readonly id: string; readonly name: string | null; } | null; - readonly " $refType": FragmentRefs<"FriendFragment">; + readonly " $refType": "FriendFragment"; }; export type FriendFragment$data = FriendFragment; export type FriendFragment$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/recursive-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/recursive-fragments.expected index d95224082c2e8..67336599d2a26 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/recursive-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/recursive-fragments.expected @@ -10,7 +10,7 @@ import { FragmentRefs } from "relay-runtime"; export type FragmentSpread = { readonly id: string; readonly " $fragmentRefs": FragmentRefs<"FragmentSpread">; - readonly " $refType": FragmentRefs<"FragmentSpread">; + readonly " $refType": "FragmentSpread"; }; export type FragmentSpread$data = FragmentSpread; export type FragmentSpread$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected index afe8a3f82b1df..6289041c0516e 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected @@ -27,7 +27,7 @@ export type RefetchableFragment = { readonly fragAndField: { readonly uri: string | null; } | null; - readonly " $refType": FragmentRefs<"RefetchableFragment">; + readonly " $refType": "RefetchableFragment"; }; export type RefetchableFragment$data = RefetchableFragment; export type RefetchableFragment$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected index 09f5d8c29a34c..5712e1b9b030b 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected @@ -25,7 +25,7 @@ import { FragmentRefs } from "relay-runtime"; export type FlowRefetchableFragment = { readonly id: string; readonly name?: string | null; - readonly " $refType": FragmentRefs<"FlowRefetchableFragment">; + readonly " $refType": "FlowRefetchableFragment"; }; export type FlowRefetchableFragment$data = FlowRefetchableFragment; export type FlowRefetchableFragment$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected index 6c7cac26c6968..3343d0dd72041 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected @@ -16,10 +16,10 @@ import { FragmentRefs } from "relay-runtime"; export type Foo = { readonly __typename: "User"; readonly name: string; - readonly " $refType": FragmentRefs<"Foo">; + readonly " $refType": "Foo"; } | { readonly __typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story"; - readonly " $refType": FragmentRefs<"Foo">; + readonly " $refType": "Foo"; } | null; export type Foo$data = Foo; export type Foo$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-fragment.expected index 602fbeef02855..39e56c341fc80 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-fragment.expected @@ -8,7 +8,7 @@ import { FragmentRefs } from "relay-runtime"; export type NonNullFragment = { readonly firstName: string | null; readonly lastName: string; - readonly " $refType": FragmentRefs<"NonNullFragment">; + readonly " $refType": "NonNullFragment"; } | null; export type NonNullFragment$data = NonNullFragment; export type NonNullFragment$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected index 572694715ef61..5759b89c25b46 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected @@ -14,7 +14,7 @@ export type NonNullFragment = { readonly name: string | null; readonly service: string; } | null> | null; - readonly " $refType": FragmentRefs<"NonNullFragment">; + readonly " $refType": "NonNullFragment"; }; export type NonNullFragment$data = NonNullFragment; export type NonNullFragment$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected index 9559cb48a2f05..3c7d4cba40bef 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected @@ -34,7 +34,7 @@ export type Bar = { readonly body?: { readonly text: string | null; } | null; - readonly " $refType": FragmentRefs<"Bar">; + readonly " $refType": "Bar"; } | null; export type Bar$data = Bar; export type Bar$key = { @@ -46,18 +46,18 @@ import { FragmentRefs } from "relay-runtime"; export type Foo = { readonly __typename: "User"; readonly name: string; - readonly " $refType": FragmentRefs<"Foo">; + readonly " $refType": "Foo"; } | { readonly __typename: "Comment"; readonly body: { readonly text: string | null; } | null; - readonly " $refType": FragmentRefs<"Foo">; + readonly " $refType": "Foo"; } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly __typename: "%other"; - readonly " $refType": FragmentRefs<"Foo">; + readonly " $refType": "Foo"; } | null; export type Foo$data = Foo; export type Foo$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected index a756993c2cfcb..7dab412f354df 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected @@ -8,7 +8,7 @@ import { FragmentRefs } from "relay-runtime"; export type NonNullFragment = { readonly firstName: string | null; readonly lastName: string; - readonly " $refType": FragmentRefs<"NonNullFragment">; + readonly " $refType": "NonNullFragment"; }; export type NonNullFragment$data = NonNullFragment; export type NonNullFragment$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected index 9b50cf37928a5..84b0fd018d6a9 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected @@ -86,7 +86,7 @@ export type TestSubscription = { import { FragmentRefs } from "relay-runtime"; export type ExampleFragment = { readonly id: string; - readonly " $refType": FragmentRefs<"ExampleFragment">; + readonly " $refType": "ExampleFragment"; }; export type ExampleFragment$data = ExampleFragment; export type ExampleFragment$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/scalar-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/scalar-field.expected index 2d33cabea0732..ea85ade03f1d4 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/scalar-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/scalar-field.expected @@ -27,7 +27,7 @@ export type ScalarField = { readonly name: string | null; readonly service: string | null; } | null> | null; - readonly " $refType": FragmentRefs<"ScalarField">; + readonly " $refType": "ScalarField"; }; export type ScalarField$data = ScalarField; export type ScalarField$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/simple.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/simple.expected index 9ec5dbb053e18..bcd2efe53fb81 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/simple.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/simple.expected @@ -16,7 +16,7 @@ export type LinkedField = { readonly width: number | null; readonly height: number | null; } | null; - readonly " $refType": FragmentRefs<"LinkedField">; + readonly " $refType": "LinkedField"; }; export type LinkedField$data = LinkedField; export type LinkedField$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected index 3de092593dd09..6abba0e76faf8 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected @@ -34,7 +34,7 @@ export type TypenameInsideWithOverlappingFields = { // value in case none of the concrete values match. readonly __typename: "%other"; } | null; - readonly " $refType": FragmentRefs<"TypenameInsideWithOverlappingFields">; + readonly " $refType": "TypenameInsideWithOverlappingFields"; }; export type TypenameInsideWithOverlappingFields$data = TypenameInsideWithOverlappingFields; export type TypenameInsideWithOverlappingFields$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected index 5aca7d9f55166..f825fa37df839 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected @@ -88,11 +88,11 @@ import { FragmentRefs } from "relay-runtime"; export type TypenameAlias = { readonly _typeAlias: "User"; readonly firstName: string | null; - readonly " $refType": FragmentRefs<"TypenameAlias">; + readonly " $refType": "TypenameAlias"; } | { readonly _typeAlias: "Page"; readonly username: string | null; - readonly " $refType": FragmentRefs<"TypenameAlias">; + readonly " $refType": "TypenameAlias"; }; export type TypenameAlias$data = TypenameAlias; export type TypenameAlias$key = { @@ -105,12 +105,12 @@ export type TypenameAliases = { readonly _typeAlias1: "User"; readonly _typeAlias2: "User"; readonly firstName: string | null; - readonly " $refType": FragmentRefs<"TypenameAliases">; + readonly " $refType": "TypenameAliases"; } | { readonly _typeAlias1: "Page"; readonly _typeAlias2: "Page"; readonly username: string | null; - readonly " $refType": FragmentRefs<"TypenameAliases">; + readonly " $refType": "TypenameAliases"; }; export type TypenameAliases$data = TypenameAliases; export type TypenameAliases$key = { @@ -122,11 +122,11 @@ import { FragmentRefs } from "relay-runtime"; export type TypenameInside = { readonly __typename: "User"; readonly firstName: string | null; - readonly " $refType": FragmentRefs<"TypenameInside">; + readonly " $refType": "TypenameInside"; } | { readonly __typename: "Page"; readonly username: string | null; - readonly " $refType": FragmentRefs<"TypenameInside">; + readonly " $refType": "TypenameInside"; }; export type TypenameInside$data = TypenameInside; export type TypenameInside$key = { @@ -138,11 +138,11 @@ import { FragmentRefs } from "relay-runtime"; export type TypenameOutside = { readonly __typename: "User"; readonly firstName: string | null; - readonly " $refType": FragmentRefs<"TypenameOutside">; + readonly " $refType": "TypenameOutside"; } | { readonly __typename: "Page"; readonly username: string | null; - readonly " $refType": FragmentRefs<"TypenameOutside">; + readonly " $refType": "TypenameOutside"; }; export type TypenameOutside$data = TypenameOutside; export type TypenameOutside$key = { @@ -163,7 +163,7 @@ export type TypenameOutsideWithAbstractType = { readonly city: string | null; readonly country: string | null; } | null; - readonly " $refType": FragmentRefs<"TypenameOutsideWithAbstractType">; + readonly " $refType": "TypenameOutsideWithAbstractType"; } | { readonly __typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story"; readonly username?: string | null; @@ -171,7 +171,7 @@ export type TypenameOutsideWithAbstractType = { readonly city: string | null; readonly country: string | null; } | null; - readonly " $refType": FragmentRefs<"TypenameOutsideWithAbstractType">; + readonly " $refType": "TypenameOutsideWithAbstractType"; }; export type TypenameOutsideWithAbstractType$data = TypenameOutsideWithAbstractType; export type TypenameOutsideWithAbstractType$key = { @@ -184,12 +184,12 @@ export type TypenameWithCommonSelections = { readonly __typename: "User"; readonly firstName: string | null; readonly name: string | null; - readonly " $refType": FragmentRefs<"TypenameWithCommonSelections">; + readonly " $refType": "TypenameWithCommonSelections"; } | { readonly __typename: "Page"; readonly username: string | null; readonly name: string | null; - readonly " $refType": FragmentRefs<"TypenameWithCommonSelections">; + readonly " $refType": "TypenameWithCommonSelections"; }; export type TypenameWithCommonSelections$data = TypenameWithCommonSelections; export type TypenameWithCommonSelections$key = { @@ -201,7 +201,7 @@ import { FragmentRefs } from "relay-runtime"; export type TypenameWithoutSpreads = { readonly __typename: "User"; readonly firstName: string | null; - readonly " $refType": FragmentRefs<"TypenameWithoutSpreads">; + readonly " $refType": "TypenameWithoutSpreads"; }; export type TypenameWithoutSpreads$data = TypenameWithoutSpreads; export type TypenameWithoutSpreads$key = { @@ -213,7 +213,7 @@ import { FragmentRefs } from "relay-runtime"; export type TypenameWithoutSpreadsAbstractType = { readonly __typename: string; readonly id: string; - readonly " $refType": FragmentRefs<"TypenameWithoutSpreadsAbstractType">; + readonly " $refType": "TypenameWithoutSpreadsAbstractType"; }; export type TypenameWithoutSpreadsAbstractType$data = TypenameWithoutSpreadsAbstractType; export type TypenameWithoutSpreadsAbstractType$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected index ef2937fe7afa3..e437b9a5d956b 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected @@ -30,7 +30,7 @@ import { FragmentRefs } from "relay-runtime"; export type AnotherRecursiveFragment = { readonly uri: string | null; readonly height: number | null; - readonly " $refType": FragmentRefs<"AnotherRecursiveFragment">; + readonly " $refType": "AnotherRecursiveFragment"; }; export type AnotherRecursiveFragment$data = AnotherRecursiveFragment; export type AnotherRecursiveFragment$key = { @@ -42,7 +42,7 @@ import { FragmentRefs } from "relay-runtime"; export type PhotoFragment = { readonly uri: string | null; readonly width: number | null; - readonly " $refType": FragmentRefs<"PhotoFragment">; + readonly " $refType": "PhotoFragment"; }; export type PhotoFragment$data = PhotoFragment; export type PhotoFragment$key = { @@ -69,7 +69,7 @@ export type UserProfile = { readonly height: number | null; readonly " $fragmentRefs": FragmentRefs<"PhotoFragment">; } | null; - readonly " $refType": FragmentRefs<"UserProfile">; + readonly " $refType": "UserProfile"; }; export type UserProfile$data = UserProfile; export type UserProfile$key = { From 191b4ab54a6ccbfa68dd932aa6ed444c5244f4af Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Mon, 14 Feb 2022 14:56:56 +0100 Subject: [PATCH 29/41] Fix typegen config not being set correctly in typegen tests. --- .../mutation-with-enums-on-fragment.expected | 4 +- .../fixtures/relay-client-id-field.expected | 8 +--- ...ough-inline-fragments-to-fragment.expected | 4 +- .../fixtures/typename-on-union.expected | 33 +-------------- .../relay-typegen/tests/generate_flow/mod.rs | 40 +++++++++---------- .../mutation-with-enums-on-fragment.expected | 4 +- .../fixtures/relay-client-id-field.expected | 8 +--- ...ough-inline-fragments-to-fragment.expected | 4 +- .../fixtures/typename-on-union.expected | 33 +-------------- .../tests/generate_typescript/mod.rs | 36 ++++++++--------- 10 files changed, 48 insertions(+), 126 deletions(-) diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-enums-on-fragment.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-enums-on-fragment.expected index 05011b88cebd6..87cd66d715c6b 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-enums-on-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-enums-on-fragment.expected @@ -32,7 +32,7 @@ fragment FriendFragment on User { } ==================================== OUTPUT =================================== import type { FriendFragment$fragmentType } from "FriendFragment.graphql"; -export type TestEnums = "mark" | "zuck" | "%future added value"; +export type TestEnums = "mark" | "zuck"; export type CommentCreateInput = {| clientMutationId?: ?string, feedbackId?: ?string, @@ -85,7 +85,7 @@ export type CommentCreateMutation$rawResponse = {| |}, |}; ------------------------------------------------------------------------------- -export type TestEnums = "mark" | "zuck" | "%future added value"; +export type TestEnums = "mark" | "zuck"; import type { FragmentType } from "relay-runtime"; declare export opaque type FriendFragment$fragmentType: FragmentType; export type FriendFragment$data = {| diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.expected index 395e6a8a8d0c9..724ee18f5b2a8 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.expected @@ -53,17 +53,13 @@ export type RelayClientIDFieldQuery$data = {| |}, +__id: string, |} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +__typename: "%other", + +__typename: "MarkdownCommentBody", +__id: string, |}), +__id: string, +id: string, |} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +__typename: "%other", + +__typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "User", +__id: string, +id: string, |}), diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected index fe21e70aa45f0..6066fe517d032 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected @@ -19,9 +19,7 @@ export type Foo$data = ?({| +name: string, +$fragmentType: Foo$fragmentType, |} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +__typename: "%other", + +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story", +$fragmentType: Foo$fragmentType, |}); export type Foo$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected index 32d9e3298c3f2..bb02f4aa1dbfb 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected @@ -94,11 +94,6 @@ export type TypenameAlias$data = {| +_typeAlias: "Page", +username: ?string, +$fragmentType: TypenameAlias$fragmentType, -|} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +_typeAlias: "%other", - +$fragmentType: TypenameAlias$fragmentType, |}; export type TypenameAlias$key = { +$data?: TypenameAlias$data, @@ -118,14 +113,6 @@ export type TypenameAliases$data = {| +_typeAlias2: "Page", +username: ?string, +$fragmentType: TypenameAliases$fragmentType, -|} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +_typeAlias1: "%other", - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +_typeAlias2: "%other", - +$fragmentType: TypenameAliases$fragmentType, |}; export type TypenameAliases$key = { +$data?: TypenameAliases$data, @@ -143,11 +130,6 @@ export type TypenameInside$data = {| +__typename: "Page", +username: ?string, +$fragmentType: TypenameInside$fragmentType, -|} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +__typename: "%other", - +$fragmentType: TypenameInside$fragmentType, |}; export type TypenameInside$key = { +$data?: TypenameInside$data, @@ -165,11 +147,6 @@ export type TypenameOutside$data = {| +__typename: "Page", +username: ?string, +$fragmentType: TypenameOutside$fragmentType, -|} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +__typename: "%other", - +$fragmentType: TypenameOutside$fragmentType, |}; export type TypenameOutside$key = { +$data?: TypenameOutside$data, @@ -193,9 +170,7 @@ export type TypenameOutsideWithAbstractType$data = {| |}, +$fragmentType: TypenameOutsideWithAbstractType$fragmentType, |} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +__typename: "%other", + +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story", +username?: ?string, +address?: ?{| +city: ?string, @@ -221,12 +196,6 @@ export type TypenameWithCommonSelections$data = {| +username: ?string, +name: ?string, +$fragmentType: TypenameWithCommonSelections$fragmentType, -|} | {| - // This will never be '%other', but we need some - // value in case none of the concrete values match. - +__typename: "%other", - +name: ?string, - +$fragmentType: TypenameWithCommonSelections$fragmentType, |}; export type TypenameWithCommonSelections$key = { +$data?: TypenameWithCommonSelections$data, diff --git a/compiler/crates/relay-typegen/tests/generate_flow/mod.rs b/compiler/crates/relay-typegen/tests/generate_flow/mod.rs index a071e5eb61506..0327a1bfc44fc 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/mod.rs +++ b/compiler/crates/relay-typegen/tests/generate_flow/mod.rs @@ -37,7 +37,6 @@ pub fn transform_fixture(fixture: &Fixture<'_>) -> Result { let source_location = SourceLocationKey::standalone(fixture.file_name); - let mut sources = FnvHashMap::default(); sources.insert(source_location, source); let ast = parse_executable(source, source_location).unwrap_or_else(|e| { @@ -62,15 +61,26 @@ pub fn transform_fixture(fixture: &Fixture<'_>) -> Result { name: "test".intern(), js_module_format: JsModuleFormat::Haste, feature_flags: Arc::new(feature_flags), - typegen_config: TypegenConfig { - language: TypegenLanguage::Flow, - custom_scalar_types, - flow_typegen: FlowTypegenConfig { - phase: FlowTypegenPhase::Final, + typegen_config: typegen_input + .and_then(|str| serde_json::from_str(str).unwrap()) + .map(|config| TypegenConfig { + language: TypegenLanguage::Flow, + custom_scalar_types: custom_scalar_types.clone(), + flow_typegen: FlowTypegenConfig { + phase: FlowTypegenPhase::Final, + ..Default::default() + }, + ..config + }) + .unwrap_or_else(|| TypegenConfig { + language: TypegenLanguage::Flow, + custom_scalar_types, + flow_typegen: FlowTypegenConfig { + phase: FlowTypegenPhase::Final, + ..Default::default() + }, ..Default::default() - }, - ..Default::default() - }, + }), ..Default::default() }; @@ -83,18 +93,6 @@ pub fn transform_fixture(fixture: &Fixture<'_>) -> Result { ) .unwrap(); - let js_module_format = JsModuleFormat::Haste; - let typegen_config = typegen_input - .and_then(|str| serde_json::from_str(str).unwrap()) - .map(|config| TypegenConfig { - language: TypegenLanguage::Flow, - ..config - }) - .unwrap_or_else(|| TypegenConfig { - language: TypegenLanguage::Flow, - ..Default::default() - }); - let mut operations: Vec<_> = programs.typegen.operations().collect(); operations.sort_by_key(|op| op.name.item); let operation_strings = operations.into_iter().map(|typegen_operation| { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected index ac30e2bacaeb4..caa61078960e5 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected @@ -32,7 +32,7 @@ fragment FriendFragment on User { } ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; -export type TestEnums = "mark" | "zuck" | "%future added value"; +export type TestEnums = "mark" | "zuck"; export type CommentCreateInput = { clientMutationId?: string | null; feedbackId?: string | null; @@ -89,7 +89,7 @@ export type CommentCreateMutation = { response: CommentCreateMutation$data; }; ------------------------------------------------------------------------------- -export type TestEnums = "mark" | "zuck" | "%future added value"; +export type TestEnums = "mark" | "zuck"; import { FragmentRefs } from "relay-runtime"; export type FriendFragment$data = { readonly name: string | null; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected index abd31e26bd325..6b8ee82279131 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected @@ -53,17 +53,13 @@ export type RelayClientIDFieldQuery$data = { } | null; readonly __id: string; } | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly __typename: "%other"; + readonly __typename: "MarkdownCommentBody"; readonly __id: string; } | null; readonly __id: string; readonly id: string; } | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly __typename: "%other"; + readonly __typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "User"; readonly __id: string; readonly id: string; } | null; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected index 55900ffa07f1d..94df425f2b640 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected @@ -18,9 +18,7 @@ export type Foo$data = { readonly name: string; readonly " $fragmentType": "Foo"; } | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly __typename: "%other"; + readonly __typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story"; readonly " $fragmentType": "Foo"; } | null; export type Foo$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected index b1e59da3397b2..4b191465c2218 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected @@ -93,11 +93,6 @@ export type TypenameAlias$data = { readonly _typeAlias: "Page"; readonly username: string | null; readonly " $fragmentType": "TypenameAlias"; -} | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly _typeAlias: "%other"; - readonly " $fragmentType": "TypenameAlias"; }; export type TypenameAlias$key = { readonly " $data"?: TypenameAlias$data; @@ -115,14 +110,6 @@ export type TypenameAliases$data = { readonly _typeAlias2: "Page"; readonly username: string | null; readonly " $fragmentType": "TypenameAliases"; -} | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly _typeAlias1: "%other"; - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly _typeAlias2: "%other"; - readonly " $fragmentType": "TypenameAliases"; }; export type TypenameAliases$key = { readonly " $data"?: TypenameAliases$data; @@ -138,11 +125,6 @@ export type TypenameInside$data = { readonly __typename: "Page"; readonly username: string | null; readonly " $fragmentType": "TypenameInside"; -} | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly __typename: "%other"; - readonly " $fragmentType": "TypenameInside"; }; export type TypenameInside$key = { readonly " $data"?: TypenameInside$data; @@ -158,11 +140,6 @@ export type TypenameOutside$data = { readonly __typename: "Page"; readonly username: string | null; readonly " $fragmentType": "TypenameOutside"; -} | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly __typename: "%other"; - readonly " $fragmentType": "TypenameOutside"; }; export type TypenameOutside$key = { readonly " $data"?: TypenameOutside$data; @@ -184,9 +161,7 @@ export type TypenameOutsideWithAbstractType$data = { } | null; readonly " $fragmentType": "TypenameOutsideWithAbstractType"; } | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly __typename: "%other"; + readonly __typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story"; readonly username?: string | null; readonly address?: { readonly city: string | null; @@ -210,12 +185,6 @@ export type TypenameWithCommonSelections$data = { readonly username: string | null; readonly name: string | null; readonly " $fragmentType": "TypenameWithCommonSelections"; -} | { - // This will never be '%other', but we need some - // value in case none of the concrete values match. - readonly __typename: "%other"; - readonly name: string | null; - readonly " $fragmentType": "TypenameWithCommonSelections"; }; export type TypenameWithCommonSelections$key = { readonly " $data"?: TypenameWithCommonSelections$data; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/mod.rs b/compiler/crates/relay-typegen/tests/generate_typescript/mod.rs index fd0763c7d09ff..b7621bc53392f 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/mod.rs +++ b/compiler/crates/relay-typegen/tests/generate_typescript/mod.rs @@ -46,14 +46,24 @@ pub fn transform_fixture(fixture: &Fixture<'_>) -> Result { let project_config = ProjectConfig { name: "test".intern(), js_module_format: JsModuleFormat::Haste, - typegen_config: TypegenConfig { - language: TypegenLanguage::TypeScript, - flow_typegen: FlowTypegenConfig { - phase: FlowTypegenPhase::Final, + typegen_config: typegen_input + .and_then(|str| serde_json::from_str(str).unwrap()) + .map(|config| TypegenConfig { + language: TypegenLanguage::TypeScript, + flow_typegen: FlowTypegenConfig { + phase: FlowTypegenPhase::Final, + ..Default::default() + }, + ..config + }) + .unwrap_or_else(|| TypegenConfig { + language: TypegenLanguage::TypeScript, + flow_typegen: FlowTypegenConfig { + phase: FlowTypegenPhase::Final, + ..Default::default() + }, ..Default::default() - }, - ..Default::default() - }, + }), ..Default::default() }; let programs = apply_transforms( @@ -65,18 +75,6 @@ pub fn transform_fixture(fixture: &Fixture<'_>) -> Result { ) .unwrap(); - let js_module_format = JsModuleFormat::Haste; - let typegen_config = typegen_input - .and_then(|str| serde_json::from_str(str).unwrap()) - .map(|config| TypegenConfig { - language: TypegenLanguage::TypeScript, - ..config - }) - .unwrap_or_else(|| TypegenConfig { - language: TypegenLanguage::TypeScript, - ..Default::default() - }); - let mut operations: Vec<_> = programs.typegen.operations().collect(); operations.sort_by_key(|op| op.name.item); let operation_strings = operations.into_iter().map(|typegen_operation| { From 18ad43ee0c0c23017df3e4f23459a0b92a422cbf Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Mon, 14 Feb 2022 17:41:24 +0100 Subject: [PATCH 30/41] Fix properties being duplicated in typegen. This happened when there was a combination between a concrete type with a selection that overlapped with selections on an interface, that is also implemented by the concrete type. In such cases, the base selections are added to the selections of the concrete type, but that could result in duplicates. Now the selections are merged instead. --- compiler/crates/relay-typegen/src/lib.rs | 59 +++++++++++-- compiler/crates/relay-typegen/src/writer.rs | 88 +++++++++++++++++-- .../fixtures/relay-client-id-field.expected | 1 - .../fixtures/typename-on-union.expected | 5 +- .../fixtures/relay-client-id-field.expected | 1 - .../fixtures/relay-client-id-field.expected | 1 - .../fixtures/typename-on-union.expected | 5 +- 7 files changed, 138 insertions(+), 22 deletions(-) diff --git a/compiler/crates/relay-typegen/src/lib.rs b/compiler/crates/relay-typegen/src/lib.rs index e288dafb2c792..f42b12e0c4024 100644 --- a/compiler/crates/relay-typegen/src/lib.rs +++ b/compiler/crates/relay-typegen/src/lib.rs @@ -856,7 +856,7 @@ impl<'a> TypeGenerator<'a> { fragment_type_name: Option, ) -> AST { let mut base_fields: TypeSelectionMap = Default::default(); - let mut base_fragments: IndexMap<_, _> = Default::default(); + let mut base_fragments: IndexMap = Default::default(); let mut by_concrete_type: IndexMap> = Default::default(); for selection in selections { @@ -966,7 +966,7 @@ impl<'a> TypeGenerator<'a> { .collect(), ); } else { - // It might be some other type then the listed concrete types. We try to + // It might be some other type than the listed concrete types. We try to // figure out which types remain here. let possible_types_left: Option> = if let Some(node_type) = node_type { if let Some(possible_types) = self.schema.get_possible_types(node_type) { @@ -1096,10 +1096,7 @@ impl<'a> TypeGenerator<'a> { return AST::Union( concrete_types .into_iter() - .map(|mut props: Vec| { - props.extend(base_type_props.iter().cloned()); - props_to_object(props) - }) + .map(|props| props_to_object(merge_props(props, base_type_props.clone()))) .collect(), ); } @@ -2192,6 +2189,56 @@ fn merge_selection( } } +fn merge_props(props: Vec, other_props: Vec) -> Vec { + let mut keyless_props = Vec::new(); + let mut props_map: IndexMap<_, _> = props + .into_iter() + .filter_map(|prop| { + if let Some(key) = prop.get_key() { + Some((key, prop)) + } else { + keyless_props.push(prop); + + None + } + }) + .collect(); + + for prop in other_props { + if let Some(key) = prop.get_key() { + props_map + .entry(key) + .and_modify(|p| merge_prop(p, prop.clone())) + .or_insert(prop); + } else { + keyless_props.push(prop); + } + } + + for prop in hashmap_into_values(props_map) { + keyless_props.push(prop); + } + + keyless_props +} + +fn merge_prop(prop: &mut Prop, other_prop: Prop) { + // Note that, since this is used from merge_props, which only calls this function + // when get_key() return Some(), we know that _both_ prop and other_prop are + // of the variant Prop::KeyValuePair. + match prop { + Prop::KeyValuePair(a) => match other_prop { + Prop::KeyValuePair(b) => { + // a.value = AST::Union(vec![a.value.clone(), b.value]); + // a.value = a.value.clone().merge_with(b.value); + a.value.merge_with(b.value); + } + _ => {} + }, + _ => {} + } +} + fn merge_selections(a: &mut TypeSelectionMap, b: TypeSelectionMap, should_set_conditional: bool) { for (key, value) in b { a.insert( diff --git a/compiler/crates/relay-typegen/src/writer.rs b/compiler/crates/relay-typegen/src/writer.rs index c504669d1ec2b..785ad966dc55c 100644 --- a/compiler/crates/relay-typegen/src/writer.rs +++ b/compiler/crates/relay-typegen/src/writer.rs @@ -8,7 +8,7 @@ use intern::string_key::StringKey; use std::fmt::{Result as FmtResult, Write}; -#[derive(Debug, Clone)] +#[derive(Debug, Clone, Eq, PartialEq, Hash)] pub enum AST { Union(Vec), Intersection(Vec), @@ -45,16 +45,94 @@ impl AST { _ => false, } } + + pub fn merge_with(&mut self, other: Self) { + if *self == other { + return; + } + + match self { + AST::Union(a) => { + if let AST::Union(mut b) = other { + a.append(&mut b); + } else { + a.push(other); + } + } + AST::ReadOnlyArray(a) => { + if let AST::ReadOnlyArray(b) = other { + a.merge_with(*b); + } else { + *self = AST::Union(vec![self.clone(), other]); + } + } + AST::Nullable(a) => { + if let AST::Nullable(b) = other { + a.merge_with(*b); + } else { + *self = AST::Union(vec![self.clone(), other]); + } + } + AST::ExactObject(a) => { + if let AST::ExactObject(b) = other { + for prop in b { + if !a.contains(&prop) { + a.push(prop); + } + } + } else { + *self = AST::Union(vec![self.clone(), other]); + } + } + AST::InexactObject(a) => { + if let AST::InexactObject(b) = other { + for prop in b { + if !a.contains(&prop) { + a.push(prop); + } + } + } else { + *self = AST::Union(vec![self.clone(), other]); + } + } + AST::FragmentReference(a) => { + if let AST::FragmentReference(b) = other { + for key in b { + if !a.contains(&key) { + a.push(key); + } + } + } else { + *self = AST::Union(vec![self.clone(), other]); + } + } + + // Everything else should just be a union, since we don't have a way to + // structurally merge them. + _ => { + *self = AST::Union(vec![self.clone(), other]); + } + } + } } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, Eq, PartialEq, Hash)] pub enum Prop { KeyValuePair(KeyValuePairProp), Spread(SpreadProp), GetterSetterPair(GetterSetterPairProp), } -#[derive(Debug, Clone)] +impl Prop { + pub(crate) fn get_key(&self) -> Option { + match self { + Prop::KeyValuePair(kvp) => Some(kvp.key), + _ => None, + } + } +} + +#[derive(Debug, Clone, Eq, PartialEq, Hash)] pub struct KeyValuePairProp { pub key: StringKey, pub value: AST, @@ -62,12 +140,12 @@ pub struct KeyValuePairProp { pub optional: bool, } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, Eq, PartialEq, Hash)] pub struct SpreadProp { pub value: StringKey, } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, Eq, PartialEq, Hash)] pub struct GetterSetterPairProp { pub key: StringKey, pub getter_return_value: AST, diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.expected index 724ee18f5b2a8..446a393848c15 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.expected @@ -51,7 +51,6 @@ export type RelayClientIDFieldQuery$data = {| +__typename: string, +text: ?string, |}, - +__id: string, |} | {| +__typename: "MarkdownCommentBody", +__id: string, diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected index bb02f4aa1dbfb..8a74eb5a90058 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected @@ -162,12 +162,9 @@ export type TypenameOutsideWithAbstractType$data = {| +address: ?{| +street: ?string, +city: ?string, - |}, - +username?: ?string, - +address?: ?{| - +city: ?string, +country: ?string, |}, + +username?: ?string, +$fragmentType: TypenameOutsideWithAbstractType$fragmentType, |} | {| +__typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story", diff --git a/compiler/crates/relay-typegen/tests/generate_flow_with_custom_id/fixtures/relay-client-id-field.expected b/compiler/crates/relay-typegen/tests/generate_flow_with_custom_id/fixtures/relay-client-id-field.expected index db7eee11ae2f2..16dd10740c510 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow_with_custom_id/fixtures/relay-client-id-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow_with_custom_id/fixtures/relay-client-id-field.expected @@ -47,7 +47,6 @@ export type RelayClientIDFieldQuery$data = {| +__typename: string, +text: ?string, |}, - +__id: string, |} | {| // This will never be '%other', but we need some // value in case none of the concrete values match. diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected index 6b8ee82279131..ef8e75ec92b78 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected @@ -51,7 +51,6 @@ export type RelayClientIDFieldQuery$data = { readonly __typename: string; readonly text: string | null; } | null; - readonly __id: string; } | { readonly __typename: "MarkdownCommentBody"; readonly __id: string; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected index 4b191465c2218..9fae3edf0aea7 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected @@ -153,12 +153,9 @@ export type TypenameOutsideWithAbstractType$data = { readonly address: { readonly street: string | null; readonly city: string | null; - } | null; - readonly username?: string | null; - readonly address?: { - readonly city: string | null; readonly country: string | null; } | null; + readonly username?: string | null; readonly " $fragmentType": "TypenameOutsideWithAbstractType"; } | { readonly __typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story"; From 0f9360bbe8ea28b7a50f6b9f797ee404f1623451 Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Mon, 14 Feb 2022 20:32:18 +0100 Subject: [PATCH 31/41] Allow excluding types from future proofness. For example, allow excluding `Node`, to avoid super long lists of concrete types. --- .../crates/relay-config/src/typegen_config.rs | 7 +++++ compiler/crates/relay-typegen/src/lib.rs | 9 +++++- .../fixtures/typename-on-node.expected | 28 +++++++++++++++++++ .../fixtures/typename-on-node.graphql | 11 ++++++++ .../tests/generate_typescript_test.rs | 7 +++++ 5 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-node.expected create mode 100644 compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-node.graphql diff --git a/compiler/crates/relay-config/src/typegen_config.rs b/compiler/crates/relay-config/src/typegen_config.rs index c0b4fd8d5321e..402830309c2ac 100644 --- a/compiler/crates/relay-config/src/typegen_config.rs +++ b/compiler/crates/relay-config/src/typegen_config.rs @@ -73,6 +73,12 @@ pub struct TypegenConfig { #[serde(default = "default_future_proofness")] pub future_proof_abstract_types: bool, + /// For which types (unions or interfaces) to not write out all possible type names if future + /// proof abstract types is set to false. Especially useful for interfaces or unions that may + /// have a lot of concrete types, such as Node. + #[serde(default)] + pub exclude_from_typename_unions: Vec, + /// A map from GraphQL scalar types to a custom JS type, example: /// { "Url": "String" } #[serde(default)] @@ -153,6 +159,7 @@ impl Default for TypegenConfig { use_import_type_syntax: false, future_proof_abstract_types: default_future_proofness(), future_proof_enums: default_future_proofness(), + exclude_from_typename_unions: vec![], custom_scalar_types: FnvIndexMap::default(), flow_enums: FnvIndexSet::default(), require_custom_scalar_types: false, diff --git a/compiler/crates/relay-typegen/src/lib.rs b/compiler/crates/relay-typegen/src/lib.rs index f42b12e0c4024..23cf5defe9fd3 100644 --- a/compiler/crates/relay-typegen/src/lib.rs +++ b/compiler/crates/relay-typegen/src/lib.rs @@ -951,7 +951,14 @@ impl<'a> TypeGenerator<'a> { ); } - if self.typegen_config.future_proof_abstract_types { + let exclude_from_future_proofness = node_type + .filter(|type_| { + self.typegen_config + .exclude_from_typename_unions + .contains(&self.schema.get_type_name(*type_)) + }) + .is_some(); + if self.typegen_config.future_proof_abstract_types || exclude_from_future_proofness { concrete_types.push( typename_aliases .iter() diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-node.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-node.expected new file mode 100644 index 0000000000000..b2e12197db340 --- /dev/null +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-node.expected @@ -0,0 +1,28 @@ +==================================== INPUT ==================================== +{ + "futureProofAbstractTypes": false, + "excludeFromTypenameUnions": ["Node"] +} +%%% +fragment TypenameOnNode on Node { + __typename + ... on User { + id + } +} +==================================== OUTPUT =================================== +import { FragmentRefs } from "relay-runtime"; +export type TypenameOnNode$data = { + readonly __typename: "User"; + readonly id: string; + readonly " $fragmentType": "TypenameOnNode"; +} | { + // This will never be '%other', but we need some + // value in case none of the concrete values match. + readonly __typename: "%other"; + readonly " $fragmentType": "TypenameOnNode"; +}; +export type TypenameOnNode$key = { + readonly " $data"?: TypenameOnNode$data; + readonly " $fragmentSpreads": FragmentRefs<"TypenameOnNode">; +}; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-node.graphql b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-node.graphql new file mode 100644 index 0000000000000..491c5c4b3c4b8 --- /dev/null +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-node.graphql @@ -0,0 +1,11 @@ +{ + "futureProofAbstractTypes": false, + "excludeFromTypenameUnions": ["Node"] +} +%%% +fragment TypenameOnNode on Node { + __typename + ... on User { + id + } +} diff --git a/compiler/crates/relay-typegen/tests/generate_typescript_test.rs b/compiler/crates/relay-typegen/tests/generate_typescript_test.rs index 6db91a7a31c9d..c21f8d9a6e270 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript_test.rs +++ b/compiler/crates/relay-typegen/tests/generate_typescript_test.rs @@ -545,6 +545,13 @@ fn typename_inside_with_overlapping_fields() { ); } +#[test] +fn typename_on_node() { + let input = include_str!("generate_typescript/fixtures/typename-on-node.graphql"); + let expected = include_str!("generate_typescript/fixtures/typename-on-node.expected"); + test_fixture(transform_fixture, "typename-on-node.graphql", "generate_typescript/fixtures/typename-on-node.expected", input, expected); +} + #[test] fn typename_on_union() { let input = include_str!("generate_typescript/fixtures/typename-on-union.graphql"); From a3cb206e1a2ba7d46129ad05061e80868f140e51 Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Mon, 14 Feb 2022 20:49:01 +0100 Subject: [PATCH 32/41] Add Flow version of added test. --- .../fixtures/typename-on-node.expected | 30 +++++++++++++++++++ .../fixtures/typename-on-node.graphql | 11 +++++++ .../relay-typegen/tests/generate_flow_test.rs | 7 +++++ 3 files changed, 48 insertions(+) create mode 100644 compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-node.expected create mode 100644 compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-node.graphql diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-node.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-node.expected new file mode 100644 index 0000000000000..0cf342fc529f0 --- /dev/null +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-node.expected @@ -0,0 +1,30 @@ +==================================== INPUT ==================================== +{ + "futureProofAbstractTypes": false, + "excludeFromTypenameUnions": ["Node"] +} +%%% +fragment TypenameOnNode on Node { + __typename + ... on User { + id + } +} +==================================== OUTPUT =================================== +import type { FragmentType } from "relay-runtime"; +declare export opaque type TypenameOnNode$fragmentType: FragmentType; +export type TypenameOnNode$data = {| + +__typename: "User", + +id: string, + +$fragmentType: TypenameOnNode$fragmentType, +|} | {| + // This will never be '%other', but we need some + // value in case none of the concrete values match. + +__typename: "%other", + +$fragmentType: TypenameOnNode$fragmentType, +|}; +export type TypenameOnNode$key = { + +$data?: TypenameOnNode$data, + +$fragmentSpreads: TypenameOnNode$fragmentType, + ... +}; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-node.graphql b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-node.graphql new file mode 100644 index 0000000000000..491c5c4b3c4b8 --- /dev/null +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-node.graphql @@ -0,0 +1,11 @@ +{ + "futureProofAbstractTypes": false, + "excludeFromTypenameUnions": ["Node"] +} +%%% +fragment TypenameOnNode on Node { + __typename + ... on User { + id + } +} diff --git a/compiler/crates/relay-typegen/tests/generate_flow_test.rs b/compiler/crates/relay-typegen/tests/generate_flow_test.rs index b288403ad6988..ccf55775f7f70 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow_test.rs +++ b/compiler/crates/relay-typegen/tests/generate_flow_test.rs @@ -418,6 +418,13 @@ fn typename_inside_with_overlapping_fields() { test_fixture(transform_fixture, "typename-inside-with-overlapping-fields.graphql", "generate_flow/fixtures/typename-inside-with-overlapping-fields.expected", input, expected); } +#[test] +fn typename_on_node() { + let input = include_str!("generate_flow/fixtures/typename-on-node.graphql"); + let expected = include_str!("generate_flow/fixtures/typename-on-node.expected"); + test_fixture(transform_fixture, "typename-on-node.graphql", "generate_flow/fixtures/typename-on-node.expected", input, expected); +} + #[test] fn typename_on_union() { let input = include_str!("generate_flow/fixtures/typename-on-union.graphql"); From af6e76249c8e57a4348cdc98fc441556e027f116 Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Mon, 14 Feb 2022 21:06:42 +0100 Subject: [PATCH 33/41] Fix mistake in merge. --- compiler/crates/relay-compiler/src/config.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/compiler/crates/relay-compiler/src/config.rs b/compiler/crates/relay-compiler/src/config.rs index c46743fd3ebb5..17fe85e056f27 100644 --- a/compiler/crates/relay-compiler/src/config.rs +++ b/compiler/crates/relay-compiler/src/config.rs @@ -758,7 +758,6 @@ impl SingleProjectConfigFile { eager_es_modules: self.eager_es_modules, future_proof_enums: !self.no_future_proof_enums, flow_typegen: FlowTypegenConfig { - no_future_proof_enums: self.no_future_proof_enums, phase: self.typegen_phase, ..Default::default() }, From 90e6d24daf626e6602ef9f9e706e3ff348c5af01 Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Wed, 16 Feb 2022 12:51:31 +0100 Subject: [PATCH 34/41] Remove commented out code. --- compiler/crates/relay-typegen/src/lib.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/compiler/crates/relay-typegen/src/lib.rs b/compiler/crates/relay-typegen/src/lib.rs index b21b906d5f4cb..5b45d339ea541 100644 --- a/compiler/crates/relay-typegen/src/lib.rs +++ b/compiler/crates/relay-typegen/src/lib.rs @@ -2291,8 +2291,6 @@ fn merge_prop(prop: &mut Prop, other_prop: Prop) { match prop { Prop::KeyValuePair(a) => match other_prop { Prop::KeyValuePair(b) => { - // a.value = AST::Union(vec![a.value.clone(), b.value]); - // a.value = a.value.clone().merge_with(b.value); a.value.merge_with(b.value); } _ => {} From 518509582f2ba656a94112d385fc8f0583836f74 Mon Sep 17 00:00:00 2001 From: Robert Balicki Date: Thu, 24 Feb 2022 21:30:39 -0800 Subject: [PATCH 35/41] Combination of four diffs Differential Revision: D34470327 fbshipit-source-id: 561dcf8b8763fb05261a33dbbb5251140f3715ef --- .../crates/relay-config/src/typegen_config.rs | 18 ++ compiler/crates/relay-typegen/src/flow.rs | 214 +++++++------ compiler/crates/relay-typegen/src/lib.rs | 165 ++++++---- .../crates/relay-typegen/src/typescript.rs | 293 +++++++++++++----- compiler/crates/relay-typegen/src/writer.rs | 90 +++++- .../fixtures/actor-change-with-query.expected | 4 +- .../fixtures/actor-change.expected | 2 +- .../fixtures/fragment-spread.expected | 24 +- .../fixtures/inline-fragment.expected | 12 +- .../fixtures/linked-field.expected | 14 +- .../fixtures/match-field-in-query.expected | 6 +- .../fixtures/match-field.expected | 4 +- .../mutation-input-has-array.expected | 4 +- .../mutation-with-client-extension.expected | 6 +- .../mutation-with-enums-on-fragment.expected | 20 +- .../mutation-with-nested-fragments.expected | 16 +- ...with-response-on-inline-fragments.expected | 20 +- .../generate_flow/fixtures/mutation.expected | 10 +- .../fixtures/no-inline-fragment.expected | 8 +- .../query-mixed-provided-variables.expected | 8 +- .../query-only-provided-variables.expected | 4 +- .../fixtures/query-with-handles.expected | 10 +- .../fixtures/query-with-match-fields.expected | 16 +- .../fixtures/query-with-module-field.expected | 6 +- .../query-with-multiple-match-fields.expected | 26 +- ...-with-raw-response-on-conditional.expected | 16 +- ...w-response-on-literal-conditional.expected | 12 +- .../query-with-stream-connection.expected | 16 +- .../fixtures/query-with-stream.expected | 14 +- ...aw_response_and_client_components.expected | 12 +- .../fixtures/refetchable-fragment.expected | 4 +- .../fixtures/refetchable.expected | 2 +- .../fixtures/relay-client-id-field.expected | 4 +- ...lay-resolver-client-edge-required.expected | 6 +- .../relay-resolver-client-edge.expected | 6 +- ...relay-resolver-multiple-consumers.expected | 4 +- .../relay-resolver-raw-response.expected | 6 +- .../fixtures/relay-resolver-required.expected | 2 +- .../fixtures/relay-resolver.expected | 2 +- ...-to-item-in-required-plural-field.expected | 2 +- .../required-bubbles-to-query.expected | 2 +- ...d-bubbles-up-to-mutation-response.expected | 4 +- ...solates-concrete-inline-fragments.expected | 2 +- .../required-raw-response-type.expected | 4 +- ...red-throw-doesnt-bubbles-to-query.expected | 2 +- .../fixtures/required-throws-nested.expected | 2 +- .../generate_flow/fixtures/required.expected | 2 +- .../generate_flow/fixtures/roots.expected | 8 +- .../fixtures/scalar-field.expected | 10 +- .../generate_flow/fixtures/simple.expected | 2 +- .../fixtures/typename-on-union.expected | 22 +- .../unmasked-fragment-spreads.expected | 4 +- ...ration-assignable-fragment-plural.expected | 6 +- ...ble-operation-assignable-fragment.expected | 6 +- ...gnable-fragments-within-narrowing.expected | 10 +- ...ion-multiple-assignable-fragments.expected | 10 +- ...operation-plural-field-no-spreads.expected | 2 +- ...eration-plural-field-with-spreads.expected | 6 +- ...pdatable-operation-special-fields.expected | 10 +- ...datable-operation-type-refinement.expected | 2 +- .../fixtures/updatable-operation.expected | 2 +- .../fixtures/relay-client-id-field.expected | 4 +- .../fixtures/simple.expected | 2 +- .../fixtures/fragment-spread.expected | 36 +-- .../fixtures/inline-fragment.expected | 44 +-- .../fixtures/linked-field.expected | 30 +- .../fixtures/match-field-in-query.expected | 32 +- .../fixtures/match-field.expected | 26 +- .../mutation-input-has-array.expected | 30 +- .../mutation-with-client-extension.expected | 38 +-- .../mutation-with-enums-on-fragment.expected | 86 ++--- .../mutation-with-nested-fragments.expected | 80 ++--- ...with-response-on-inline-fragments.expected | 80 ++--- .../fixtures/mutation.expected | 32 +- .../fixtures/query-with-handles.expected | 40 +-- .../fixtures/query-with-match-fields.expected | 70 ++--- .../fixtures/query-with-module-field.expected | 40 +-- .../query-with-multiple-match-fields.expected | 118 +++---- ...-with-raw-response-on-conditional.expected | 36 +-- ...w-response-on-literal-conditional.expected | 32 +- .../query-with-stream-connection.expected | 66 ++-- .../fixtures/query-with-stream.expected | 54 ++-- .../fixtures/refetchable-fragment.expected | 12 +- .../fixtures/refetchable.expected | 8 +- .../fixtures/relay-client-id-field.expected | 22 +- ...ough-inline-fragments-to-fragment.expected | 4 +- .../required-bubbles-to-fragment.expected | 6 +- ...d-bubbles-to-item-in-plural-field.expected | 8 +- .../required-bubbles-to-query.expected | 8 +- ...d-bubbles-up-to-mutation-response.expected | 16 +- ...solates-concrete-inline-fragments.expected | 20 +- .../required-raw-response-type.expected | 14 +- ...-throw-doesnt-bubbles-to-fragment.expected | 2 +- ...red-throw-doesnt-bubbles-to-query.expected | 6 +- .../fixtures/required-throws-nested.expected | 8 +- .../fixtures/required.expected | 8 +- .../fixtures/roots.expected | 42 +-- .../fixtures/scalar-field.expected | 22 +- .../fixtures/simple.expected | 12 +- ...me-inside-with-overlapping-fields.expected | 14 +- .../fixtures/typename-on-union.expected | 54 ++-- .../unmasked-fragment-spreads.expected | 22 +- ...aginationContainerFlowtestQuery.graphql.js | 4 +- ...ayRefetchContainerFlowtestQuery.graphql.js | 4 +- ...ReactDoubleEffectsTestUserQuery.graphql.js | 4 +- ...yFragmentContainerTestUserQuery.graphql.js | 4 +- ...tContainerTestUserWithCondQuery.graphql.js | 6 +- ...hFragmentOwnershipTestUserQuery.graphql.js | 4 +- ...tOwnershipTestWithCondUserQuery.graphql.js | 6 +- ...ueryRendererTestSecondUserQuery.graphql.js | 4 +- ...LocalQueryRendererTestUserQuery.graphql.js | 4 +- ...ctDoubleEffectsTestUserFragment.graphql.js | 6 +- ...ReactDoubleEffectsTestUserQuery.graphql.js | 6 +- ...NoConnectionOnFragmentUserQuery.graphql.js | 10 +- ...tainerTestNoConnectionUserQuery.graphql.js | 4 +- ...nationContainerTestUserFragment.graphql.js | 4 +- ...aginationContainerTestUserQuery.graphql.js | 8 +- ...agmentOwnershipTestUserFragment.graphql.js | 4 +- ...hFragmentOwnershipTestUserQuery.graphql.js | 8 +- ...ReactDoubleEffectsTestUserQuery.graphql.js | 4 +- ...RelayQueryRendererTestNextQuery.graphql.js | 4 +- ...eactRelayQueryRendererTestQuery.graphql.js | 4 +- ...ReactDoubleEffectsTestUserQuery.graphql.js | 4 +- ...ayRefetchContainerTestUserQuery.graphql.js | 4 +- ...hContainerTestUserWithCondQuery.graphql.js | 6 +- ...hFragmentOwnershipTestUserQuery.graphql.js | 4 +- ...ockerTestFragContainerTestQuery.graphql.js | 4 +- ...tRelayTestMockerTestNestedQuery.graphql.js | 4 +- .../ReactRelayTestMockerTestQuery.graphql.js | 4 +- .../ActorChangeTestMutation.graphql.js | 6 +- .../ActorChangeTestQuery.graphql.js | 12 +- ...ctorChangeWithDeferTestFragment.graphql.js | 4 +- .../ActorChangeWithDeferTestQuery.graphql.js | 12 +- ...rChangeWithMutationTestFragment.graphql.js | 4 +- ...rChangeWithMutationTestMutation.graphql.js | 4 +- ...ctorChangeWithMutationTestQuery.graphql.js | 4 +- ...torChangeWithStreamTestFragment.graphql.js | 12 +- .../ActorChangeWithStreamTestQuery.graphql.js | 4 +- .../EntryPointContainerTestQuery.graphql.js | 4 +- ...ceRequiredFieldTestUserFragment.graphql.js | 4 +- ...ourceRequiredFieldTestUserQuery.graphql.js | 4 +- .../FragmentResourceTest1Query.graphql.js | 4 +- .../FragmentResourceTest2Query.graphql.js | 4 +- .../FragmentResourceTest3Query.graphql.js | 4 +- .../FragmentResourceTest4Query.graphql.js | 4 +- .../FragmentResourceTest5Query.graphql.js | 4 +- .../FragmentResourceTest6Query.graphql.js | 6 +- ...ackerTestFriendsPaginationQuery.graphql.js | 4 +- ...stMarkdownUserNameRenderer_name.graphql.js | 4 +- ...thOperationTrackerTestNodeQuery.graphql.js | 4 +- ...rTestPlainUserNameRenderer_name.graphql.js | 4 +- ...onTrackerTestViewerFriendsQuery.graphql.js | 4 +- ...ntContainerDEEPRECATEDTestQuery.graphql.js | 4 +- .../QueryResourceTest10Query.graphql.js | 4 +- .../QueryResourceTest1Query.graphql.js | 4 +- .../QueryResourceTest2Query.graphql.js | 4 +- .../QueryResourceTest3Query.graphql.js | 4 +- .../QueryResourceTest4Query.graphql.js | 4 +- .../QueryResourceTest5Query.graphql.js | 4 +- .../QueryResourceTest6Query.graphql.js | 4 +- .../QueryResourceTest7Query.graphql.js | 4 +- .../QueryResourceTest8Query.graphql.js | 4 +- .../QueryResourceTest9Query.graphql.js | 4 +- ...oadQuerySourceBehaviorTestQuery.graphql.js | 4 +- ...loadQueryStoreBehaviorTestQuery.graphql.js | 6 +- .../loadQueryTestQuery.graphql.js | 4 +- ...preloadQueryDEPRECATEDTestQuery.graphql.js | 4 +- ...RECATEDTest_ProvidedVarFragment.graphql.js | 4 +- ...DEPRECATEDTest_ProvidedVarQuery.graphql.js | 8 +- ...PaginationFragmentTest2Fragment.graphql.js | 4 +- ...entTest2FragmentPaginationQuery.graphql.js | 6 +- ...agmentTest4FragmentRefetchQuery.graphql.js | 4 +- ...PaginationFragmentTestNodeQuery.graphql.js | 4 +- ...inationFragmentTestUserFragment.graphql.js | 6 +- ...TestUserFragmentPaginationQuery.graphql.js | 6 +- ...PaginationFragmentTestUserQuery.graphql.js | 10 +- ...estUserQueryNestedFragmentQuery.graphql.js | 10 +- ...stUserQueryWithLiteralArgsQuery.graphql.js | 8 +- ...mentTestUserQueryWithoutIDQuery.graphql.js | 8 +- ...penseTransitionTestUserFragment.graphql.js | 6 +- ...TestUserFragmentPaginationQuery.graphql.js | 6 +- ...SuspenseTransitionTestUserQuery.graphql.js | 10 +- ...tionTestUserQueryWithoutIDQuery.graphql.js | 8 +- ...ReactDoubleEffectsTestUserQuery.graphql.js | 4 +- ...ReactDoubleEffectsTestUserQuery.graphql.js | 4 +- ...agmentNodeRequiredTestUserQuery.graphql.js | 4 +- .../useFragmentNodeTestUserQuery.graphql.js | 4 +- .../useFragmentNodeTestUsersQuery.graphql.js | 4 +- .../useFragmentTestUserQuery.graphql.js | 4 +- .../useFragmentTestUsersQuery.graphql.js | 4 +- ...sParentQueryActiveTestUserQuery.graphql.js | 4 +- ...eryNodeFastRefreshTestUserQuery.graphql.js | 4 +- ...ReactDoubleEffectsTestUserQuery.graphql.js | 4 +- ...ectsTestUserQueryWithDeferQuery.graphql.js | 4 +- .../useLazyLoadQueryNodeTest1Query.graphql.js | 4 +- ...QueryNodeTestOnlyFragmentsQuery.graphql.js | 4 +- ...eLazyLoadQueryNodeTestUserQuery.graphql.js | 4 +- ...efreshTestCommentCreateMutation.graphql.js | 8 +- .../useMutationTest1Mutation.graphql.js | 8 +- .../useMutationTest2Mutation.graphql.js | 8 +- ...agmentTest3FragmentRefetchQuery.graphql.js | 4 +- ...nationFragmentTestStoryFragment.graphql.js | 4 +- ...ntTestStoryFragmentRefetchQuery.graphql.js | 4 +- ...aginationFragmentTestStoryQuery.graphql.js | 4 +- ...inationFragmentTestUserFragment.graphql.js | 6 +- ...TestUserFragmentPaginationQuery.graphql.js | 6 +- ...ragmentStreamingPaginationQuery.graphql.js | 6 +- ...ntTestUserFragmentWithStreaming.graphql.js | 6 +- ...PaginationFragmentTestUserQuery.graphql.js | 10 +- ...estUserQueryNestedFragmentQuery.graphql.js | 10 +- ...stUserQueryWithLiteralArgsQuery.graphql.js | 8 +- ...TestUserQueryWithStreamingQuery.graphql.js | 10 +- ...mentTestUserQueryWithoutIDQuery.graphql.js | 8 +- ...yProvidedVariablesTest_Fragment.graphql.js | 4 +- ...ueryProvidedVariablesTest_Query.graphql.js | 8 +- ...yProvidedVariablesTest_badQuery.graphql.js | 4 +- ...eactDoubleEffectsTestDeferQuery.graphql.js | 4 +- ...ueryReactDoubleEffectsTestQuery.graphql.js | 4 +- .../usePreloadedQueryTestQuery.graphql.js | 4 +- ...seQueryLoaderLiveQueryTestQuery.graphql.js | 4 +- ...eryLoaderMultipleCallsTestQuery.graphql.js | 4 +- ...aderReactDoubleEffectsTestQuery.graphql.js | 4 +- .../useQueryLoaderTestQuery.graphql.js | 4 +- ...chableFragmentNodeTest1Fragment.graphql.js | 4 +- ...ntNodeTest1FragmentRefetchQuery.graphql.js | 4 +- ...fetchableFragmentNodeTest1Query.graphql.js | 4 +- ...fetchableFragmentNodeTest2Query.graphql.js | 4 +- ...ntNodeTest3FragmentRefetchQuery.graphql.js | 6 +- ...odeTestUserFragmentRefetchQuery.graphql.js | 6 +- ...serFragmentWithArgsRefetchQuery.graphql.js | 6 +- ...chableFragmentNodeTestUserQuery.graphql.js | 4 +- ...estUserQueryNestedFragmentQuery.graphql.js | 4 +- ...tNodeTestUserQueryWithArgsQuery.graphql.js | 4 +- ...stUserQueryWithLiteralArgsQuery.graphql.js | 4 +- ...ionTestUserFragmentRefetchQuery.graphql.js | 6 +- ...SuspenseTransitionTestUserQuery.graphql.js | 4 +- ...entTestUserFragmentRefetchQuery.graphql.js | 6 +- ...efetchableFragmentTestUserQuery.graphql.js | 4 +- ...onTestCommentCreateSubscription.graphql.js | 6 +- ...ctionHandlerTestConnectionQuery.graphql.js | 8 +- ...cuteMutationTestCommentFragment.graphql.js | 4 +- ...ExecuteMutationTestCommentQuery.graphql.js | 4 +- ...tationTestCreateCommentMutation.graphql.js | 8 +- ...CreateCommentWithSpreadMutation.graphql.js | 6 +- ...ctorEnvironmentExecuteTestQuery.graphql.js | 4 +- .../commitMutationTest1Fragment.graphql.js | 4 +- .../commitMutationTest1Mutation.graphql.js | 4 +- .../commitMutationTest1Query.graphql.js | 4 +- .../commitMutationTest2Fragment.graphql.js | 4 +- .../commitMutationTest2Mutation.graphql.js | 4 +- .../commitMutationTest2Query.graphql.js | 4 +- .../commitMutationTest3Mutation.graphql.js | 4 +- .../commitMutationTest3Query.graphql.js | 4 +- .../commitMutationTest4Mutation.graphql.js | 8 +- .../commitMutationTest4Query.graphql.js | 4 +- .../commitMutationTest5Mutation.graphql.js | 4 +- .../commitMutationTest5Query.graphql.js | 4 +- .../commitMutationTest6Mutation.graphql.js | 8 +- .../commitMutationTest7Mutation.graphql.js | 8 +- ...onTestRequiredRootFieldMutation.graphql.js | 4 +- ...EXPERIMENTALTest2UpdatableQuery.graphql.js | 4 +- ...eryEXPERIMENTALTestRegularQuery.graphql.js | 12 +- ...yEXPERIMENTALTestUpdatableQuery.graphql.js | 22 +- ...tableQueryEXPERIMENTALTest_node.graphql.js | 10 +- ...tableQueryEXPERIMENTALTest_user.graphql.js | 10 +- ...10ChangeNameIncludeBoolMutation.graphql.js | 6 +- ...nTest11ChangeNamePhonesMutation.graphql.js | 4 +- ...nTest12ChangeNamePhonesMutation.graphql.js | 4 +- ...nTest13ChangeNamePhonesMutation.graphql.js | 4 +- ...nTest14ChangeNamePhonesMutation.graphql.js | 4 +- ...est15ChangeNameWebsitesMutation.graphql.js | 4 +- ...est16ChangeNameWebsitesMutation.graphql.js | 4 +- ...utationTest17ChangeNameMutation.graphql.js | 4 +- ...utationTest18ChangeNameMutation.graphql.js | 4 +- ...ationTest19FeedbackLikeMutation.graphql.js | 4 +- ...MutationTest1ChangeNameMutation.graphql.js | 4 +- ...ationTest20FeedbackLikeMutation.graphql.js | 4 +- ...est21FeedbackLikeGroovyMutation.graphql.js | 4 +- ...MutationTest2ChangeNameMutation.graphql.js | 4 +- ...MutationTest3ChangeNameMutation.graphql.js | 4 +- ...MutationTest4ChangeNameMutation.graphql.js | 4 +- ...Test5ChangeNameBirthdayMutation.graphql.js | 4 +- ...Test6ChangeNameBirthdayMutation.graphql.js | 4 +- ...Test7ChangeNameBirthdayMutation.graphql.js | 4 +- ...ngeNameBirthdayWithNameMutation.graphql.js | 6 +- ...nTest9ChangeNameIncludeMutation.graphql.js | 6 +- ...idateMutationTestFlightMutation.graphql.js | 12 +- ...tationTestIsActorInlineMutation.graphql.js | 14 +- ...dateMutationTestIsActorMutation.graphql.js | 14 +- ...tIsEntityInlineFragmentMutation.graphql.js | 10 +- ...tIsEntitySpreadFragmentMutation.graphql.js | 10 +- ...estIsNodeInlineFragmentMutation.graphql.js | 8 +- ...utationTestIsNodeSpreadMutation.graphql.js | 8 +- .../GraphQLTagTest1Query.graphql.js | 4 +- .../GraphQLTagTest3UserFragment.graphql.js | 6 +- .../GraphQLTagTest6UserFragment.graphql.js | 6 +- ...agTestUserFragment1RefetchQuery.graphql.js | 4 +- ...agTestUserFragment2RefetchQuery.graphql.js | 4 +- ...agTestUserFragment3RefetchQuery.graphql.js | 4 +- ...agTestUserFragment4RefetchQuery.graphql.js | 4 +- .../fetchQueryDEPRECATEDTestQuery.graphql.js | 4 +- .../fetchQueryInternalTest1Query.graphql.js | 4 +- .../fetchQueryInternalTest2Query.graphql.js | 4 +- .../fetchQueryInternalTest3Query.graphql.js | 4 +- ...ernalTestMarkdown1Fragment_name.graphql.js | 6 +- ...ternalTestMarkdownFragment_name.graphql.js | 6 +- ...InternalTestPlain1Fragment_name.graphql.js | 4 +- ...yInternalTestPlainFragment_name.graphql.js | 4 +- .../fetchQueryTest1Query.graphql.js | 4 +- .../fetchQueryTest2Query.graphql.js | 4 +- .../fetchQueryTest3Query.graphql.js | 4 +- .../fetchQueryTest4Query.graphql.js | 4 +- .../DataCheckerTest10Fragment.graphql.js | 4 +- .../DataCheckerTest10Query.graphql.js | 4 +- .../DataCheckerTest13Fragment.graphql.js | 4 +- .../DataCheckerTest14Fragment.graphql.js | 26 +- .../DataCheckerTest1Query.graphql.js | 4 +- .../DataCheckerTest2Query.graphql.js | 4 +- .../DataCheckerTest3Query.graphql.js | 4 +- .../DataCheckerTest4Query.graphql.js | 4 +- ...t5MarkdownUserNameRenderer_name.graphql.js | 4 +- ...Test5PlainUserNameRenderer_name.graphql.js | 4 +- .../DataCheckerTest5Query.graphql.js | 4 +- .../DataCheckerTest6Query.graphql.js | 4 +- .../DataCheckerTest7Fragment.graphql.js | 4 +- .../DataCheckerTest7Query.graphql.js | 4 +- .../DataCheckerTest8Fragment.graphql.js | 4 +- .../DataCheckerTest8Query.graphql.js | 4 +- .../DataCheckerTest9Fragment.graphql.js | 4 +- .../DataCheckerTest9Query.graphql.js | 4 +- .../DataCheckerTestFlightQuery.graphql.js | 6 +- .../DataCheckerTestFragment.graphql.js | 6 +- .../DataCheckerTestInnerQuery.graphql.js | 4 +- ...wnUserNameRenderer_nameFragment.graphql.js | 4 +- ...inUserNameRenderer_nameFragment.graphql.js | 4 +- .../DataCheckerTestQuery.graphql.js | 8 +- ...elayConcreteVariablesTest1Query.graphql.js | 4 +- ...elayConcreteVariablesTest2Query.graphql.js | 6 +- ...ponseHandlerTestNullLinkedQuery.graphql.js | 4 +- ...nseHandlerTestPluralLinkedQuery.graphql.js | 4 +- ...nseHandlerTestPluralScalarQuery.graphql.js | 4 +- ...alGraphResponseHandlerTestQuery.graphql.js | 4 +- ...onseTransformTestConditionQuery.graphql.js | 6 +- ...ResponseTransformTestDupesQuery.graphql.js | 10 +- ...nseTransformTestEmptyChunkQuery.graphql.js | 8 +- ...TestFragmentSpreadNoInlineQuery.graphql.js | 4 +- ...ransformTestFragmentSpreadQuery.graphql.js | 4 +- ...eTransformTestHandleFieldsQuery.graphql.js | 6 +- ...InlineFragmentAbstractTypeQuery.graphql.js | 6 +- ...ransformTestInlineFragmentQuery.graphql.js | 4 +- ...esponseTransformTestNestedQuery.graphql.js | 4 +- ...nseTransformTestNullLinkedQuery.graphql.js | 4 +- ...eTransformTestPluralLinkedQuery.graphql.js | 4 +- ...eTransformTestPluralScalarQuery.graphql.js | 4 +- ...GraphResponseTransformTestQuery.graphql.js | 4 +- ...nmentApplyMutationTest1Mutation.graphql.js | 6 +- ...ironmentApplyMutationTest1Query.graphql.js | 4 +- ...onmentApplyMutationTestFragment.graphql.js | 4 +- ...onmentApplyMutationTestMutation.graphql.js | 8 +- ...nmentApplyUpdateTestParentQuery.graphql.js | 4 +- ...EnvironmentCheckTestParentQuery.graphql.js | 4 +- ...ModernEnvironmentCheckTestQuery.graphql.js | 4 +- ...balInvalidationTest1ParentQuery.graphql.js | 4 +- ...balInvalidationTest2ParentQuery.graphql.js | 4 +- ...calInvalidationTest1ParentQuery.graphql.js | 4 +- ...calInvalidationTest2ParentQuery.graphql.js | 4 +- ...entCommitPayloadTest2ActorQuery.graphql.js | 6 +- ...entCommitPayloadTest3ActorQuery.graphql.js | 6 +- ...entCommitPayloadTest4ActorQuery.graphql.js | 4 +- ...entCommitPayloadTest6ActorQuery.graphql.js | 4 +- ...t6MarkdownUserNameRenderer_name.graphql.js | 4 +- ...mentCommitPayloadTestActorQuery.graphql.js | 4 +- ...mentCommitUpdateTestParentQuery.graphql.js | 4 +- ...lSelectionsTestConditionalQuery.graphql.js | 4 +- ...onsTestQueryConditionalFragment.graphql.js | 8 +- ...sTestQueryUnconditionalFragment.graphql.js | 8 +- ...electionsTestUnconditionalQuery.graphql.js | 4 +- ...AndRequiredTestFeedbackFragment.graphql.js | 4 +- ...ionAndRequiredTestFeedbackQuery.graphql.js | 4 +- ...tConnectionTestFeedbackFragment.graphql.js | 4 +- ...mentConnectionTestFeedbackQuery.graphql.js | 4 +- ...ntConnectionTestPaginationQuery.graphql.js | 6 +- ...nnectionKeyTestFeedbackFragment.graphql.js | 4 +- ...cConnectionKeyTestFeedbackQuery.graphql.js | 6 +- ...onnectionKeyTestPaginationQuery.graphql.js | 6 +- ...cuteMutationTestCommentFragment.graphql.js | 4 +- ...ExecuteMutationTestCommentQuery.graphql.js | 4 +- ...tationTestCreateCommentMutation.graphql.js | 8 +- ...CreateCommentWithSpreadMutation.graphql.js | 6 +- ...ationTestAppendComment2Mutation.graphql.js | 6 +- ...tationTestAppendCommentMutation.graphql.js | 6 +- ...dCommentWithLiteralEdgeMutation.graphql.js | 6 +- ...tionTestAppendComments3Mutation.graphql.js | 6 +- ...ationTestAppendCommentsMutation.graphql.js | 6 +- ...rativeMutationTestComment1Query.graphql.js | 6 +- ...arativeMutationTestCommentQuery.graphql.js | 6 +- ...ationTestDeleteComment1Mutation.graphql.js | 4 +- ...tationTestDeleteCommentMutation.graphql.js | 4 +- ...nTestDeleteCommentsEdgeMutation.graphql.js | 4 +- ...ationTestDeleteCommentsMutation.graphql.js | 4 +- ...ativeMutationTestFeedback2Query.graphql.js | 4 +- ...ativeMutationTestFeedback3Query.graphql.js | 4 +- ...tionTestPrependComment3Mutation.graphql.js | 6 +- ...ationTestPrependCommentMutation.graphql.js | 6 +- ...ionTestPrependComments2Mutation.graphql.js | 6 +- ...tionTestPrependCommentsMutation.graphql.js | 6 +- ...ationWithFlightTest_FlightQuery.graphql.js | 6 +- ...tationWithFlightTest_InnerQuery.graphql.js | 4 +- ...hFlightTest_UpdateStoryMutation.graphql.js | 12 +- ...InvalidationTestCommentFragment.graphql.js | 4 +- ...balInvalidationTestCommentQuery.graphql.js | 4 +- ...dationTestCreateCommentMutation.graphql.js | 8 +- ...InvalidationTestCommentFragment.graphql.js | 4 +- ...calInvalidationTestCommentQuery.graphql.js | 4 +- ...dationTestCreateCommentMutation.graphql.js | 8 +- ...ionWithMatchTestCommentFragment.graphql.js | 4 +- ...tationWithMatchTestCommentQuery.graphql.js | 4 +- ...hMatchTestCreateCommentMutation.graphql.js | 6 +- ...stMarkdownUserNameRenderer_name.graphql.js | 6 +- ...hTestPlainUserNameRenderer_name.graphql.js | 4 +- ...onTestCommentCreateSubscription.graphql.js | 6 +- ...SubscriptionTestCommentFragment.graphql.js | 4 +- ...uteSubscriptionTestCommentQuery.graphql.js | 4 +- ...erTestCommentCreateSubscription.graphql.js | 4 +- ...ionWithDeferTestCommentFragment.graphql.js | 4 +- ...iptionWithDeferTestCommentQuery.graphql.js | 4 +- ...chTestCommentCreateSubscription.graphql.js | 4 +- ...ionWithMatchTestCommentFragment.graphql.js | 4 +- ...iptionWithMatchTestCommentQuery.graphql.js | 4 +- ...stMarkdownUserNameRenderer_name.graphql.js | 6 +- ...hTestPlainUserNameRenderer_name.graphql.js | 4 +- ...amTestCommentCreateSubscription.graphql.js | 4 +- ...nWithStreamTestFeedbackFragment.graphql.js | 4 +- ...tionWithStreamTestFeedbackQuery.graphql.js | 4 +- ...cuteWithDeferAndModuleTestQuery.graphql.js | 4 +- ...ntExecuteWithDeferTestUserQuery.graphql.js | 4 +- ...hDeferWithinModuleTestUserQuery.graphql.js | 4 +- ...eamedConnectionTestFeedFragment.graphql.js | 6 +- ...StreamedConnectionTestFeedQuery.graphql.js | 6 +- ...ndClientFragmentTestFlightQuery.graphql.js | 6 +- ...AndClientFragmentTestInnerQuery.graphql.js | 4 +- ...ientFragmentTest_clientFragment.graphql.js | 4 +- ...xecuteWithFlightTestFlightQuery.graphql.js | 6 +- ...ExecuteWithFlightTestInnerQuery.graphql.js | 4 +- ...HandlerAndUpdaterTestActorQuery.graphql.js | 4 +- ...stMarkdownUserNameRenderer_name.graphql.js | 6 +- ...sTestPlainUserNameRenderer_name.graphql.js | 4 +- ...dditionalArgumentsTestUserQuery.graphql.js | 4 +- ...stMarkdownUserNameRenderer_name.graphql.js | 6 +- ...hTestPlainUserNameRenderer_name.graphql.js | 4 +- ...ntExecuteWithMatchTestUserQuery.graphql.js | 8 +- ...nConcreteFieldTestFeedbackQuery.graphql.js | 4 +- ...stMarkdownUserNameRenderer_name.graphql.js | 6 +- ...eTestPlainUserNameRenderer_name.graphql.js | 4 +- ...tExecuteWithModuleTestUserQuery.graphql.js | 4 +- ...stMarkdownUserNameRenderer_name.graphql.js | 6 +- ...yTestPlainUserNameRenderer_name.graphql.js | 4 +- ...eWithModuleWithKeyTestUserQuery.graphql.js | 4 +- ...stMarkdownUserNameRenderer_name.graphql.js | 6 +- ...hTestPlainUserNameRenderer_name.graphql.js | 4 +- ...uteWithNestedMatchTestUserQuery.graphql.js | 4 +- ...ithNestedStreamTestFeedFragment.graphql.js | 4 +- ...teWithNestedStreamTestFeedQuery.graphql.js | 4 +- ...eWithObservableNetworkTestQuery.graphql.js | 4 +- ...timisticResponseTestActor2Query.graphql.js | 6 +- ...ptimisticResponseTestActorQuery.graphql.js | 4 +- ...OverlappingModuleTestActorQuery.graphql.js | 4 +- ...tMarkdownActorNameRenderer_name.graphql.js | 6 +- ...stMarkdownUserNameRenderer_name.graphql.js | 6 +- ...eTestPlainUserNameRenderer_name.graphql.js | 4 +- ...eWithOverlappingModuleTestQuery.graphql.js | 4 +- ...ppingStreamTestFeedbackFragment.graphql.js | 4 +- ...rlappingStreamTestFeedbackQuery.graphql.js | 6 +- ...stMarkdownUserNameRenderer_name.graphql.js | 6 +- ...hTestPlainUserNameRenderer_name.graphql.js | 4 +- ...uteWithPluralMatchTestUserQuery.graphql.js | 4 +- ...ithPromiseNetworkTestActorQuery.graphql.js | 4 +- ...eTest_UserArgManyFragmentsQuery.graphql.js | 10 +- ...Test_UserArgSingleFragmentQuery.graphql.js | 4 +- ...thProvidedVariableTest_profile1.graphql.js | 4 +- ...thProvidedVariableTest_profile2.graphql.js | 4 +- ...thRelayClientComponentTestQuery.graphql.js | 4 +- ...entComponentTest_clientFragment.graphql.js | 4 +- ...stMarkdownUserNameRenderer_name.graphql.js | 6 +- ...ingAndNestedModuleTestUserQuery.graphql.js | 4 +- ...ExecuteWithSourceTestActorQuery.graphql.js | 4 +- ...AndRequiredTestFeedbackFragment.graphql.js | 4 +- ...eamAndRequiredTestFeedbackQuery.graphql.js | 6 +- ...eWithStreamTestFeedbackFragment.graphql.js | 4 +- ...cuteWithStreamTestFeedbackQuery.graphql.js | 6 +- ...WithHandlerTestFeedbackFragment.graphql.js | 4 +- ...eamWithHandlerTestFeedbackQuery.graphql.js | 6 +- ...eamedConnectionTestFeedFragment.graphql.js | 6 +- ...StreamedConnectionTestFeedQuery.graphql.js | 6 +- ...FragmentArgumentDefinitionQuery.graphql.js | 4 +- ...nvironmentLookupTestParentQuery.graphql.js | 4 +- ...odernEnvironmentLookupTestQuery.graphql.js | 6 +- ...NoInlineTestDeferredStreamQuery.graphql.js | 4 +- ...leMarkdownUserNameRenderer_name.graphql.js | 4 +- ...ironmentNoInlineTestModuleQuery.graphql.js | 4 +- ...ironmentNoInlineTestNestedQuery.graphql.js | 4 +- ...ernEnvironmentNoInlineTestQuery.graphql.js | 8 +- ...ironmentNoInlineTestStreamQuery.graphql.js | 4 +- ...onmentNoInlineTestWithArgsQuery.graphql.js | 8 +- ...InlineTest_nestedNoInlineParent.graphql.js | 8 +- ...BatchedUpdatesTestDeferredQuery.graphql.js | 4 +- ...hedUpdatesTestNestedModuleQuery.graphql.js | 4 +- ...chedUpdatesTestNonDeferredQuery.graphql.js | 6 +- ...edUpdatesTest_observation_query.graphql.js | 4 +- ...eryCacheExpirationTimeTestQuery.graphql.js | 4 +- ...odernEnvironmentRetainTestQuery.graphql.js | 4 +- ...ronmentSubscribeTestParentQuery.graphql.js | 4 +- ...ronmentTypeRefinementTest1Query.graphql.js | 4 +- ...ronmentTypeRefinementTest2Query.graphql.js | 4 +- ...ronmentTypeRefinementTest3Query.graphql.js | 4 +- ...ronmentTypeRefinementTest4Query.graphql.js | 4 +- ...ronmentTypeRefinementTest5Query.graphql.js | 4 +- ...ronmentTypeRefinementTest6Query.graphql.js | 4 +- ...nementTestAbstractActorFragment.graphql.js | 4 +- ...bstractInlineRefinementFragment.graphql.js | 4 +- ...TypeRefinementTestAbstractQuery.graphql.js | 4 +- ...oncreteInlineRefinementFragment.graphql.js | 4 +- ...TypeRefinementTestConcreteQuery.graphql.js | 4 +- ...inementTestConcreteUserFragment.graphql.js | 4 +- ...ntTypeRefinementTestParentQuery.graphql.js | 4 +- ...odernEnvironmentViewerTestQuery.graphql.js | 4 +- ...tViewerTest_SetLocationMutation.graphql.js | 6 +- ...thOperationTrackerTest1Mutation.graphql.js | 8 +- ...tWithOperationTrackerTest1Query.graphql.js | 6 +- ...tWithOperationTrackerTest2Query.graphql.js | 4 +- ...tionTrackerTestFeedbackFragment.graphql.js | 10 +- ...stMarkdownUserNameRenderer_name.graphql.js | 4 +- ...ithOperationTrackerTestMutation.graphql.js | 6 +- ...rTestPlainUserNameRenderer_name.graphql.js | 4 +- ...ntWithOperationTrackerTestQuery.graphql.js | 4 +- ...edFieldNoLoggerTestUserFragment.graphql.js | 4 +- ...uiredFieldNoLoggerTestUserQuery.graphql.js | 4 +- ...erRequiredFieldTestUserFragment.graphql.js | 4 +- ...olverRequiredFieldTestUserQuery.graphql.js | 4 +- ...tSpecResolverTestAffectingQuery.graphql.js | 6 +- ...rnFragmentSpecResolverTestQuery.graphql.js | 6 +- ...hFragmentOwnershipTestUserQuery.graphql.js | 6 +- ...elayModernSelectorTestUserQuery.graphql.js | 6 +- ...StoreSubscriptionsTest1Fragment.graphql.js | 4 +- ...ernStoreSubscriptionsTest1Query.graphql.js | 4 +- ...StoreSubscriptionsTest2Fragment.graphql.js | 4 +- ...ernStoreSubscriptionsTest2Query.graphql.js | 4 +- .../RelayModernStoreTest1Query.graphql.js | 4 +- .../RelayModernStoreTest2Query.graphql.js | 4 +- .../RelayModernStoreTest3Query.graphql.js | 4 +- .../RelayModernStoreTest4Query.graphql.js | 4 +- .../RelayModernStoreTest5Fragment.graphql.js | 4 +- .../RelayModernStoreTest5Query.graphql.js | 4 +- .../RelayModernStoreTest6Fragment.graphql.js | 4 +- .../RelayModernStoreTest6Query.graphql.js | 4 +- .../RelayModernStoreTest7Query.graphql.js | 4 +- .../RelayModernStoreTest8Query.graphql.js | 4 +- .../RelayModernStoreTest9Query.graphql.js | 4 +- .../RelayModernStoreTestJoeQuery.graphql.js | 4 +- ...ayOperationTrackerTest1Mutation.graphql.js | 6 +- ...RelayOperationTrackerTest1Query.graphql.js | 4 +- ...ayOperationTrackerTest2Mutation.graphql.js | 4 +- ...RelayOperationTrackerTest2Query.graphql.js | 4 +- .../RelayPublishQueueTest10Query.graphql.js | 4 +- .../RelayPublishQueueTest11Query.graphql.js | 4 +- .../RelayPublishQueueTest1Mutation.graphql.js | 4 +- .../RelayPublishQueueTest1Query.graphql.js | 4 +- .../RelayPublishQueueTest2Mutation.graphql.js | 4 +- .../RelayPublishQueueTest2Query.graphql.js | 4 +- .../RelayPublishQueueTest3Mutation.graphql.js | 4 +- .../RelayPublishQueueTest3Query.graphql.js | 4 +- .../RelayPublishQueueTest4Mutation.graphql.js | 4 +- .../RelayPublishQueueTest4Query.graphql.js | 4 +- .../RelayPublishQueueTest5Query.graphql.js | 4 +- .../RelayPublishQueueTest6Query.graphql.js | 4 +- .../RelayPublishQueueTest7Query.graphql.js | 4 +- .../RelayPublishQueueTest8Query.graphql.js | 4 +- .../RelayPublishQueueTest9Query.graphql.js | 4 +- ...ReaderRequiredFieldsTest10Query.graphql.js | 4 +- ...ReaderRequiredFieldsTest11Query.graphql.js | 4 +- ...ReaderRequiredFieldsTest12Query.graphql.js | 4 +- ...ReaderRequiredFieldsTest13Query.graphql.js | 6 +- ...ReaderRequiredFieldsTest14Query.graphql.js | 4 +- ...ReaderRequiredFieldsTest15Query.graphql.js | 4 +- ...ReaderRequiredFieldsTest16Query.graphql.js | 4 +- ...ReaderRequiredFieldsTest17Query.graphql.js | 4 +- ...ReaderRequiredFieldsTest18Query.graphql.js | 4 +- ...ReaderRequiredFieldsTest19Query.graphql.js | 4 +- ...ReaderRequiredFieldsTest20Query.graphql.js | 4 +- ...ReaderRequiredFieldsTest21Query.graphql.js | 4 +- ...ReaderRequiredFieldsTest22Query.graphql.js | 4 +- ...ReaderRequiredFieldsTest23Query.graphql.js | 4 +- ...yReaderRequiredFieldsTest2Query.graphql.js | 4 +- ...yReaderRequiredFieldsTest3Query.graphql.js | 4 +- ...yReaderRequiredFieldsTest4Query.graphql.js | 6 +- ...yReaderRequiredFieldsTest5Query.graphql.js | 4 +- ...yReaderRequiredFieldsTest6Query.graphql.js | 4 +- ...yReaderRequiredFieldsTest7Query.graphql.js | 4 +- ...yReaderRequiredFieldsTest8Query.graphql.js | 4 +- ...yReaderRequiredFieldsTest9Query.graphql.js | 4 +- ...RelayReaderTestActorChangeQuery.graphql.js | 4 +- ...rWhenOwnerIsProvidedParentQuery.graphql.js | 4 +- ...rsWithLiteralArgumentsUserQuery.graphql.js | 4 +- ...sWithVariableArgumentsUserQuery.graphql.js | 4 +- ...AbstractTypeDiscriminatorsQuery.graphql.js | 4 +- ...FlightComponentFieldFlightQuery.graphql.js | 6 +- ...ayReaderTestReadScalarUserQuery.graphql.js | 4 +- ...TestReadsBasicFragmentUserQuery.graphql.js | 4 +- ...elayReaderTestReadsFragmentData.graphql.js | 6 +- ...rTestReadsFragmentDataUserQuery.graphql.js | 4 +- ...ryRootFragmentsUserFriendsQuery.graphql.js | 4 +- ...eaderTestReadsQueryDataFooQuery.graphql.js | 8 +- ...mentIsConcreteButOnTheRootQuery.graphql.js | 4 +- ...ragmentTypeIsAbstractActorQuery.graphql.js | 4 +- ...lseIfDataIsAvailableUserFriends.graphql.js | 4 +- ...FalseIfDataIsAvailableUserQuery.graphql.js | 4 +- ...gdataTrueIfDataIsMissingAddress.graphql.js | 4 +- ...MissingForConnectionUserFriends.graphql.js | 4 +- ...rEdgeInTheConnectionUserFriends.graphql.js | 4 +- ...ForEdgeInTheConnectionUserQuery.graphql.js | 4 +- ...taIsMissingInTheNodeUserFriends.graphql.js | 4 +- ...ataTrueIfDataIsMissingUserQuery.graphql.js | 4 +- ...peDoesNotMatchTheDataActorQuery.graphql.js | 4 +- ...ieldsAreClientFieldsUserProfile.graphql.js | 32 +- ...gFieldsAreClientFieldsUserQuery.graphql.js | 4 +- ...erTestStreamConnectionUserQuery.graphql.js | 4 +- ...MatchDirectiveIsPresentBarQuery.graphql.js | 4 +- ...ectiveIsPresentNoModuleBarQuery.graphql.js | 4 +- ...layReferenceMarkerTest1Fragment.graphql.js | 4 +- .../RelayReferenceMarkerTest1Query.graphql.js | 6 +- ...layReferenceMarkerTest2Fragment.graphql.js | 18 +- ...t2MarkdownUserNameRenderer_name.graphql.js | 4 +- ...Test2PlainUserNameRenderer_name.graphql.js | 4 +- .../RelayReferenceMarkerTest2Query.graphql.js | 4 +- .../RelayReferenceMarkerTest3Query.graphql.js | 4 +- .../RelayReferenceMarkerTest4Query.graphql.js | 6 +- ...layReferenceMarkerTest5Fragment.graphql.js | 4 +- .../RelayReferenceMarkerTest5Query.graphql.js | 4 +- ...layReferenceMarkerTest6Fragment.graphql.js | 4 +- .../RelayReferenceMarkerTest6Query.graphql.js | 4 +- .../RelayReferenceMarkerTest7Query.graphql.js | 4 +- .../RelayReferenceMarkerTest8Query.graphql.js | 4 +- ...yReferenceMarkerTestFlightQuery.graphql.js | 6 +- ...ayReferenceMarkerTestInnerQuery.graphql.js | 4 +- ...stMarkdownUserNameRenderer_name.graphql.js | 4 +- ...rTestPlainUserNameRenderer_name.graphql.js | 4 +- ...esponseNormalizerTest10Fragment.graphql.js | 6 +- ...ayResponseNormalizerTest10Query.graphql.js | 4 +- ...esponseNormalizerTest11Fragment.graphql.js | 4 +- ...ayResponseNormalizerTest11Query.graphql.js | 6 +- ...ayResponseNormalizerTest12Query.graphql.js | 6 +- ...ayResponseNormalizerTest13Query.graphql.js | 4 +- ...ayResponseNormalizerTest14Query.graphql.js | 4 +- ...ayResponseNormalizerTest15Query.graphql.js | 10 +- ...ayResponseNormalizerTest16Query.graphql.js | 4 +- ...ayResponseNormalizerTest17Query.graphql.js | 4 +- ...ayResponseNormalizerTest18Query.graphql.js | 8 +- ...ayResponseNormalizerTest19Query.graphql.js | 8 +- ...t1MarkdownUserNameRenderer_name.graphql.js | 4 +- ...Test1PlainUserNameRenderer_name.graphql.js | 4 +- ...layResponseNormalizerTest1Query.graphql.js | 8 +- ...ayResponseNormalizerTest20Query.graphql.js | 6 +- ...ayResponseNormalizerTest21Query.graphql.js | 6 +- ...ayResponseNormalizerTest22Query.graphql.js | 10 +- ...ayResponseNormalizerTest23Query.graphql.js | 10 +- ...ayResponseNormalizerTest24Query.graphql.js | 10 +- ...ayResponseNormalizerTest25Query.graphql.js | 14 +- ...ayResponseNormalizerTest26Query.graphql.js | 14 +- ...ayResponseNormalizerTest27Query.graphql.js | 10 +- ...ayResponseNormalizerTest28Query.graphql.js | 10 +- ...ayResponseNormalizerTest29Query.graphql.js | 6 +- ...layResponseNormalizerTest2Query.graphql.js | 6 +- ...ayResponseNormalizerTest30Query.graphql.js | 4 +- ...ayResponseNormalizerTest31Query.graphql.js | 4 +- ...ayResponseNormalizerTest32Query.graphql.js | 10 +- ...ayResponseNormalizerTest33Query.graphql.js | 6 +- ...ayResponseNormalizerTest34Query.graphql.js | 8 +- ...ayResponseNormalizerTest35Query.graphql.js | 10 +- ...layResponseNormalizerTest3Query.graphql.js | 10 +- ...layResponseNormalizerTest4Query.graphql.js | 4 +- ...layResponseNormalizerTest5Query.graphql.js | 4 +- ...layResponseNormalizerTest6Query.graphql.js | 6 +- ...ResponseNormalizerTest7Fragment.graphql.js | 4 +- ...layResponseNormalizerTest7Query.graphql.js | 4 +- ...ResponseNormalizerTest8Fragment.graphql.js | 4 +- ...layResponseNormalizerTest8Query.graphql.js | 6 +- ...ResponseNormalizerTest9Fragment.graphql.js | 4 +- ...layResponseNormalizerTest9Query.graphql.js | 4 +- ...eNormalizerTestActorChangeQuery.graphql.js | 4 +- ...erTestActorChangeWithAliasQuery.graphql.js | 10 +- ...sponseNormalizerTestFlightQuery.graphql.js | 6 +- ...stMarkdownUserNameRenderer_name.graphql.js | 4 +- ...rTestPlainUserNameRenderer_name.graphql.js | 4 +- ...elayResponseNormalizerTestQuery.graphql.js | 4 +- ...rmalizerTestServerOrClientQuery.graphql.js | 4 +- ...onseNormalizerTestStrippedQuery.graphql.js | 8 +- ...seNormalizerTest_clientFragment.graphql.js | 4 +- ...sponseNormalizerTest_pvFragment.graphql.js | 4 +- ...yResponseNormalizerTest_pvQuery.graphql.js | 8 +- .../RelayStoreUtilsTest1Query.graphql.js | 4 +- .../RelayStoreUtilsTest2Query.graphql.js | 4 +- .../RelayStoreUtilsTest3Query.graphql.js | 4 +- .../RelayStoreUtilsTest4Query.graphql.js | 4 +- .../RelayStoreUtilsTest5Query.graphql.js | 4 +- ...yHandleSourceFieldTestTestQuery.graphql.js | 4 +- ...calarHandleSourceFieldTestQuery.graphql.js | 4 +- .../readInlineDataTestUserQuery.graphql.js | 4 +- ...nTest1CommentCreateSubscription.graphql.js | 6 +- ...onTestCommentCreateSubscription.graphql.js | 6 +- ...ionTestConfigCreateSubscription.graphql.js | 4 +- ...estSubscriptionTestConfigsQuery.graphql.js | 4 +- ...riptionTestFeedbackCommentQuery.graphql.js | 6 +- ...nTestPlainUserNameRenderer_name.graphql.js | 4 +- ...estSubscriptionTestSubscription.graphql.js | 4 +- ...ragmentIdentifierTest1UserQuery.graphql.js | 4 +- ...fierTest1UserQueryWithArgsQuery.graphql.js | 4 +- ...agmentIdentifierTest1UsersQuery.graphql.js | 4 +- ...FragmentIdentifierTestUserQuery.graphql.js | 4 +- ...ifierTestUserQueryWithArgsQuery.graphql.js | 4 +- ...ragmentIdentifierTestUsersQuery.graphql.js | 4 +- ...withProvidedVariablesTest1Query.graphql.js | 4 +- ...withProvidedVariablesTest2Query.graphql.js | 4 +- ...hProvidedVariablesTest3Fragment.graphql.js | 4 +- ...withProvidedVariablesTest3Query.graphql.js | 10 +- ...withProvidedVariablesTest4Query.graphql.js | 10 +- ...hProvidedVariablesTest5Fragment.graphql.js | 6 +- ...withProvidedVariablesTest5Query.graphql.js | 4 +- ...withProvidedVariablesTest6Query.graphql.js | 4 +- .../RelayMockEnvironmentTestQuery.graphql.js | 4 +- ...tsTestDisruptiveSuccessMutation.graphql.js | 6 +- ...nentsTestExceptionalImpactQuery.graphql.js | 8 +- ...ponentsTestFantasticEffortQuery.graphql.js | 4 +- ...estImpactfulAwesomenessFragment.graphql.js | 4 +- ...sTestImpossibleAwesomenessQuery.graphql.js | 4 +- ...onentsTestImpressiveResultQuery.graphql.js | 4 +- ...ntsTestNoticeableResultFragment.graphql.js | 4 +- ...nentsTestNoticeableSuccessQuery.graphql.js | 8 +- ...ntsTestOutstandingSolutionQuery.graphql.js | 4 +- ...entsTestRedefiningSolutionQuery.graphql.js | 4 +- ...tsTestRemarkableFixSubscription.graphql.js | 6 +- ...onentsTestRemarkableImpactQuery.graphql.js | 4 +- ...tsTestRobustAwesomenessFragment.graphql.js | 4 +- ...onentsTestSwiftPerformanceQuery.graphql.js | 4 +- ...sTestWorldClassAwesomenessQuery.graphql.js | 4 +- ...nentsTestWorldClassFeatureQuery.graphql.js | 4 +- ...kPayloadGeneratorTest10Fragment.graphql.js | 6 +- ...MockPayloadGeneratorTest10Query.graphql.js | 4 +- ...kPayloadGeneratorTest11Fragment.graphql.js | 4 +- ...MockPayloadGeneratorTest11Query.graphql.js | 4 +- ...kPayloadGeneratorTest12Fragment.graphql.js | 18 +- ...MockPayloadGeneratorTest12Query.graphql.js | 4 +- ...kPayloadGeneratorTest13Fragment.graphql.js | 8 +- ...MockPayloadGeneratorTest13Query.graphql.js | 4 +- ...kPayloadGeneratorTest14Fragment.graphql.js | 8 +- ...MockPayloadGeneratorTest14Query.graphql.js | 6 +- ...kPayloadGeneratorTest15Fragment.graphql.js | 4 +- ...MockPayloadGeneratorTest15Query.graphql.js | 4 +- ...kPayloadGeneratorTest16Fragment.graphql.js | 4 +- ...MockPayloadGeneratorTest16Query.graphql.js | 4 +- ...MockPayloadGeneratorTest17Query.graphql.js | 4 +- ...MockPayloadGeneratorTest18Query.graphql.js | 8 +- ...MockPayloadGeneratorTest19Query.graphql.js | 4 +- ...ckPayloadGeneratorTest1Fragment.graphql.js | 6 +- ...t1MarkdownUserNameRenderer_name.graphql.js | 4 +- ...Test1PlainUserNameRenderer_name.graphql.js | 4 +- ...yMockPayloadGeneratorTest1Query.graphql.js | 4 +- ...kPayloadGeneratorTest20Fragment.graphql.js | 10 +- ...MockPayloadGeneratorTest20Query.graphql.js | 8 +- ...MockPayloadGeneratorTest21Query.graphql.js | 4 +- ...kPayloadGeneratorTest22Fragment.graphql.js | 56 ++-- ...MockPayloadGeneratorTest22Query.graphql.js | 8 +- ...MockPayloadGeneratorTest23Query.graphql.js | 4 +- ...MockPayloadGeneratorTest24Query.graphql.js | 4 +- ...MockPayloadGeneratorTest25Query.graphql.js | 4 +- ...kPayloadGeneratorTest26Fragment.graphql.js | 4 +- ...MockPayloadGeneratorTest26Query.graphql.js | 4 +- ...kPayloadGeneratorTest27Fragment.graphql.js | 10 +- ...MockPayloadGeneratorTest27Query.graphql.js | 4 +- ...kPayloadGeneratorTest28Fragment.graphql.js | 4 +- ...MockPayloadGeneratorTest28Query.graphql.js | 4 +- ...MockPayloadGeneratorTest29Query.graphql.js | 6 +- ...ckPayloadGeneratorTest2Fragment.graphql.js | 14 +- ...yMockPayloadGeneratorTest2Query.graphql.js | 4 +- ...MockPayloadGeneratorTest30Query.graphql.js | 6 +- ...MockPayloadGeneratorTest31Query.graphql.js | 8 +- ...MockPayloadGeneratorTest32Query.graphql.js | 8 +- ...MockPayloadGeneratorTest33Query.graphql.js | 8 +- ...MockPayloadGeneratorTest34Query.graphql.js | 8 +- ...MockPayloadGeneratorTest35Query.graphql.js | 6 +- ...MockPayloadGeneratorTest36Query.graphql.js | 6 +- ...MockPayloadGeneratorTest37Query.graphql.js | 6 +- ...MockPayloadGeneratorTest38Query.graphql.js | 6 +- ...MockPayloadGeneratorTest39Query.graphql.js | 8 +- ...ckPayloadGeneratorTest3Fragment.graphql.js | 36 +-- ...t3MarkdownUserNameRenderer_name.graphql.js | 4 +- ...Test3PlainUserNameRenderer_name.graphql.js | 4 +- ...yMockPayloadGeneratorTest3Query.graphql.js | 4 +- ...MockPayloadGeneratorTest40Query.graphql.js | 6 +- ...MockPayloadGeneratorTest41Query.graphql.js | 8 +- ...MockPayloadGeneratorTest42Query.graphql.js | 8 +- ...MockPayloadGeneratorTest43Query.graphql.js | 8 +- ...MockPayloadGeneratorTest44Query.graphql.js | 4 +- ...MockPayloadGeneratorTest45Query.graphql.js | 4 +- ...MockPayloadGeneratorTest46Query.graphql.js | 4 +- ...MockPayloadGeneratorTest47Query.graphql.js | 4 +- ...MockPayloadGeneratorTest48Query.graphql.js | 4 +- ...ckPayloadGeneratorTest4Fragment.graphql.js | 4 +- ...t4MarkdownUserNameRenderer_name.graphql.js | 4 +- ...yMockPayloadGeneratorTest4Query.graphql.js | 8 +- ...ckPayloadGeneratorTest5Fragment.graphql.js | 10 +- ...t5MarkdownUserNameRenderer_name.graphql.js | 4 +- ...yMockPayloadGeneratorTest5Query.graphql.js | 4 +- ...ckPayloadGeneratorTest6Fragment.graphql.js | 6 +- ...yMockPayloadGeneratorTest6Query.graphql.js | 4 +- ...yMockPayloadGeneratorTest7Query.graphql.js | 4 +- ...ckPayloadGeneratorTest8Fragment.graphql.js | 4 +- ...yMockPayloadGeneratorTest8Query.graphql.js | 4 +- ...yMockPayloadGeneratorTest9Query.graphql.js | 4 +- ...ockPayloadGeneratorTestFragment.graphql.js | 4 +- ...stMarkdownUserNameRenderer_name.graphql.js | 4 +- 820 files changed, 3298 insertions(+), 3006 deletions(-) diff --git a/compiler/crates/relay-config/src/typegen_config.rs b/compiler/crates/relay-config/src/typegen_config.rs index 9aada6a6e2ee8..a5bdb7f9e0509 100644 --- a/compiler/crates/relay-config/src/typegen_config.rs +++ b/compiler/crates/relay-config/src/typegen_config.rs @@ -79,6 +79,12 @@ pub struct TypegenConfig { /// This option enables emitting es modules artifacts. #[serde(default)] pub eager_es_modules: bool, + + /// This option controls which emitted files have sorted fields, fragment names, + /// and union members. It also controls whether unions with more than one element + /// are written with surrounding parentheses. + #[serde(default)] + pub sort_typegen_items: SortTypegenItemsConfig, } #[derive(Debug, Serialize, Deserialize, Clone, Copy)] @@ -139,3 +145,15 @@ impl FlowTypegenPhase { } } } + +#[derive(Debug, Serialize, Deserialize, Clone, Copy, Default)] +pub struct SortTypegenItemsConfig { + #[serde(default)] + pub rollout: Rollout, +} + +impl SortTypegenItemsConfig { + pub fn should_sort(&self, rollout_key: StringKey) -> bool { + self.rollout.check(rollout_key.lookup()) + } +} diff --git a/compiler/crates/relay-typegen/src/flow.rs b/compiler/crates/relay-typegen/src/flow.rs index 1e31ed2075a3d..1f1e645449e01 100644 --- a/compiler/crates/relay-typegen/src/flow.rs +++ b/compiler/crates/relay-typegen/src/flow.rs @@ -17,6 +17,7 @@ pub struct FlowPrinter { result: String, indentation: usize, flow_typegen_phase: FlowTypegenPhase, + should_wrap_unions_in_parentheses: bool, } impl Write for FlowPrinter { @@ -42,6 +43,7 @@ impl Writer for FlowPrinter { AST::Identifier(identifier) => write!(&mut self.result, "{}", identifier), AST::RawType(raw) => write!(&mut self.result, "{}", raw), AST::Union(members) => self.write_union(members), + AST::Intersection(members) => self.write_intersection(members), AST::ReadOnlyArray(of_type) => self.write_read_only_array(of_type), AST::Nullable(of_type) => self.write_nullable(of_type), AST::NonNullable(of_type) => self.write_non_nullable(of_type), @@ -131,11 +133,15 @@ export type {old_name} = {new_name};", } impl FlowPrinter { - pub fn new(flow_typegen_phase: FlowTypegenPhase) -> Self { + pub fn new( + flow_typegen_phase: FlowTypegenPhase, + should_wrap_unions_in_parentheses: bool, + ) -> Self { Self { result: String::new(), indentation: 0, flow_typegen_phase, + should_wrap_unions_in_parentheses, } } @@ -152,6 +158,9 @@ impl FlowPrinter { } fn write_union(&mut self, members: &[AST]) -> FmtResult { + if members.len() > 1 && self.should_wrap_unions_in_parentheses { + write!(&mut self.result, "(")?; + } let mut first = true; for member in members { if first { @@ -161,6 +170,28 @@ impl FlowPrinter { } self.write(member)?; } + if members.len() > 1 && self.should_wrap_unions_in_parentheses { + write!(&mut self.result, ")")?; + } + Ok(()) + } + + fn write_intersection(&mut self, members: &[AST]) -> FmtResult { + if members.len() > 1 { + write!(&mut self.result, "(")?; + } + let mut first = true; + for member in members { + if first { + first = false; + } else { + write!(&mut self.result, " & ")?; + } + self.write(member)?; + } + if members.len() > 1 { + write!(&mut self.result, ")")?; + } Ok(()) } @@ -191,17 +222,7 @@ impl FlowPrinter { fn write_nullable(&mut self, of_type: &AST) -> FmtResult { write!(&mut self.result, "?")?; - match of_type { - AST::Union(members) if members.len() > 1 => { - write!(&mut self.result, "(")?; - self.write(of_type)?; - write!(&mut self.result, ")")?; - } - _ => { - self.write(of_type)?; - } - } - Ok(()) + self.write(of_type) } fn write_object(&mut self, props: &[Prop], exact: bool) -> FmtResult { @@ -312,13 +333,13 @@ impl FlowPrinter { #[cfg(test)] mod tests { - use crate::writer::KeyValuePairProp; + use crate::writer::{ExactObject, InexactObject, KeyValuePairProp}; use super::*; use intern::string_key::Intern; fn print_type(ast: &AST) -> String { - let mut printer = Box::new(FlowPrinter::new(FlowTypegenPhase::Final)); + let mut printer = Box::new(FlowPrinter::new(FlowTypegenPhase::Final, true)); printer.write(ast).unwrap(); printer.into_string() } @@ -334,7 +355,7 @@ mod tests { fn union_type() { assert_eq!( print_type(&AST::Union(vec![AST::String, AST::Number])), - "string | number".to_string() + "(string | number)".to_string() ); } @@ -365,42 +386,46 @@ mod tests { #[test] fn exact_object() { assert_eq!( - print_type(&AST::ExactObject(Vec::new())), + print_type(&AST::ExactObject(ExactObject::new(Vec::new(), true))), r"{||}".to_string() ); assert_eq!( - print_type(&AST::ExactObject(vec![Prop::KeyValuePair( - KeyValuePairProp { + print_type(&AST::ExactObject(ExactObject::new( + vec![Prop::KeyValuePair(KeyValuePairProp { key: "single".intern(), optional: false, read_only: false, value: AST::String, - } - ),])), + }),], + true + ))), r"{| single: string, |}" .to_string() ); assert_eq!( - print_type(&AST::ExactObject(vec![ - Prop::KeyValuePair(KeyValuePairProp { - key: "foo".intern(), - optional: true, - read_only: false, - value: AST::String, - }), - Prop::KeyValuePair(KeyValuePairProp { - key: "bar".intern(), - optional: false, - read_only: true, - value: AST::Number, - }), - ])), + print_type(&AST::ExactObject(ExactObject::new( + vec![ + Prop::KeyValuePair(KeyValuePairProp { + key: "foo".intern(), + optional: true, + read_only: false, + value: AST::String, + }), + Prop::KeyValuePair(KeyValuePairProp { + key: "bar".intern(), + optional: false, + read_only: true, + value: AST::Number, + }), + ], + true + ))), r"{| - foo?: string, +bar: number, + foo?: string, |}" .to_string() ); @@ -409,39 +434,45 @@ mod tests { #[test] fn nested_object() { assert_eq!( - print_type(&AST::ExactObject(vec![ - Prop::KeyValuePair(KeyValuePairProp { - key: "foo".intern(), - optional: true, - read_only: false, - value: AST::ExactObject(vec![ - Prop::KeyValuePair(KeyValuePairProp { - key: "nested_foo".intern(), - optional: true, - read_only: false, - value: AST::String, - }), - Prop::KeyValuePair(KeyValuePairProp { - key: "nested_foo2".intern(), - optional: false, - read_only: true, - value: AST::Number, - }), - ]), - }), - Prop::KeyValuePair(KeyValuePairProp { - key: "bar".intern(), - optional: false, - read_only: true, - value: AST::Number, - }), - ])), + print_type(&AST::ExactObject(ExactObject::new( + vec![ + Prop::KeyValuePair(KeyValuePairProp { + key: "foo".intern(), + optional: true, + read_only: false, + value: AST::ExactObject(ExactObject::new( + vec![ + Prop::KeyValuePair(KeyValuePairProp { + key: "nested_foo".intern(), + optional: true, + read_only: false, + value: AST::String, + }), + Prop::KeyValuePair(KeyValuePairProp { + key: "nested_foo2".intern(), + optional: false, + read_only: true, + value: AST::Number, + }), + ], + true + )), + }), + Prop::KeyValuePair(KeyValuePairProp { + key: "bar".intern(), + optional: false, + read_only: true, + value: AST::Number, + }), + ], + true + ))), r"{| + +bar: number, foo?: {| nested_foo?: string, +nested_foo2: number, |}, - +bar: number, |}" .to_string() ); @@ -450,7 +481,7 @@ mod tests { #[test] fn inexact_object() { assert_eq!( - print_type(&AST::InexactObject(Vec::new())), + print_type(&AST::InexactObject(InexactObject::new(Vec::new(), true))), r"{ ... }" @@ -458,14 +489,15 @@ mod tests { ); assert_eq!( - print_type(&AST::InexactObject(vec![Prop::KeyValuePair( - KeyValuePairProp { + print_type(&AST::InexactObject(InexactObject::new( + vec![Prop::KeyValuePair(KeyValuePairProp { key: "single".intern(), optional: false, read_only: false, value: AST::String, - } - ),])), + }),], + true + ))), r"{ single: string, ... @@ -474,23 +506,26 @@ mod tests { ); assert_eq!( - print_type(&AST::InexactObject(vec![ - Prop::KeyValuePair(KeyValuePairProp { - key: "foo".intern(), - optional: false, - read_only: false, - value: AST::String, - }), - Prop::KeyValuePair(KeyValuePairProp { - key: "bar".intern(), - optional: true, - read_only: true, - value: AST::Number, - }) - ])), + print_type(&AST::InexactObject(InexactObject::new( + vec![ + Prop::KeyValuePair(KeyValuePairProp { + key: "foo".intern(), + optional: false, + read_only: false, + value: AST::String, + }), + Prop::KeyValuePair(KeyValuePairProp { + key: "bar".intern(), + optional: true, + read_only: true, + value: AST::Number, + }) + ], + true + ))), r"{ - foo: string, +bar?: number, + foo: string, ... }" .to_string() @@ -500,14 +535,15 @@ mod tests { #[test] fn other_comment() { assert_eq!( - print_type(&AST::ExactObject(vec![Prop::KeyValuePair( - KeyValuePairProp { + print_type(&AST::ExactObject(ExactObject::new( + vec![Prop::KeyValuePair(KeyValuePairProp { key: "with_comment".intern(), optional: false, read_only: false, value: AST::OtherTypename, - } - ),])), + }),], + true + ))), r#"{| // This will never be '%other', but we need some // value in case none of the concrete values match. @@ -519,7 +555,7 @@ mod tests { #[test] fn import_type() { - let mut printer = Box::new(FlowPrinter::new(FlowTypegenPhase::Final)); + let mut printer = Box::new(FlowPrinter::new(FlowTypegenPhase::Final, true)); printer.write_import_type(&["A", "B"], "module").unwrap(); assert_eq!( printer.into_string(), @@ -529,7 +565,7 @@ mod tests { #[test] fn import_module() { - let mut printer = Box::new(FlowPrinter::new(FlowTypegenPhase::Final)); + let mut printer = Box::new(FlowPrinter::new(FlowTypegenPhase::Final, true)); printer.write_import_module_default("A", "module").unwrap(); assert_eq!(printer.into_string(), "import A from \"module\";\n"); } diff --git a/compiler/crates/relay-typegen/src/lib.rs b/compiler/crates/relay-typegen/src/lib.rs index 88b1e9c7049ac..8d694d88f2e66 100644 --- a/compiler/crates/relay-typegen/src/lib.rs +++ b/compiler/crates/relay-typegen/src/lib.rs @@ -13,14 +13,12 @@ mod flow; mod typescript; mod writer; -use crate::flow::FlowPrinter; -use crate::typescript::TypeScriptPrinter; -use crate::writer::{GetterSetterPairProp, KeyValuePairProp, SpreadProp, Writer}; use ::intern::{ intern, string_key::{Intern, StringKey}, }; use common::NamedItem; +use flow::FlowPrinter; use fnv::FnvHashSet; use graphql_ir::{ Condition, Directive, FragmentDefinition, FragmentSpread, InlineFragment, LinkedField, @@ -39,9 +37,12 @@ use relay_transforms::{ RELAY_ACTOR_CHANGE_DIRECTIVE_FOR_CODEGEN, UPDATABLE_DIRECTIVE, }; use schema::{EnumID, SDLSchema, ScalarID, Schema, Type, TypeReference}; -use std::hash::Hash; -use std::{fmt::Result as FmtResult, path::Path}; -use writer::{Prop, AST}; +use std::{fmt::Result as FmtResult, hash::Hash, path::Path}; +use typescript::TypeScriptPrinter; +use writer::{ + ExactObject, GetterSetterPairProp, InexactObject, KeyValuePairProp, Prop, SpreadProp, Writer, + AST, +}; static REACT_RELAY_MULTI_ACTOR: &str = "react-relay/multi-actor"; static RELAY_RUNTIME: &str = "relay-runtime"; @@ -192,6 +193,7 @@ struct TypeGenerator<'a> { has_actor_change: bool, flow_typegen_phase: FlowTypegenPhase, is_updatable_operation: bool, + should_sort_typegen_items: bool, } impl<'a> TypeGenerator<'a> { fn new( @@ -203,6 +205,7 @@ impl<'a> TypeGenerator<'a> { rollout_key: StringKey, ) -> Self { let flow_typegen_phase = typegen_config.flow_typegen.phase(rollout_key); + let should_sort_typegen_items = typegen_config.sort_typegen_items.should_sort(rollout_key); Self { schema, schema_config, @@ -218,12 +221,19 @@ impl<'a> TypeGenerator<'a> { match_fields: Default::default(), runtime_imports: RuntimeImports::default(), writer: match &typegen_config.language { - TypegenLanguage::Flow => Box::new(FlowPrinter::new(flow_typegen_phase)), - TypegenLanguage::TypeScript => Box::new(TypeScriptPrinter::new(typegen_config)), + TypegenLanguage::Flow => Box::new(FlowPrinter::new( + flow_typegen_phase, + should_sort_typegen_items, + )), + TypegenLanguage::TypeScript => Box::new(TypeScriptPrinter::new( + typegen_config, + should_sort_typegen_items, + )), }, has_actor_change: false, flow_typegen_phase, is_updatable_operation: false, + should_sort_typegen_items, } } @@ -394,7 +404,10 @@ impl<'a> TypeGenerator<'a> { }; self.writer.write_export_type( typegen_operation.name.item.lookup(), - &AST::ExactObject(operation_types), + &AST::ExactObject(ExactObject::new( + operation_types, + self.should_sort_typegen_items, + )), )?; self.generate_provided_variables_type(normalization_operation)?; @@ -468,10 +481,10 @@ impl<'a> TypeGenerator<'a> { value: AST::FragmentReference(vec![fragment_name]), }); let is_plural_fragment = is_plural(fragment_definition); - let mut ref_type = AST::InexactObject(vec![ - ref_type_data_property, - ref_type_fragment_spreads_property, - ]); + let mut ref_type = AST::InexactObject(InexactObject::new( + vec![ref_type_data_property, ref_type_fragment_spreads_property], + self.should_sort_typegen_items, + )); if is_plural_fragment { ref_type = AST::ReadOnlyArray(Box::new(ref_type)); } @@ -629,7 +642,6 @@ impl<'a> TypeGenerator<'a> { .entry(haste_import_name) .or_insert(local_resolver_name); - let inner_value = Box::new(AST::ReturnTypeOfFunctionWithName(local_resolver_name)); let value = if required { @@ -638,7 +650,6 @@ impl<'a> TypeGenerator<'a> { AST::Nullable(inner_value) }; - type_selections.push(TypeSelection::ScalarField(TypeSelectionScalarField { field_name_or_alias: key, special_field: None, @@ -975,9 +986,12 @@ impl<'a> TypeGenerator<'a> { })); } if unmasked { - AST::InexactObject(props) + AST::InexactObject(InexactObject::new( + props, + self.should_sort_typegen_items, + )) } else { - AST::ExactObject(props) + AST::ExactObject(ExactObject::new(props, self.should_sort_typegen_items)) } }) .collect(), @@ -1006,7 +1020,10 @@ impl<'a> TypeGenerator<'a> { if base_fields.is_empty() && by_concrete_type.is_empty() { // base fields and per-type fields are all empty: this can only occur bc the only selection was a // @no_inline fragment. in this case, emit a single, empty ExactObject since nothing was selected - return AST::ExactObject(Default::default()); + return AST::ExactObject(ExactObject::new( + Default::default(), + self.should_sort_typegen_items, + )); } let mut types: Vec = Vec::new(); @@ -1021,7 +1038,7 @@ impl<'a> TypeGenerator<'a> { false, ); let merged_selections: Vec<_> = hashmap_into_values(base_fields_map).collect(); - types.push(AST::ExactObject( + types.push(AST::ExactObject(ExactObject::new( merged_selections .iter() .cloned() @@ -1029,19 +1046,21 @@ impl<'a> TypeGenerator<'a> { self.raw_response_make_prop(selection, Some(concrete_type)) }) .collect(), - )); + self.should_sort_typegen_items, + ))); self.append_local_3d_payload(&mut types, &merged_selections, Some(concrete_type)); } } if !base_fields.is_empty() { - types.push(AST::ExactObject( + types.push(AST::ExactObject(ExactObject::new( base_fields .iter() .cloned() .map(|selection| self.raw_response_make_prop(selection, concrete_type)) .collect(), - )); + self.should_sort_typegen_items, + ))); self.append_local_3d_payload(&mut types, &base_fields, concrete_type); } @@ -1065,13 +1084,14 @@ impl<'a> TypeGenerator<'a> { types.push(AST::Local3DPayload( module_import.document_name, - Box::new(AST::ExactObject( + Box::new(AST::ExactObject(ExactObject::new( type_selections .iter() .filter(|sel| !sel.is_js_field()) .map(|sel| self.raw_response_make_prop(sel.clone(), concrete_type)) .collect(), - )), + self.should_sort_typegen_items, + ))), )); } } @@ -1145,11 +1165,11 @@ impl<'a> TypeGenerator<'a> { optional: false, }); - AST::InexactObject(vec![ + AST::InexactObject(InexactObject::new(vec![ assignable_fragment_spread_ref, fragment_spread_or_concrete_type_marker, client_id_field, - ]) + ], self.should_sort_typegen_items)) }) .collect(), ); @@ -1494,19 +1514,24 @@ impl<'a> TypeGenerator<'a> { key: def.name.item, read_only: true, optional: false, - value: AST::ExactObject(vec![provider_module]), + value: AST::ExactObject(ExactObject::new( + vec![provider_module], + self.should_sort_typegen_items, + )), })) }) .collect_vec(); if !fields.is_empty() { - self.writer - .write_local_type(PROVIDED_VARIABLE_TYPE, &AST::ExactObject(fields))?; + self.writer.write_local_type( + PROVIDED_VARIABLE_TYPE, + &AST::ExactObject(ExactObject::new(fields, self.should_sort_typegen_items)), + )?; } Ok(()) } fn generate_input_variables_type(&mut self, node: &OperationDefinition) -> AST { - AST::ExactObject( + AST::ExactObject(ExactObject::new( node.variable_definitions .iter() .map(|var_def| { @@ -1518,7 +1543,8 @@ impl<'a> TypeGenerator<'a> { }) }) .collect(), - ) + self.should_sort_typegen_items, + )) } fn write_input_object_types(&mut self) -> FmtResult { @@ -1558,22 +1584,25 @@ impl<'a> TypeGenerator<'a> { self.generated_input_object_types .insert(input_object.name, GeneratedInputObject::Pending); - let props = input_object - .fields - .iter() - .map(|field| { - Prop::KeyValuePair(KeyValuePairProp { - key: field.name, - read_only: false, - optional: !field.type_.is_non_null() - || self - .typegen_config - .optional_input_fields - .contains(&field.name), - value: self.transform_input_type(&field.type_), + let props = ExactObject::new( + input_object + .fields + .iter() + .map(|field| { + Prop::KeyValuePair(KeyValuePairProp { + key: field.name, + read_only: false, + optional: !field.type_.is_non_null() + || self + .typegen_config + .optional_input_fields + .contains(&field.name), + value: self.transform_input_type(&field.type_), + }) }) - }) - .collect(); + .collect(), + self.should_sort_typegen_items, + ); self.generated_input_object_types.insert( input_object.name, GeneratedInputObject::Resolved(AST::ExactObject(props)), @@ -1707,17 +1736,19 @@ impl<'a> TypeGenerator<'a> { optional: false, }); - let parameter_type = AST::InexactObject(vec![ - id_prop.clone(), - fragment_spread_prop.clone(), - parameter_discriminator, - ]); + let parameter_type = AST::InexactObject(InexactObject::new( + vec![ + id_prop.clone(), + fragment_spread_prop.clone(), + parameter_discriminator, + ], + self.should_sort_typegen_items, + )); let return_type = AST::Union(vec![ - AST::InexactObject(vec![ - id_prop, - fragment_spread_prop, - return_value_discriminator, - ]), + AST::InexactObject(InexactObject::new( + vec![id_prop, fragment_spread_prop, return_value_discriminator], + self.should_sort_typegen_items, + )), AST::RawType(intern!("false")), ]); @@ -1794,17 +1825,19 @@ impl<'a> TypeGenerator<'a> { optional: false, }); - let parameter_type = AST::InexactObject(vec![ - id_prop.clone(), - fragment_spread_prop.clone(), - parameter_discriminator, - ]); + let parameter_type = AST::InexactObject(InexactObject::new( + vec![ + id_prop.clone(), + fragment_spread_prop.clone(), + parameter_discriminator, + ], + self.should_sort_typegen_items, + )); let return_type = AST::Union(vec![ - AST::InexactObject(vec![ - id_prop, - fragment_spread_prop, - return_value_discriminator, - ]), + AST::InexactObject(InexactObject::new( + vec![id_prop, fragment_spread_prop, return_value_discriminator], + self.should_sort_typegen_items, + )), AST::RawType(intern!("false")), ]); diff --git a/compiler/crates/relay-typegen/src/typescript.rs b/compiler/crates/relay-typegen/src/typescript.rs index fe2e6452e49b3..209931332e175 100644 --- a/compiler/crates/relay-typegen/src/typescript.rs +++ b/compiler/crates/relay-typegen/src/typescript.rs @@ -16,6 +16,7 @@ pub struct TypeScriptPrinter { result: String, use_import_type_syntax: bool, indentation: usize, + should_wrap_unions_in_parentheses: bool, } impl Write for TypeScriptPrinter { @@ -45,11 +46,12 @@ impl Writer for TypeScriptPrinter { AST::Identifier(identifier) => write!(&mut self.result, "{}", identifier), AST::RawType(raw) => write!(&mut self.result, "{}", raw), AST::Union(members) => self.write_union(members), + AST::Intersection(members) => self.write_intersection(members), AST::ReadOnlyArray(of_type) => self.write_read_only_array(of_type), AST::Nullable(of_type) => self.write_nullable(of_type), AST::NonNullable(of_type) => self.write_non_nullable(of_type), - AST::ExactObject(props) => self.write_object(props), - AST::InexactObject(props) => self.write_object(props), + AST::ExactObject(object) => self.write_object(object), + AST::InexactObject(object) => self.write_object(object), AST::Local3DPayload(document_name, selections) => { self.write_local_3d_payload(*document_name, selections) } @@ -116,11 +118,12 @@ impl Writer for TypeScriptPrinter { } impl TypeScriptPrinter { - pub fn new(config: &TypegenConfig) -> Self { + pub fn new(config: &TypegenConfig, should_wrap_unions_in_parentheses: bool) -> Self { Self { result: String::new(), indentation: 0, use_import_type_syntax: config.use_import_type_syntax, + should_wrap_unions_in_parentheses, } } @@ -137,6 +140,9 @@ impl TypeScriptPrinter { } fn write_union(&mut self, members: &[AST]) -> FmtResult { + if members.len() > 1 && self.should_wrap_unions_in_parentheses { + write!(&mut self.result, "(")?; + } let mut first = true; for member in members { if first { @@ -146,6 +152,28 @@ impl TypeScriptPrinter { } self.write(member)?; } + if members.len() > 1 && self.should_wrap_unions_in_parentheses { + write!(&mut self.result, ")")?; + } + Ok(()) + } + + fn write_intersection(&mut self, members: &[AST]) -> FmtResult { + if members.len() > 1 { + write!(&mut self.result, "(")?; + } + let mut first = true; + for member in members { + if first { + first = false; + } else { + write!(&mut self.result, " & ")?; + } + self.write(member)?; + } + if members.len() > 1 { + write!(&mut self.result, ")")?; + } Ok(()) } @@ -274,7 +302,7 @@ impl TypeScriptPrinter { #[cfg(test)] mod tests { - use crate::writer::KeyValuePairProp; + use crate::writer::{ExactObject, InexactObject, KeyValuePairProp}; use super::*; use intern::string_key::Intern; @@ -284,7 +312,7 @@ mod tests { } fn print_type_with_config(ast: &AST, config: &TypegenConfig) -> String { - let mut printer = Box::new(TypeScriptPrinter::new(config)); + let mut printer = Box::new(TypeScriptPrinter::new(config, true)); printer.write(ast).unwrap(); printer.into_string() } @@ -300,7 +328,7 @@ mod tests { fn union_type() { assert_eq!( print_type(&AST::Union(vec![AST::String, AST::Number])), - "string | number".to_string() + "(string | number)".to_string() ); } @@ -316,7 +344,7 @@ mod tests { fn nullable_type() { assert_eq!( print_type(&AST::Nullable(Box::new(AST::String))), - "string | null".to_string() + "(string | null)".to_string() ); assert_eq!( @@ -324,46 +352,125 @@ mod tests { AST::String, AST::Number, ])))), - "string | number | null" + "(string | number | null)" ) } + #[test] + fn intersections() { + assert_eq!( + print_type(&AST::Intersection(vec![ + AST::ExactObject(ExactObject::new( + vec![Prop::KeyValuePair(KeyValuePairProp { + key: "first".intern(), + optional: false, + read_only: false, + value: AST::String + })], + true + )), + AST::ExactObject(ExactObject::new( + vec![Prop::KeyValuePair(KeyValuePairProp { + key: "second".intern(), + optional: false, + read_only: false, + value: AST::Number + })], + true + )), + ])), + r"({ + first: string; +} & { + second: number; +})" + ); + + assert_eq!( + print_type(&AST::Intersection(vec![ + AST::Union(vec![ + AST::ExactObject(ExactObject::new( + vec![Prop::KeyValuePair(KeyValuePairProp { + key: "first".intern(), + optional: false, + read_only: false, + value: AST::String + })], + true + )), + AST::ExactObject(ExactObject::new( + vec![Prop::KeyValuePair(KeyValuePairProp { + key: "second".intern(), + optional: false, + read_only: false, + value: AST::Number + })], + true + )), + ]), + AST::ExactObject(ExactObject::new( + vec![Prop::KeyValuePair(KeyValuePairProp { + key: "third".intern(), + optional: false, + read_only: false, + value: AST::Number + })], + true + )), + ],)), + r"(({ + first: string; +} | { + second: number; +}) & { + third: number; +})" + ); + } + #[test] fn exact_object() { - assert_eq!(print_type(&AST::ExactObject(Vec::new())), r"{}".to_string()); + assert_eq!( + print_type(&AST::ExactObject(ExactObject::new(Vec::new(), true))), + r"{}".to_string() + ); assert_eq!( - print_type(&AST::ExactObject(vec![Prop::KeyValuePair( - KeyValuePairProp { + print_type(&AST::ExactObject(ExactObject::new( + vec![Prop::KeyValuePair(KeyValuePairProp { key: "single".intern(), optional: false, read_only: false, value: AST::String, - } - )])), + })], + true + ))), r"{ single: string; }" .to_string() ); assert_eq!( - print_type(&AST::ExactObject(vec![ - Prop::KeyValuePair(KeyValuePairProp { - key: "foo".intern(), - optional: true, - read_only: false, - value: AST::String, - }), - Prop::KeyValuePair(KeyValuePairProp { - key: "bar".intern(), - optional: false, - read_only: true, - value: AST::Number, - }), - ])), + print_type(&AST::ExactObject(ExactObject::new( + vec![ + Prop::KeyValuePair(KeyValuePairProp { + key: "foo".intern(), + optional: true, + read_only: false, + value: AST::String, + }), + Prop::KeyValuePair(KeyValuePairProp { + key: "bar".intern(), + optional: false, + read_only: true, + value: AST::Number, + }), + ], + true + ))), r"{ - foo?: string; readonly bar: number; + foo?: string; }" .to_string() ); @@ -372,39 +479,45 @@ mod tests { #[test] fn nested_object() { assert_eq!( - print_type(&AST::ExactObject(vec![ - Prop::KeyValuePair(KeyValuePairProp { - key: "foo".intern(), - optional: true, - read_only: false, - value: AST::ExactObject(vec![ - Prop::KeyValuePair(KeyValuePairProp { - key: "nested_foo".intern(), - optional: true, - read_only: false, - value: AST::String, - }), - Prop::KeyValuePair(KeyValuePairProp { - key: "nested_foo2".intern(), - optional: false, - read_only: true, - value: AST::Number, - }), - ]), - }), - Prop::KeyValuePair(KeyValuePairProp { - key: "bar".intern(), - optional: false, - read_only: true, - value: AST::Number, - }), - ])), + print_type(&AST::ExactObject(ExactObject::new( + vec![ + Prop::KeyValuePair(KeyValuePairProp { + key: "foo".intern(), + optional: true, + read_only: false, + value: AST::ExactObject(ExactObject::new( + vec![ + Prop::KeyValuePair(KeyValuePairProp { + key: "nested_foo".intern(), + optional: true, + read_only: false, + value: AST::String, + }), + Prop::KeyValuePair(KeyValuePairProp { + key: "nested_foo2".intern(), + optional: false, + read_only: true, + value: AST::Number, + }), + ], + true + )), + }), + Prop::KeyValuePair(KeyValuePairProp { + key: "bar".intern(), + optional: false, + read_only: true, + value: AST::Number, + }), + ], + true + ))), r"{ + readonly bar: number; foo?: { nested_foo?: string; readonly nested_foo2: number; }; - readonly bar: number; }" .to_string() ); @@ -413,19 +526,20 @@ mod tests { #[test] fn inexact_object() { assert_eq!( - print_type(&AST::InexactObject(Vec::new())), + print_type(&AST::InexactObject(InexactObject::new(Vec::new(), true))), "{}".to_string() ); assert_eq!( - print_type(&AST::InexactObject(vec![Prop::KeyValuePair( - KeyValuePairProp { + print_type(&AST::InexactObject(InexactObject::new( + vec![Prop::KeyValuePair(KeyValuePairProp { key: "single".intern(), optional: false, read_only: false, value: AST::String, - } - ),])), + }),], + true + ))), r"{ single: string; }" @@ -433,23 +547,26 @@ mod tests { ); assert_eq!( - print_type(&AST::InexactObject(vec![ - Prop::KeyValuePair(KeyValuePairProp { - key: "foo".intern(), - optional: false, - read_only: false, - value: AST::String, - }), - Prop::KeyValuePair(KeyValuePairProp { - key: "bar".intern(), - optional: true, - read_only: true, - value: AST::Number, - }) - ])), + print_type(&AST::InexactObject(InexactObject::new( + vec![ + Prop::KeyValuePair(KeyValuePairProp { + key: "foo".intern(), + optional: false, + read_only: false, + value: AST::String, + }), + Prop::KeyValuePair(KeyValuePairProp { + key: "bar".intern(), + optional: true, + read_only: true, + value: AST::Number, + }) + ], + true + ))), r"{ - foo: string; readonly bar?: number; + foo: string; }" .to_string() ); @@ -458,14 +575,15 @@ mod tests { #[test] fn other_comment() { assert_eq!( - print_type(&AST::ExactObject(vec![Prop::KeyValuePair( - KeyValuePairProp { + print_type(&AST::ExactObject(ExactObject::new( + vec![Prop::KeyValuePair(KeyValuePairProp { key: "with_comment".intern(), optional: false, read_only: false, value: AST::OtherTypename, - } - ),])), + }),], + true + ))), r#"{ // This will never be '%other', but we need some // value in case none of the concrete values match. @@ -477,21 +595,24 @@ mod tests { #[test] fn import_type() { - let mut printer = Box::new(TypeScriptPrinter::new(&TypegenConfig::default())); + let mut printer = Box::new(TypeScriptPrinter::new(&TypegenConfig::default(), true)); printer.write_import_type(&["A", "B"], "module").unwrap(); assert_eq!(printer.into_string(), "import { A, B } from \"module\";\n"); - let mut printer = Box::new(TypeScriptPrinter::new(&TypegenConfig { - use_import_type_syntax: true, - ..Default::default() - })); + let mut printer = Box::new(TypeScriptPrinter::new( + &TypegenConfig { + use_import_type_syntax: true, + ..Default::default() + }, + true, + )); printer.write_import_type(&["C"], "./foo").unwrap(); assert_eq!(printer.into_string(), "import type { C } from \"./foo\";\n"); } #[test] fn import_module() { - let mut printer = Box::new(TypeScriptPrinter::new(&TypegenConfig::default())); + let mut printer = Box::new(TypeScriptPrinter::new(&TypegenConfig::default(), true)); printer.write_import_module_default("A", "module").unwrap(); assert_eq!(printer.into_string(), "import A from \"module\";\n"); } diff --git a/compiler/crates/relay-typegen/src/writer.rs b/compiler/crates/relay-typegen/src/writer.rs index be8fdeb694f4a..06f56de613478 100644 --- a/compiler/crates/relay-typegen/src/writer.rs +++ b/compiler/crates/relay-typegen/src/writer.rs @@ -6,11 +6,18 @@ */ use intern::string_key::StringKey; -use std::fmt::{Result as FmtResult, Write}; +use std::{ + fmt::{Result as FmtResult, Write}, + ops::{Deref, DerefMut}, +}; #[derive(Debug, Clone)] pub enum AST { Union(Vec), + // Intersection variant added in preparation for better support for abstract types. + // See https://github.com/facebook/relay/pull/3280 + #[allow(dead_code)] + Intersection(Vec), ReadOnlyArray(Box), Nullable(Box), NonNullable(Box), @@ -22,8 +29,8 @@ pub enum AST { /// Prints as `"%other" with a comment explaining open enums. OtherTypename, Local3DPayload(StringKey, Box), - ExactObject(Vec), - InexactObject(Vec), + ExactObject(ExactObject), + InexactObject(InexactObject), Number, Boolean, Callable(Box), @@ -34,6 +41,75 @@ pub enum AST { ActorChangePoint(Box), } +#[derive(Debug, Clone)] +pub struct ExactObject(Vec); + +impl Deref for ExactObject { + type Target = Vec; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +impl DerefMut for ExactObject { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} + +impl ExactObject { + pub fn new(mut props: Vec, should_sort_props: bool) -> Self { + if should_sort_props { + sort_props(&mut props); + } + Self(props) + } +} + +#[derive(Debug, Clone)] +pub struct InexactObject(Vec); + +impl Deref for InexactObject { + type Target = Vec; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +impl DerefMut for InexactObject { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} + +impl InexactObject { + pub fn new(mut props: Vec, should_sort_props: bool) -> Self { + if should_sort_props { + sort_props(&mut props); + } + Self(props) + } +} + +fn sort_props(props: &mut Vec) { + // Put regular key-value props first, followed by getter/setter pairs, + // followed by spreads, with $fragmentSpreads and $fragmentType props last. + props.sort_by_cached_key(|prop| match prop { + Prop::KeyValuePair(kvp) => ( + if kvp.key == *crate::KEY_FRAGMENT_SPREADS || kvp.key == *crate::KEY_FRAGMENT_TYPE { + PropSortOrder::FragmentSpread + } else { + PropSortOrder::KeyValuePair + }, + kvp.key, + ), + Prop::GetterSetterPair(pair) => (PropSortOrder::GetterSetterPair, pair.key), + Prop::Spread(spread) => (PropSortOrder::ObjectSpread, spread.value), + }); +} + #[derive(Debug, Clone)] pub enum Prop { KeyValuePair(KeyValuePairProp), @@ -88,3 +164,11 @@ pub trait Writer: Write { fn write_any_type_definition(&mut self, name: &str) -> FmtResult; } + +#[derive(PartialEq, Eq, PartialOrd, Ord)] +enum PropSortOrder { + KeyValuePair = 0, + GetterSetterPair = 1, + ObjectSpread = 2, + FragmentSpread = 3, +} diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/actor-change-with-query.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/actor-change-with-query.expected index a4d6667923c01..265560328b993 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/actor-change-with-query.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/actor-change-with-query.expected @@ -28,8 +28,8 @@ export type Viewer$data = {| |}, |}; export type Viewer = {| - variables: Viewer$variables, response: Viewer$data, + variables: Viewer$variables, |}; ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; @@ -37,9 +37,9 @@ declare export opaque type ActorFragment$fragmentType: FragmentType; export type ActorFragment$data = {| +name: ?string, +profilePicture: ?{| + +height: ?number, +uri: ?string, +width: ?number, - +height: ?number, |}, +$fragmentType: ActorFragment$fragmentType, |}; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/actor-change.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/actor-change.expected index bd98487d4b1e2..08088c5fcb401 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/actor-change.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/actor-change.expected @@ -19,9 +19,9 @@ declare export opaque type ActorFragment$fragmentType: FragmentType; export type ActorFragment$data = {| +name: ?string, +profilePicture: ?{| + +height: ?number, +uri: ?string, +width: ?number, - +height: ?number, |}, +$fragmentType: ActorFragment$fragmentType, |}; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/fragment-spread.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/fragment-spread.expected index b8a3010cb0119..55bad59874e08 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/fragment-spread.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/fragment-spread.expected @@ -79,14 +79,14 @@ import type { UserFrag2$fragmentType } from "UserFrag2.graphql"; import type { FragmentType } from "relay-runtime"; declare export opaque type FragmentSpread$fragmentType: FragmentType; export type FragmentSpread$data = {| - +id: string, - +justFrag: ?{| - +$fragmentSpreads: PictureFragment$fragmentType, - |}, +fragAndField: ?{| +uri: ?string, +$fragmentSpreads: PictureFragment$fragmentType, |}, + +id: string, + +justFrag: ?{| + +$fragmentSpreads: PictureFragment$fragmentType, + |}, +$fragmentSpreads: OtherFragment$fragmentType & UserFrag1$fragmentType & UserFrag2$fragmentType, +$fragmentType: FragmentSpread$fragmentType, |}; @@ -110,7 +110,7 @@ export type OtherFragment$key = { ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; declare export opaque type PageFragment$fragmentType: FragmentType; -export type PageFragment$data = {| +export type PageFragment$data = ({| +__typename: "Page", +$fragmentType: PageFragment$fragmentType, |} | {| @@ -118,7 +118,7 @@ export type PageFragment$data = {| // value in case none of the concrete values match. +__typename: "%other", +$fragmentType: PageFragment$fragmentType, -|}; +|}); export type PageFragment$key = { +$data?: PageFragment$data, +$fragmentSpreads: PageFragment$fragmentType, @@ -127,7 +127,7 @@ export type PageFragment$key = { ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; declare export opaque type PictureFragment$fragmentType: FragmentType; -export type PictureFragment$data = {| +export type PictureFragment$data = ({| +__typename: "Image", +$fragmentType: PictureFragment$fragmentType, |} | {| @@ -135,7 +135,7 @@ export type PictureFragment$data = {| // value in case none of the concrete values match. +__typename: "%other", +$fragmentType: PictureFragment$fragmentType, -|}; +|}); export type PictureFragment$key = { +$data?: PictureFragment$data, +$fragmentSpreads: PictureFragment$fragmentType, @@ -144,7 +144,7 @@ export type PictureFragment$key = { ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; declare export opaque type UserFrag1$fragmentType: FragmentType; -export type UserFrag1$data = {| +export type UserFrag1$data = ({| +__typename: "User", +$fragmentType: UserFrag1$fragmentType, |} | {| @@ -152,7 +152,7 @@ export type UserFrag1$data = {| // value in case none of the concrete values match. +__typename: "%other", +$fragmentType: UserFrag1$fragmentType, -|}; +|}); export type UserFrag1$key = { +$data?: UserFrag1$data, +$fragmentSpreads: UserFrag1$fragmentType, @@ -161,7 +161,7 @@ export type UserFrag1$key = { ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; declare export opaque type UserFrag2$fragmentType: FragmentType; -export type UserFrag2$data = {| +export type UserFrag2$data = ({| +__typename: "User", +$fragmentType: UserFrag2$fragmentType, |} | {| @@ -169,7 +169,7 @@ export type UserFrag2$data = {| // value in case none of the concrete values match. +__typename: "%other", +$fragmentType: UserFrag2$fragmentType, -|}; +|}); export type UserFrag2$key = { +$data?: UserFrag2$data, +$fragmentSpreads: UserFrag2$fragmentType, diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/inline-fragment.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/inline-fragment.expected index e29f19679cfdd..3360c570d5b82 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/inline-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/inline-fragment.expected @@ -68,10 +68,10 @@ import type { FragmentType } from "relay-runtime"; declare export opaque type InlineFragment$fragmentType: FragmentType; export type InlineFragment$data = {| +id: string, - +name?: ?string, +message?: ?{| +text: ?string, |}, + +name?: ?string, +$fragmentType: InlineFragment$fragmentType, |}; export type InlineFragment$key = { @@ -99,12 +99,12 @@ declare export opaque type InlineFragmentKitchenSink$fragmentType: FragmentType; export type InlineFragmentKitchenSink$data = {| +actor: ?{| +id: string, + +name?: ?string, +profilePicture: ?{| + +height?: ?number, +uri: ?string, +width?: ?number, - +height?: ?number, |}, - +name?: ?string, +$fragmentSpreads: SomeFragment$fragmentType, |}, +$fragmentType: InlineFragmentKitchenSink$fragmentType, @@ -120,10 +120,10 @@ declare export opaque type InlineFragmentWithOverlappingFields$fragmentType: Fra export type InlineFragmentWithOverlappingFields$data = {| +hometown?: ?{| +id: string, - +name: ?string, +message?: ?{| +text: ?string, |}, + +name: ?string, |}, +name?: ?string, +$fragmentType: InlineFragmentWithOverlappingFields$fragmentType, @@ -136,7 +136,7 @@ export type InlineFragmentWithOverlappingFields$key = { ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; declare export opaque type SomeFragment$fragmentType: FragmentType; -export type SomeFragment$data = {| +export type SomeFragment$data = ({| +__typename: "User", +$fragmentType: SomeFragment$fragmentType, |} | {| @@ -144,7 +144,7 @@ export type SomeFragment$data = {| // value in case none of the concrete values match. +__typename: "%other", +$fragmentType: SomeFragment$fragmentType, -|}; +|}); export type SomeFragment$key = { +$data?: SomeFragment$data, +$fragmentSpreads: SomeFragment$fragmentType, diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/linked-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/linked-field.expected index fd535e9eab640..970c028ccc589 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/linked-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/linked-field.expected @@ -39,17 +39,15 @@ export type UnionTypeTest$data = {| |}), |}; export type UnionTypeTest = {| - variables: UnionTypeTest$variables, response: UnionTypeTest$data, + variables: UnionTypeTest$variables, |}; ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; declare export opaque type LinkedField$fragmentType: FragmentType; export type LinkedField$data = {| - +profilePicture: ?{| - +uri: ?string, - +width: ?number, - +height: ?number, + +actor: ?{| + +id: string, |}, +hometown: ?{| +id: string, @@ -57,8 +55,10 @@ export type LinkedField$data = {| +uri: ?string, |}, |}, - +actor: ?{| - +id: string, + +profilePicture: ?{| + +height: ?number, + +uri: ?string, + +width: ?number, |}, +$fragmentType: LinkedField$fragmentType, |}; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/match-field-in-query.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/match-field-in-query.expected index efc659b981680..df091e79a91e9 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/match-field-in-query.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/match-field-in-query.expected @@ -36,17 +36,17 @@ export type NameRendererQuery$data = {| |}, |}; export type NameRendererQuery = {| - variables: NameRendererQuery$variables, response: NameRendererQuery$data, + variables: NameRendererQuery$variables, |}; ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; declare export opaque type MarkdownUserNameRenderer_name$fragmentType: FragmentType; export type MarkdownUserNameRenderer_name$data = {| - +markdown: ?string, +data: ?{| +markup: ?string, |}, + +markdown: ?string, +$fragmentType: MarkdownUserNameRenderer_name$fragmentType, |}; export type MarkdownUserNameRenderer_name$key = { @@ -58,10 +58,10 @@ export type MarkdownUserNameRenderer_name$key = { import type { FragmentType } from "relay-runtime"; declare export opaque type PlainUserNameRenderer_name$fragmentType: FragmentType; export type PlainUserNameRenderer_name$data = {| - +plaintext: ?string, +data: ?{| +text: ?string, |}, + +plaintext: ?string, +$fragmentType: PlainUserNameRenderer_name$fragmentType, |}; export type PlainUserNameRenderer_name$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/match-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/match-field.expected index 5a941e8d46c9e..cf2690e41c513 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/match-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/match-field.expected @@ -25,10 +25,10 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { import type { FragmentType } from "relay-runtime"; declare export opaque type MarkdownUserNameRenderer_name$fragmentType: FragmentType; export type MarkdownUserNameRenderer_name$data = {| - +markdown: ?string, +data: ?{| +markup: ?string, |}, + +markdown: ?string, +$fragmentType: MarkdownUserNameRenderer_name$fragmentType, |}; export type MarkdownUserNameRenderer_name$key = { @@ -59,10 +59,10 @@ export type NameRendererFragment$key = { import type { FragmentType } from "relay-runtime"; declare export opaque type PlainUserNameRenderer_name$fragmentType: FragmentType; export type PlainUserNameRenderer_name$data = {| - +plaintext: ?string, +data: ?{| +text: ?string, |}, + +plaintext: ?string, +$fragmentType: PlainUserNameRenderer_name$fragmentType, |}; export type PlainUserNameRenderer_name$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-input-has-array.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-input-has-array.expected index 58c3ab3e92c7b..d6c09a1a5b4c0 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-input-has-array.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-input-has-array.expected @@ -30,7 +30,7 @@ export type InputHasArray$rawResponse = {| |}, |}; export type InputHasArray = {| - variables: InputHasArray$variables, - response: InputHasArray$data, rawResponse: InputHasArray$rawResponse, + response: InputHasArray$data, + variables: InputHasArray$variables, |}; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-client-extension.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-client-extension.expected index 2542f7ca50990..4343d6a7d18e1 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-client-extension.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-client-extension.expected @@ -38,15 +38,15 @@ export type Test$data = {| export type Test$rawResponse = {| +viewerNotificationsUpdateAllSeenState: ?{| +stories: ?$ReadOnlyArray, + +id: string, |}>, |}, |}; export type Test = {| - variables: Test$variables, - response: Test$data, rawResponse: Test$rawResponse, + response: Test$data, + variables: Test$variables, |}; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-enums-on-fragment.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-enums-on-fragment.expected index bdbc931fa6934..46470b47579a1 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-enums-on-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-enums-on-fragment.expected @@ -28,11 +28,11 @@ fragment FriendFragment on User { } ==================================== OUTPUT =================================== import type { FriendFragment$fragmentType } from "FriendFragment.graphql"; -export type TestEnums = "mark" | "zuck" | "%future added value"; +export type TestEnums = ("mark" | "zuck" | "%future added value"); export type CommentCreateInput = {| clientMutationId?: ?string, - feedbackId?: ?string, feedback?: ?CommentfeedbackFeedback, + feedbackId?: ?string, |}; export type CommentfeedbackFeedback = {| comment?: ?FeedbackcommentComment, @@ -41,8 +41,8 @@ export type FeedbackcommentComment = {| feedback?: ?CommentfeedbackFeedback, |}; export type CommentCreateMutation$variables = {| - input: CommentCreateInput, first?: ?number, + input: CommentCreateInput, orderBy?: ?$ReadOnlyArray, |}; export type CommentCreateMutation$data = {| @@ -51,8 +51,8 @@ export type CommentCreateMutation$data = {| +friends: ?{| +edges: ?$ReadOnlyArray, @@ -66,10 +66,10 @@ export type CommentCreateMutation$rawResponse = {| +friends: ?{| +edges: ?$ReadOnlyArray, |}; export type CommentCreateMutation$data = {| @@ -68,13 +68,13 @@ export type CommentCreateMutation$rawResponse = {| +friends: ?{| +edges: ?$ReadOnlyArray, |}, @@ -83,9 +83,9 @@ export type CommentCreateMutation$rawResponse = {| |}, |}; export type CommentCreateMutation = {| - variables: CommentCreateMutation$variables, - response: CommentCreateMutation$data, rawResponse: CommentCreateMutation$rawResponse, + response: CommentCreateMutation$data, + variables: CommentCreateMutation$variables, |}; ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; @@ -105,11 +105,11 @@ import type { FeedbackFragment$fragmentType } from "FeedbackFragment.graphql"; import type { FragmentType } from "relay-runtime"; declare export opaque type FriendFragment$fragmentType: FragmentType; export type FriendFragment$data = {| - +name: ?string, - +lastName: ?string, +feedback: ?{| +$fragmentSpreads: FeedbackFragment$fragmentType, |}, + +lastName: ?string, + +name: ?string, +$fragmentType: FriendFragment$fragmentType, |}; export type FriendFragment$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-response-on-inline-fragments.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-response-on-inline-fragments.expected index 7b1fffbdbf4b7..63b30812c5c6c 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-response-on-inline-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-response-on-inline-fragments.expected @@ -30,8 +30,8 @@ fragment InlineFragmentWithOverlappingFields on Actor { import type { InlineFragmentWithOverlappingFields$fragmentType } from "InlineFragmentWithOverlappingFields.graphql"; export type CommentCreateInput = {| clientMutationId?: ?string, - feedbackId?: ?string, feedback?: ?CommentfeedbackFeedback, + feedbackId?: ?string, |}; export type CommentfeedbackFeedback = {| comment?: ?FeedbackcommentComment, @@ -55,36 +55,36 @@ export type TestMutation$rawResponse = {| +commentCreate: ?{| +viewer: ?{| +actor: ?({| - +__typename: "User", +__isActor: "User", - +id: string, + +__typename: "User", +hometown: ?{| +id: string, +name: ?string, |}, + +id: string, |} | {| - +__typename: "Page", +__isActor: "Page", - +id: string, - +name: ?string, + +__typename: "Page", +hometown: ?{| +id: string, +message: ?{| +text: ?string, |}, |}, + +id: string, + +name: ?string, |} | {| - +__typename: string, +__isActor: string, + +__typename: string, +id: string, |}), |}, |}, |}; export type TestMutation = {| - variables: TestMutation$variables, - response: TestMutation$data, rawResponse: TestMutation$rawResponse, + response: TestMutation$data, + variables: TestMutation$variables, |}; ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; @@ -92,10 +92,10 @@ declare export opaque type InlineFragmentWithOverlappingFields$fragmentType: Fra export type InlineFragmentWithOverlappingFields$data = {| +hometown?: ?{| +id: string, - +name: ?string, +message?: ?{| +text: ?string, |}, + +name: ?string, |}, +name?: ?string, +$fragmentType: InlineFragmentWithOverlappingFields$fragmentType, diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation.expected index 9c81511ca0568..b84dc7460e7f5 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation.expected @@ -17,8 +17,8 @@ mutation CommentCreateMutation( ==================================== OUTPUT =================================== export type CommentCreateInput = {| clientMutationId?: ?string, - feedbackId?: ?string, feedback?: ?CommentfeedbackFeedback, + feedbackId?: ?string, |}; export type CommentfeedbackFeedback = {| comment?: ?FeedbackcommentComment, @@ -27,22 +27,22 @@ export type FeedbackcommentComment = {| feedback?: ?CommentfeedbackFeedback, |}; export type CommentCreateMutation$variables = {| - input: CommentCreateInput, first?: ?number, + input: CommentCreateInput, orderBy?: ?$ReadOnlyArray, |}; export type CommentCreateMutation$data = {| +commentCreate: ?{| +comment: ?{| - +id: string, - +name: ?string, +friends: ?{| +count: ?number, |}, + +id: string, + +name: ?string, |}, |}, |}; export type CommentCreateMutation = {| - variables: CommentCreateMutation$variables, response: CommentCreateMutation$data, + variables: CommentCreateMutation$variables, |}; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/no-inline-fragment.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/no-inline-fragment.expected index a1c7d5c63d901..a40fa60df7fa4 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/no-inline-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/no-inline-fragment.expected @@ -29,8 +29,8 @@ import type { noInlineFragment_address$normalization } from "noInlineFragment_ad import type { noInlineFragment_user$normalization } from "noInlineFragment_user$normalization.graphql"; export type noInlineFragmentQuery$variables = {| global?: ?number, - shadowed_global?: ?number, global_from_parent?: ?number, + shadowed_global?: ?number, |}; export type noInlineFragmentQuery$data = {| +me: ?{| @@ -42,17 +42,17 @@ export type noInlineFragmentQuery$data = {| |}; export type noInlineFragmentQuery$rawResponse = {| +me: ?{| - ...noInlineFragment_user$normalization, +address: ?{| ...noInlineFragment_address$normalization, |}, +id: string, + ...noInlineFragment_user$normalization, |}, |}; export type noInlineFragmentQuery = {| - variables: noInlineFragmentQuery$variables, - response: noInlineFragmentQuery$data, rawResponse: noInlineFragmentQuery$rawResponse, + response: noInlineFragmentQuery$data, + variables: noInlineFragmentQuery$variables, |}; ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-mixed-provided-variables.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-mixed-provided-variables.expected index 35790bd9a012a..3068ccc5a3c73 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-mixed-provided-variables.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-mixed-provided-variables.expected @@ -60,8 +60,8 @@ export type queryMixedProvidedVar_MultiFragment$data = {| |}, |}; export type queryMixedProvidedVar_MultiFragment = {| - variables: queryMixedProvidedVar_MultiFragment$variables, response: queryMixedProvidedVar_MultiFragment$data, + variables: queryMixedProvidedVar_MultiFragment$variables, |}; type ProvidedVariablesType = {| +__relay_internal__pv__includeNameProvider: {| @@ -85,8 +85,8 @@ export type queryMixedProvidedVar_OneFragment$data = {| |}, |}; export type queryMixedProvidedVar_OneFragment = {| - variables: queryMixedProvidedVar_OneFragment$variables, response: queryMixedProvidedVar_OneFragment$data, + variables: queryMixedProvidedVar_OneFragment$variables, |}; type ProvidedVariablesType = {| +__relay_internal__pv__includeNameProvider: {| @@ -101,8 +101,8 @@ export type FragmentMultiProvidedVar$data = {| +count: ?number, +edges: ?$ReadOnlyArray, |}, @@ -117,8 +117,8 @@ export type FragmentMultiProvidedVar$key = { import type { FragmentType } from "relay-runtime"; declare export opaque type FragmentOneProvidedVar$fragmentType: FragmentType; export type FragmentOneProvidedVar$data = {| - +name?: ?string, +alternate_name?: ?string, + +name?: ?string, +$fragmentType: FragmentOneProvidedVar$fragmentType, |}; export type FragmentOneProvidedVar$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-only-provided-variables.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-only-provided-variables.expected index b3bb001fec812..bc9e846565dfc 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-only-provided-variables.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-only-provided-variables.expected @@ -43,8 +43,8 @@ export type queryOnlyProvidedVar_MultiFragment$data = {| |}, |}; export type queryOnlyProvidedVar_MultiFragment = {| - variables: queryOnlyProvidedVar_MultiFragment$variables, response: queryOnlyProvidedVar_MultiFragment$data, + variables: queryOnlyProvidedVar_MultiFragment$variables, |}; type ProvidedVariablesType = {| +__relay_internal__pv__includeNameProvider: {| @@ -63,8 +63,8 @@ export type queryOnlyProvidedVar_OneFragment$data = {| |}, |}; export type queryOnlyProvidedVar_OneFragment = {| - variables: queryOnlyProvidedVar_OneFragment$variables, response: queryOnlyProvidedVar_OneFragment$data, + variables: queryOnlyProvidedVar_OneFragment$variables, |}; type ProvidedVariablesType = {| +__relay_internal__pv__includeNameProvider: {| diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-handles.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-handles.expected index 7e64b25366a3a..1a26fc755d2f0 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-handles.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-handles.expected @@ -30,19 +30,19 @@ export type LinkedHandleField$data = {| export type LinkedHandleField$rawResponse = {| +node: ?({| +__typename: "User", - +id: string, +friends: ?{| +count: ?number, |}, + +id: string, |} | {| +__typename: string, +id: string, |}), |}; export type LinkedHandleField = {| - variables: LinkedHandleField$variables, - response: LinkedHandleField$data, rawResponse: LinkedHandleField$rawResponse, + response: LinkedHandleField$data, + variables: LinkedHandleField$variables, |}; ------------------------------------------------------------------------------- export type ScalarHandleField$variables = {| @@ -64,7 +64,7 @@ export type ScalarHandleField$rawResponse = {| |}), |}; export type ScalarHandleField = {| - variables: ScalarHandleField$variables, - response: ScalarHandleField$data, rawResponse: ScalarHandleField$rawResponse, + response: ScalarHandleField$data, + variables: ScalarHandleField$variables, |}; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-match-fields.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-match-fields.expected index cac05ce4947be..2bf79cc3e8762 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-match-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-match-fields.expected @@ -49,17 +49,17 @@ export type Test$rawResponse = {| +__typename: "User", +id: string, +nameRenderer: ?({| - +__typename: "PlainUserNameRenderer", - +__module_operation_NameRendererFragment: ?any, +__module_component_NameRendererFragment: ?any, + +__module_operation_NameRendererFragment: ?any, + +__typename: "PlainUserNameRenderer", ...PlainUserNameRenderer_name, |} | Local3DPayload<"NameRendererFragment", {| +__typename: "PlainUserNameRenderer", ...PlainUserNameRenderer_name, |}> | {| - +__typename: "MarkdownUserNameRenderer", - +__module_operation_NameRendererFragment: ?any, +__module_component_NameRendererFragment: ?any, + +__module_operation_NameRendererFragment: ?any, + +__typename: "MarkdownUserNameRenderer", ...MarkdownUserNameRenderer_name, |} | Local3DPayload<"NameRendererFragment", {| +__typename: "MarkdownUserNameRenderer", @@ -73,18 +73,18 @@ export type Test$rawResponse = {| |}), |}; export type Test = {| - variables: Test$variables, - response: Test$data, rawResponse: Test$rawResponse, + response: Test$data, + variables: Test$variables, |}; ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; declare export opaque type MarkdownUserNameRenderer_name$fragmentType: FragmentType; export type MarkdownUserNameRenderer_name$data = {| - +markdown: ?string, +data: ?{| +markup: ?string, |}, + +markdown: ?string, +$fragmentType: MarkdownUserNameRenderer_name$fragmentType, |}; export type MarkdownUserNameRenderer_name$key = { @@ -115,10 +115,10 @@ export type NameRendererFragment$key = { import type { FragmentType } from "relay-runtime"; declare export opaque type PlainUserNameRenderer_name$fragmentType: FragmentType; export type PlainUserNameRenderer_name$data = {| - +plaintext: ?string, +data: ?{| +text: ?string, |}, + +plaintext: ?string, +$fragmentType: PlainUserNameRenderer_name$fragmentType, |}; export type PlainUserNameRenderer_name$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-module-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-module-field.expected index 3de4380d9e597..96c1ada3cb09d 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-module-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-module-field.expected @@ -34,8 +34,8 @@ export type Test$rawResponse = {| +__typename: "User", +id: string, +plainUserRenderer: ?({| - +__module_operation_Test_user: ?any, +__module_component_Test_user: ?any, + +__module_operation_Test_user: ?any, ...Test_userRenderer, |} | Local3DPayload<"Test_user", {| ...Test_userRenderer, @@ -46,9 +46,9 @@ export type Test$rawResponse = {| |}), |}; export type Test = {| - variables: Test$variables, - response: Test$data, rawResponse: Test$rawResponse, + response: Test$data, + variables: Test$variables, |}; ------------------------------------------------------------------------------- import type { Test_userRenderer$fragmentType } from "Test_userRenderer.graphql"; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-multiple-match-fields.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-multiple-match-fields.expected index f09d4b6f14a11..548a6653ed9ef 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-multiple-match-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-multiple-match-fields.expected @@ -76,19 +76,18 @@ export type Test$rawResponse = {| +node: ?({| +__typename: "User", +id: string, - +username: ?string, +nameRenderer: ?({| - +__typename: "PlainUserNameRenderer", - +__module_operation_NameRendererFragment: ?any, +__module_component_NameRendererFragment: ?any, + +__module_operation_NameRendererFragment: ?any, + +__typename: "PlainUserNameRenderer", ...PlainUserNameRenderer_name, |} | Local3DPayload<"NameRendererFragment", {| +__typename: "PlainUserNameRenderer", ...PlainUserNameRenderer_name, |}> | {| - +__typename: "MarkdownUserNameRenderer", - +__module_operation_NameRendererFragment: ?any, +__module_component_NameRendererFragment: ?any, + +__module_operation_NameRendererFragment: ?any, + +__typename: "MarkdownUserNameRenderer", ...MarkdownUserNameRenderer_name, |} | Local3DPayload<"NameRendererFragment", {| +__typename: "MarkdownUserNameRenderer", @@ -96,6 +95,7 @@ export type Test$rawResponse = {| |}> | {| +__typename: string, |}), + +username: ?string, |} | {| +__typename: string, +id: string, @@ -106,17 +106,17 @@ export type Test$rawResponse = {| +id: string, +name: ?string, +nameRenderer: ?({| - +__typename: "PlainUserNameRenderer", - +__module_operation_AnotherNameRendererFragment: ?any, +__module_component_AnotherNameRendererFragment: ?any, + +__module_operation_AnotherNameRendererFragment: ?any, + +__typename: "PlainUserNameRenderer", ...PlainUserNameRenderer_name, |} | Local3DPayload<"AnotherNameRendererFragment", {| +__typename: "PlainUserNameRenderer", ...PlainUserNameRenderer_name, |}> | {| - +__typename: "MarkdownUserNameRenderer", - +__module_operation_AnotherNameRendererFragment: ?any, +__module_component_AnotherNameRendererFragment: ?any, + +__module_operation_AnotherNameRendererFragment: ?any, + +__typename: "MarkdownUserNameRenderer", ...MarkdownUserNameRenderer_name, |} | Local3DPayload<"AnotherNameRendererFragment", {| +__typename: "MarkdownUserNameRenderer", @@ -131,9 +131,9 @@ export type Test$rawResponse = {| |}, |}; export type Test = {| - variables: Test$variables, - response: Test$data, rawResponse: Test$rawResponse, + response: Test$data, + variables: Test$variables, |}; ------------------------------------------------------------------------------- import type { MarkdownUserNameRenderer_name$fragmentType } from "MarkdownUserNameRenderer_name.graphql"; @@ -158,10 +158,10 @@ export type AnotherNameRendererFragment$key = { import type { FragmentType } from "relay-runtime"; declare export opaque type MarkdownUserNameRenderer_name$fragmentType: FragmentType; export type MarkdownUserNameRenderer_name$data = {| - +markdown: ?string, +data: ?{| +markup: ?string, |}, + +markdown: ?string, +$fragmentType: MarkdownUserNameRenderer_name$fragmentType, |}; export type MarkdownUserNameRenderer_name$key = { @@ -192,10 +192,10 @@ export type NameRendererFragment$key = { import type { FragmentType } from "relay-runtime"; declare export opaque type PlainUserNameRenderer_name$fragmentType: FragmentType; export type PlainUserNameRenderer_name$data = {| - +plaintext: ?string, +data: ?{| +text: ?string, |}, + +plaintext: ?string, +$fragmentType: PlainUserNameRenderer_name$fragmentType, |}; export type PlainUserNameRenderer_name$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-conditional.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-conditional.expected index 70a5b015047da..445990cd1e0a7 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-conditional.expected @@ -18,8 +18,8 @@ fragment FriendFragment on User { ==================================== OUTPUT =================================== import type { FriendFragment$fragmentType } from "FriendFragment.graphql"; export type ExampleQuery$variables = {| - id: string, condition: CustomBoolean, + id: string, |}; export type ExampleQuery$data = {| +node: ?{| @@ -29,33 +29,33 @@ export type ExampleQuery$data = {| export type ExampleQuery$rawResponse = {| +node: ?({| +__typename: "User", - +id: string, - +name: ?string, - +lastName: ?string, +feedback: ?{| +id: string, +name: ?string, |}, + +id: string, + +lastName: ?string, + +name: ?string, |} | {| +__typename: string, +id: string, |}), |}; export type ExampleQuery = {| - variables: ExampleQuery$variables, - response: ExampleQuery$data, rawResponse: ExampleQuery$rawResponse, + response: ExampleQuery$data, + variables: ExampleQuery$variables, |}; ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; declare export opaque type FriendFragment$fragmentType: FragmentType; export type FriendFragment$data = {| - +name?: ?string, - +lastName?: ?string, +feedback?: ?{| +id: string, +name: ?string, |}, + +lastName?: ?string, + +name?: ?string, +$fragmentType: FriendFragment$fragmentType, |}; export type FriendFragment$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-literal-conditional.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-literal-conditional.expected index 2e31f225b7a8f..c667a2050ecfd 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-literal-conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-literal-conditional.expected @@ -28,35 +28,35 @@ export type ExampleQuery$variables = {| |}; export type ExampleQuery$data = {| +node: ?{| - +username: ?string, +friends?: ?{| +count: ?number, |}, + +username: ?string, +$fragmentSpreads: FriendFragment$fragmentType, |}, |}; export type ExampleQuery$rawResponse = {| +node: ?{| +__typename: string, - +username: ?string, +id: string, + +username: ?string, |}, |}; export type ExampleQuery = {| - variables: ExampleQuery$variables, - response: ExampleQuery$data, rawResponse: ExampleQuery$rawResponse, + response: ExampleQuery$data, + variables: ExampleQuery$variables, |}; ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; declare export opaque type FriendFragment$fragmentType: FragmentType; export type FriendFragment$data = {| - +name?: ?string, - +lastName?: ?string, +feedback?: ?{| +id: string, +name: ?string, |}, + +lastName?: ?string, + +name?: ?string, +$fragmentType: FriendFragment$fragmentType, |}; export type FriendFragment$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-stream-connection.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-stream-connection.expected index 4067ea5553524..c791bcac79438 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-stream-connection.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-stream-connection.expected @@ -20,7 +20,6 @@ query TestDefer @raw_response_type { export type TestDefer$variables = {||}; export type TestDefer$data = {| +node: ?{| - +name?: ?string, +friends?: ?{| +edges: ?$ReadOnlyArray, |}, + +name?: ?string, |}, |}; export type TestDefer$rawResponse = {| +node: ?({| +__typename: "User", - +id: string, - +name: ?string, +friends: ?{| +edges: ?$ReadOnlyArray, +pageInfo: ?{| +endCursor: ?string, +hasNextPage: ?CustomBoolean, |}, |}, + +id: string, + +name: ?string, |} | {| +__typename: string, +id: string, |}), |}; export type TestDefer = {| - variables: TestDefer$variables, - response: TestDefer$data, rawResponse: TestDefer$rawResponse, + response: TestDefer$data, + variables: TestDefer$variables, |}; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-stream.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-stream.expected index c1146f1c14df1..4065f4cf7ed31 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-stream.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-stream.expected @@ -21,7 +21,6 @@ query TestStream @raw_response_type { export type TestStream$variables = {||}; export type TestStream$data = {| +node: ?{| - +name?: ?string, +friends?: ?{| +edges: ?$ReadOnlyArray, |}, + +name?: ?string, |}, |}; export type TestStream$rawResponse = {| +node: ?({| +__typename: "User", - +id: string, - +name: ?string, +friends: ?{| +edges: ?$ReadOnlyArray, +pageInfo: ?{| +endCursor: ?string, +hasNextPage: ?CustomBoolean, |}, |}, + +id: string, + +name: ?string, |} | {| +__typename: string, +id: string, |}), |}; export type TestStream = {| - variables: TestStream$variables, - response: TestStream$data, rawResponse: TestStream$rawResponse, + response: TestStream$data, + variables: TestStream$variables, |}; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query_with_raw_response_and_client_components.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query_with_raw_response_and_client_components.expected index 1cd6515a53716..f44e68f20739b 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query_with_raw_response_and_client_components.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query_with_raw_response_and_client_components.expected @@ -26,14 +26,14 @@ export type queryWithRelayClientComponentQuery$rawResponse = {| +viewer: ?{||}, |}; export type queryWithRelayClientComponentQuery = {| - variables: queryWithRelayClientComponentQuery$variables, - response: queryWithRelayClientComponentQuery$data, rawResponse: queryWithRelayClientComponentQuery$rawResponse, + response: queryWithRelayClientComponentQuery$data, + variables: queryWithRelayClientComponentQuery$variables, |}; ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; declare export opaque type queryWithRelayClientComponent_f1$fragmentType: FragmentType; -export type queryWithRelayClientComponent_f1$data = {| +export type queryWithRelayClientComponent_f1$data = ({| +__typename: "Viewer", +$fragmentType: queryWithRelayClientComponent_f1$fragmentType, |} | {| @@ -41,7 +41,7 @@ export type queryWithRelayClientComponent_f1$data = {| // value in case none of the concrete values match. +__typename: "%other", +$fragmentType: queryWithRelayClientComponent_f1$fragmentType, -|}; +|}); export type queryWithRelayClientComponent_f1$key = { +$data?: queryWithRelayClientComponent_f1$data, +$fragmentSpreads: queryWithRelayClientComponent_f1$fragmentType, @@ -50,7 +50,7 @@ export type queryWithRelayClientComponent_f1$key = { ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; declare export opaque type queryWithRelayClientComponent_f2$fragmentType: FragmentType; -export type queryWithRelayClientComponent_f2$data = {| +export type queryWithRelayClientComponent_f2$data = ({| +__typename: "Viewer", +$fragmentType: queryWithRelayClientComponent_f2$fragmentType, |} | {| @@ -58,7 +58,7 @@ export type queryWithRelayClientComponent_f2$data = {| // value in case none of the concrete values match. +__typename: "%other", +$fragmentType: queryWithRelayClientComponent_f2$fragmentType, -|}; +|}); export type queryWithRelayClientComponent_f2$key = { +$data?: queryWithRelayClientComponent_f2$data, +$fragmentSpreads: queryWithRelayClientComponent_f2$fragmentType, diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/refetchable-fragment.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/refetchable-fragment.expected index 98d03ed1d0986..e7b78415d477a 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/refetchable-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/refetchable-fragment.expected @@ -18,18 +18,18 @@ export type RefetchableFragmentQuery$data = {| |}, |}; export type RefetchableFragmentQuery = {| - variables: RefetchableFragmentQuery$variables, response: RefetchableFragmentQuery$data, + variables: RefetchableFragmentQuery$variables, |}; ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; declare export opaque type RefetchableFragment$fragmentType: FragmentType; import type { RefetchableFragmentQuery$variables } from "RefetchableFragmentQuery.graphql"; export type RefetchableFragment$data = {| - +id: string, +fragAndField: ?{| +uri: ?string, |}, + +id: string, +$fragmentType: RefetchableFragment$fragmentType, |}; export type RefetchableFragment$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/refetchable.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/refetchable.expected index 64a00f19ee630..30391f2ce880d 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/refetchable.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/refetchable.expected @@ -18,8 +18,8 @@ export type FlowRefetchableFragmentQuery$data = {| |}, |}; export type FlowRefetchableFragmentQuery = {| - variables: FlowRefetchableFragmentQuery$variables, response: FlowRefetchableFragmentQuery$data, + variables: FlowRefetchableFragmentQuery$variables, |}; ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.expected index fc03f34c9efc9..3b0091c67c703 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-client-id-field.expected @@ -40,7 +40,6 @@ export type RelayClientIDFieldQuery$data = {| +node: ?{| +__id: string, +__typename: string, - +id: string, +commentBody?: ?{| +__id: string, +__typename: string, @@ -50,9 +49,10 @@ export type RelayClientIDFieldQuery$data = {| +text: ?string, |}, |}, + +id: string, |}, |}; export type RelayClientIDFieldQuery = {| - variables: RelayClientIDFieldQuery$variables, response: RelayClientIDFieldQuery$data, + variables: RelayClientIDFieldQuery$variables, |}; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-resolver-client-edge-required.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-resolver-client-edge-required.expected index 0a50a2c27b7ff..c186d77989d0b 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-resolver-client-edge-required.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-resolver-client-edge-required.expected @@ -27,8 +27,8 @@ export type ClientEdgeQuery_relayResolver_Query_me__best_friend$data = {| |}, |}; export type ClientEdgeQuery_relayResolver_Query_me__best_friend = {| - variables: ClientEdgeQuery_relayResolver_Query_me__best_friend$variables, response: ClientEdgeQuery_relayResolver_Query_me__best_friend$data, + variables: ClientEdgeQuery_relayResolver_Query_me__best_friend$variables, |}; ------------------------------------------------------------------------------- export type relayResolver_Query$variables = {||}; @@ -40,16 +40,16 @@ export type relayResolver_Query$data = {| |}, |}; export type relayResolver_Query = {| - variables: relayResolver_Query$variables, response: relayResolver_Query$data, + variables: relayResolver_Query$variables, |}; ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; declare export opaque type RefetchableClientEdgeQuery_relayResolver_Query_me__best_friend$fragmentType: FragmentType; import type { ClientEdgeQuery_relayResolver_Query_me__best_friend$variables } from "ClientEdgeQuery_relayResolver_Query_me__best_friend.graphql"; export type RefetchableClientEdgeQuery_relayResolver_Query_me__best_friend$data = {| - +name: ?string, +id: string, + +name: ?string, +$fragmentType: RefetchableClientEdgeQuery_relayResolver_Query_me__best_friend$fragmentType, |}; export type RefetchableClientEdgeQuery_relayResolver_Query_me__best_friend$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-resolver-client-edge.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-resolver-client-edge.expected index f53d028ef68d7..617cd3da73266 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-resolver-client-edge.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-resolver-client-edge.expected @@ -27,8 +27,8 @@ export type ClientEdgeQuery_relayResolver_Query_me__best_friend$data = {| |}, |}; export type ClientEdgeQuery_relayResolver_Query_me__best_friend = {| - variables: ClientEdgeQuery_relayResolver_Query_me__best_friend$variables, response: ClientEdgeQuery_relayResolver_Query_me__best_friend$data, + variables: ClientEdgeQuery_relayResolver_Query_me__best_friend$variables, |}; ------------------------------------------------------------------------------- export type relayResolver_Query$variables = {||}; @@ -40,16 +40,16 @@ export type relayResolver_Query$data = {| |}, |}; export type relayResolver_Query = {| - variables: relayResolver_Query$variables, response: relayResolver_Query$data, + variables: relayResolver_Query$variables, |}; ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; declare export opaque type RefetchableClientEdgeQuery_relayResolver_Query_me__best_friend$fragmentType: FragmentType; import type { ClientEdgeQuery_relayResolver_Query_me__best_friend$variables } from "ClientEdgeQuery_relayResolver_Query_me__best_friend.graphql"; export type RefetchableClientEdgeQuery_relayResolver_Query_me__best_friend$data = {| - +name: ?string, +id: string, + +name: ?string, +$fragmentType: RefetchableClientEdgeQuery_relayResolver_Query_me__best_friend$fragmentType, |}; export type RefetchableClientEdgeQuery_relayResolver_Query_me__best_friend$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-resolver-multiple-consumers.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-resolver-multiple-consumers.expected index 5c54e9185d01f..71bd33387f1b6 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-resolver-multiple-consumers.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-resolver-multiple-consumers.expected @@ -22,15 +22,15 @@ import userPopStarNameResolver from "PopStarNameResolver"; export type relayResolver_Query$variables = {||}; export type relayResolver_Query$data = {| +me: ?{| - +pop_star_name: ?$Call<((...empty[]) => R) => R, typeof userPopStarNameResolver>, +parents: $ReadOnlyArray<{| +pop_star_name: ?$Call<((...empty[]) => R) => R, typeof userPopStarNameResolver>, |}>, + +pop_star_name: ?$Call<((...empty[]) => R) => R, typeof userPopStarNameResolver>, |}, |}; export type relayResolver_Query = {| - variables: relayResolver_Query$variables, response: relayResolver_Query$data, + variables: relayResolver_Query$variables, |}; ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-resolver-raw-response.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-resolver-raw-response.expected index ea366f412d070..2df0992fb4f80 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-resolver-raw-response.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-resolver-raw-response.expected @@ -28,14 +28,14 @@ export type relayResolver_Query$data = {| |}; export type relayResolver_Query$rawResponse = {| +me: ?{| - +name: ?string, +id: string, + +name: ?string, |}, |}; export type relayResolver_Query = {| - variables: relayResolver_Query$variables, - response: relayResolver_Query$data, rawResponse: relayResolver_Query$rawResponse, + response: relayResolver_Query$data, + variables: relayResolver_Query$variables, |}; ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-resolver-required.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-resolver-required.expected index d652342a705d3..bb9e4f07a3ba9 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-resolver-required.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-resolver-required.expected @@ -23,8 +23,8 @@ export type relayResolver_Query$data = {| |}, |}; export type relayResolver_Query = {| - variables: relayResolver_Query$variables, response: relayResolver_Query$data, + variables: relayResolver_Query$variables, |}; ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-resolver.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-resolver.expected index b96d8bf3ac7c4..ee9fe932df768 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-resolver.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/relay-resolver.expected @@ -23,8 +23,8 @@ export type relayResolver_Query$data = {| |}, |}; export type relayResolver_Query = {| - variables: relayResolver_Query$variables, response: relayResolver_Query$data, + variables: relayResolver_Query$variables, |}; ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-item-in-required-plural-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-item-in-required-plural-field.expected index 761a52e62b348..60320871071d4 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-item-in-required-plural-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-item-in-required-plural-field.expected @@ -16,6 +16,6 @@ export type TestQuery$data = {| |}, |}; export type TestQuery = {| - variables: TestQuery$variables, response: TestQuery$data, + variables: TestQuery$variables, |}; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-query.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-query.expected index 5494b666af21a..103938ccaea87 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-query.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-to-query.expected @@ -14,6 +14,6 @@ export type FooQuery$data = ?{| |}, |}; export type FooQuery = {| - variables: FooQuery$variables, response: FooQuery$data, + variables: FooQuery$variables, |}; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-up-to-mutation-response.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-up-to-mutation-response.expected index ebc0312e21d6a..38e9102bcd358 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-up-to-mutation-response.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-bubbles-up-to-mutation-response.expected @@ -9,8 +9,8 @@ mutation CommentCreateMutation($input: CommentCreateInput!) { ==================================== OUTPUT =================================== export type CommentCreateInput = {| clientMutationId?: ?string, - feedbackId?: ?string, feedback?: ?CommentfeedbackFeedback, + feedbackId?: ?string, |}; export type CommentfeedbackFeedback = {| comment?: ?FeedbackcommentComment, @@ -29,6 +29,6 @@ export type CommentCreateMutation$data = ?{| |}, |}; export type CommentCreateMutation = {| - variables: CommentCreateMutation$variables, response: CommentCreateMutation$data, + variables: CommentCreateMutation$variables, |}; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-isolates-concrete-inline-fragments.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-isolates-concrete-inline-fragments.expected index 6fa09e2484cb3..99cd97a503b2f 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-isolates-concrete-inline-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-isolates-concrete-inline-fragments.expected @@ -31,10 +31,10 @@ fragment Foo on Node { import type { FragmentType } from "relay-runtime"; declare export opaque type Bar$fragmentType: FragmentType; export type Bar$data = ?{| - +name?: string, +body?: ?{| +text: ?string, |}, + +name?: string, +$fragmentType: Bar$fragmentType, |}; export type Bar$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-raw-response-type.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-raw-response-type.expected index 69a2817e940ea..71f5923524834 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-raw-response-type.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-raw-response-type.expected @@ -20,7 +20,7 @@ export type MyQuery$rawResponse = {| |}, |}; export type MyQuery = {| - variables: MyQuery$variables, - response: MyQuery$data, rawResponse: MyQuery$rawResponse, + response: MyQuery$data, + variables: MyQuery$variables, |}; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throw-doesnt-bubbles-to-query.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throw-doesnt-bubbles-to-query.expected index 62828af939f39..688245b6507a5 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throw-doesnt-bubbles-to-query.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throw-doesnt-bubbles-to-query.expected @@ -14,6 +14,6 @@ export type FooQuery$data = {| |}, |}; export type FooQuery = {| - variables: FooQuery$variables, response: FooQuery$data, + variables: FooQuery$variables, |}; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throws-nested.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throws-nested.expected index cee6ae5176a32..4a91f62550f35 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throws-nested.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required-throws-nested.expected @@ -14,6 +14,6 @@ export type FooQuery$data = {| |}, |}; export type FooQuery = {| - variables: FooQuery$variables, response: FooQuery$data, + variables: FooQuery$variables, |}; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required.expected index 898437b5df75f..05ae2e64136b0 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/required.expected @@ -14,6 +14,6 @@ export type FooQuery$data = {| |}, |}; export type FooQuery = {| - variables: FooQuery$variables, response: FooQuery$data, + variables: FooQuery$variables, |}; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/roots.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/roots.expected index 531a408b182a0..8b64e34846af4 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/roots.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/roots.expected @@ -34,14 +34,14 @@ export type ExampleQuery$data = {| |}, |}; export type ExampleQuery = {| - variables: ExampleQuery$variables, response: ExampleQuery$data, + variables: ExampleQuery$variables, |}; ------------------------------------------------------------------------------- export type CommentCreateInput = {| clientMutationId?: ?string, - feedbackId?: ?string, feedback?: ?CommentfeedbackFeedback, + feedbackId?: ?string, |}; export type CommentfeedbackFeedback = {| comment?: ?FeedbackcommentComment, @@ -60,8 +60,8 @@ export type TestMutation$data = {| |}, |}; export type TestMutation = {| - variables: TestMutation$variables, response: TestMutation$data, + variables: TestMutation$variables, |}; ------------------------------------------------------------------------------- export type FeedbackLikeInput = {| @@ -79,8 +79,8 @@ export type TestSubscription$data = {| |}, |}; export type TestSubscription = {| - variables: TestSubscription$variables, response: TestSubscription$data, + variables: TestSubscription$variables, |}; ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/scalar-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/scalar-field.expected index 5ee30baa7a336..bc08dc4951c74 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/scalar-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/scalar-field.expected @@ -13,21 +13,21 @@ fragment ScalarField on User { } } ==================================== OUTPUT =================================== -export type PersonalityTraits = "CHEERFUL" | "DERISIVE" | "HELPFUL" | "SNARKY" | "%future added value"; +export type PersonalityTraits = ("CHEERFUL" | "DERISIVE" | "HELPFUL" | "SNARKY" | "%future added value"); import type { FragmentType } from "relay-runtime"; declare export opaque type ScalarField$fragmentType: FragmentType; export type ScalarField$data = {| - +id: string, - +name: ?string, - +websites: ?$ReadOnlyArray, - +traits: ?$ReadOnlyArray, +aliasedLinkedField: ?{| +aliasedField: ?number, |}, + +id: string, + +name: ?string, +screennames: ?$ReadOnlyArray, + +traits: ?$ReadOnlyArray, + +websites: ?$ReadOnlyArray, +$fragmentType: ScalarField$fragmentType, |}; export type ScalarField$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/simple.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/simple.expected index d25773978dab6..18d40dd4cfcbd 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/simple.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/simple.expected @@ -13,9 +13,9 @@ declare export opaque type LinkedField$fragmentType: FragmentType; export type LinkedField$data = {| +name: ?string, +profilePicture: ?{| + +height: ?number, +uri: ?string, +width: ?number, - +height: ?number, |}, +$fragmentType: LinkedField$fragmentType, |}; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected index eed2114e51650..0dc9cb8a4ef57 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected @@ -82,7 +82,7 @@ fragment TypenameAliases on Actor { ==================================== OUTPUT =================================== import type { FragmentType } from "relay-runtime"; declare export opaque type TypenameAlias$fragmentType: FragmentType; -export type TypenameAlias$data = {| +export type TypenameAlias$data = ({| +_typeAlias: "User", +firstName: ?string, +$fragmentType: TypenameAlias$fragmentType, @@ -95,7 +95,7 @@ export type TypenameAlias$data = {| // value in case none of the concrete values match. +_typeAlias: "%other", +$fragmentType: TypenameAlias$fragmentType, -|}; +|}); export type TypenameAlias$key = { +$data?: TypenameAlias$data, +$fragmentSpreads: TypenameAlias$fragmentType, @@ -104,7 +104,7 @@ export type TypenameAlias$key = { ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; declare export opaque type TypenameAliases$fragmentType: FragmentType; -export type TypenameAliases$data = {| +export type TypenameAliases$data = ({| +_typeAlias1: "User", +_typeAlias2: "User", +firstName: ?string, @@ -122,7 +122,7 @@ export type TypenameAliases$data = {| // value in case none of the concrete values match. +_typeAlias2: "%other", +$fragmentType: TypenameAliases$fragmentType, -|}; +|}); export type TypenameAliases$key = { +$data?: TypenameAliases$data, +$fragmentSpreads: TypenameAliases$fragmentType, @@ -131,7 +131,7 @@ export type TypenameAliases$key = { ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; declare export opaque type TypenameInside$fragmentType: FragmentType; -export type TypenameInside$data = {| +export type TypenameInside$data = ({| +__typename: "User", +firstName: ?string, +$fragmentType: TypenameInside$fragmentType, @@ -144,7 +144,7 @@ export type TypenameInside$data = {| // value in case none of the concrete values match. +__typename: "%other", +$fragmentType: TypenameInside$fragmentType, -|}; +|}); export type TypenameInside$key = { +$data?: TypenameInside$data, +$fragmentSpreads: TypenameInside$fragmentType, @@ -153,7 +153,7 @@ export type TypenameInside$key = { ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; declare export opaque type TypenameOutside$fragmentType: FragmentType; -export type TypenameOutside$data = {| +export type TypenameOutside$data = ({| +__typename: "User", +firstName: ?string, +$fragmentType: TypenameOutside$fragmentType, @@ -166,7 +166,7 @@ export type TypenameOutside$data = {| // value in case none of the concrete values match. +__typename: "%other", +$fragmentType: TypenameOutside$fragmentType, -|}; +|}); export type TypenameOutside$key = { +$data?: TypenameOutside$data, +$fragmentSpreads: TypenameOutside$fragmentType, @@ -177,13 +177,13 @@ import type { FragmentType } from "relay-runtime"; declare export opaque type TypenameOutsideWithAbstractType$fragmentType: FragmentType; export type TypenameOutsideWithAbstractType$data = {| +__typename: string, - +username?: ?string, +address?: ?{| +city: ?string, +country: ?string, +street?: ?string, |}, +firstName?: ?string, + +username?: ?string, +$fragmentType: TypenameOutsideWithAbstractType$fragmentType, |}; export type TypenameOutsideWithAbstractType$key = { @@ -196,8 +196,8 @@ import type { FragmentType } from "relay-runtime"; declare export opaque type TypenameWithCommonSelections$fragmentType: FragmentType; export type TypenameWithCommonSelections$data = {| +__typename: string, - +name: ?string, +firstName?: ?string, + +name: ?string, +username?: ?string, +$fragmentType: TypenameWithCommonSelections$fragmentType, |}; @@ -210,8 +210,8 @@ export type TypenameWithCommonSelections$key = { import type { FragmentType } from "relay-runtime"; declare export opaque type TypenameWithoutSpreads$fragmentType: FragmentType; export type TypenameWithoutSpreads$data = {| - +firstName: ?string, +__typename: "User", + +firstName: ?string, +$fragmentType: TypenameWithoutSpreads$fragmentType, |}; export type TypenameWithoutSpreads$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/unmasked-fragment-spreads.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/unmasked-fragment-spreads.expected index 405e4741c39dc..e30057c5233be 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/unmasked-fragment-spreads.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/unmasked-fragment-spreads.expected @@ -29,8 +29,8 @@ fragment AnotherRecursiveFragment on Image { import type { FragmentType } from "relay-runtime"; declare export opaque type AnotherRecursiveFragment$fragmentType: FragmentType; export type AnotherRecursiveFragment$data = {| - +uri: ?string, +height: ?number, + +uri: ?string, +$fragmentType: AnotherRecursiveFragment$fragmentType, |}; export type AnotherRecursiveFragment$key = { @@ -70,9 +70,9 @@ import type { FragmentType } from "relay-runtime"; declare export opaque type UserProfile$fragmentType: FragmentType; export type UserProfile$data = {| +profilePicture: ?{| + +height: ?number, +uri: ?string, +width: ?number, - +height: ?number, +$fragmentSpreads: PhotoFragment$fragmentType, |}, +$fragmentType: UserProfile$fragmentType, diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation-assignable-fragment-plural.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation-assignable-fragment-plural.expected index 4f709957b5f05..3cb460dc04ca0 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation-assignable-fragment-plural.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation-assignable-fragment-plural.expected @@ -21,9 +21,9 @@ export type UpdatableQuery$data = {| +__typename: "User", get parents(): $ReadOnlyArray<{||}>, set parents(value: $ReadOnlyArray<{ - +$fragmentSpreads: Assignable_user$fragmentType, - +__typename: "User", +__id: string, + +__typename: "User", + +$fragmentSpreads: Assignable_user$fragmentType, ... }>): void, |} | {| @@ -34,8 +34,8 @@ export type UpdatableQuery$data = {| set node(value: null | void): void, |}; export type UpdatableQuery = {| - variables: UpdatableQuery$variables, response: UpdatableQuery$data, + variables: UpdatableQuery$variables, |}; ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation-assignable-fragment.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation-assignable-fragment.expected index 44e339c6ad075..2e64829f9f437 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation-assignable-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation-assignable-fragment.expected @@ -14,15 +14,15 @@ export type UpdatableQuery$variables = {||}; export type UpdatableQuery$data = {| get viewer(): ?{||}, set viewer(value: ?{ - +$fragmentSpreads: Assignable_viewer$fragmentType, - +__typename: "Viewer", +__id: string, + +__typename: "Viewer", + +$fragmentSpreads: Assignable_viewer$fragmentType, ... }): void, |}; export type UpdatableQuery = {| - variables: UpdatableQuery$variables, response: UpdatableQuery$data, + variables: UpdatableQuery$variables, |}; ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation-assignable-fragments-within-narrowing.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation-assignable-fragments-within-narrowing.expected index ddaa73f4cec56..ff6ca71a80947 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation-assignable-fragments-within-narrowing.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation-assignable-fragments-within-narrowing.expected @@ -37,22 +37,22 @@ export type UpdatableQuery$data = {| +__typename: "%other", |}), set actor(value: ?({ - +$fragmentSpreads: Assignable_user$fragmentType, - +__typename: "User", +__id: string, + +__typename: "User", + +$fragmentSpreads: Assignable_user$fragmentType, ... } | { - +$fragmentSpreads: Assignable_page$fragmentType, - +__typename: "Page", +__id: string, + +__typename: "Page", + +$fragmentSpreads: Assignable_page$fragmentType, ... })): void, |}, set me(value: null | void): void, |}; export type UpdatableQuery = {| - variables: UpdatableQuery$variables, response: UpdatableQuery$data, + variables: UpdatableQuery$variables, |}; ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation-multiple-assignable-fragments.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation-multiple-assignable-fragments.expected index c73e3d8225e48..1319824de75c7 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation-multiple-assignable-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation-multiple-assignable-fragments.expected @@ -28,22 +28,22 @@ export type UpdatableQuery$data = {| name: ?string, |}, set actor(value: ?({ - +$fragmentSpreads: Assignable_page$fragmentType, - +__typename: "Page", +__id: string, + +__typename: "Page", + +$fragmentSpreads: Assignable_page$fragmentType, ... } | { - +$fragmentSpreads: Assignable_node$fragmentType, - +__isAssignable_node: string, +__id: string, + +__isAssignable_node: string, + +$fragmentSpreads: Assignable_node$fragmentType, ... })): void, |}, set me(value: null | void): void, |}; export type UpdatableQuery = {| - variables: UpdatableQuery$variables, response: UpdatableQuery$data, + variables: UpdatableQuery$variables, |}; ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation-plural-field-no-spreads.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation-plural-field-no-spreads.expected index a19f1a4dbc4ef..9276bfd40a13d 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation-plural-field-no-spreads.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation-plural-field-no-spreads.expected @@ -13,6 +13,6 @@ export type UpdatableQuery$data = {| set nodes(value: []): void, |}; export type UpdatableQuery = {| - variables: UpdatableQuery$variables, response: UpdatableQuery$data, + variables: UpdatableQuery$variables, |}; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation-plural-field-with-spreads.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation-plural-field-with-spreads.expected index 493cb1ddb4e31..0a68ba40864bd 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation-plural-field-with-spreads.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation-plural-field-with-spreads.expected @@ -14,15 +14,15 @@ export type UpdatableQuery$variables = {||}; export type UpdatableQuery$data = {| get nodes(): ?$ReadOnlyArray, set nodes(value: $ReadOnlyArray<{ - +$fragmentSpreads: Updatable_user$fragmentType, - +__typename: "User", +__id: string, + +__typename: "User", + +$fragmentSpreads: Updatable_user$fragmentType, ... }>): void, |}; export type UpdatableQuery = {| - variables: UpdatableQuery$variables, response: UpdatableQuery$data, + variables: UpdatableQuery$variables, |}; ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation-special-fields.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation-special-fields.expected index ebef2e1638afc..78160923d3f17 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation-special-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation-special-fields.expected @@ -13,16 +13,16 @@ query UpdatableQuery @updatable { export type UpdatableQuery$variables = {||}; export type UpdatableQuery$data = {| get me(): ?{| - +id: string, - +aliased_id: string, - +__typename: string, - +aliased_typename: string, +__id: string, + +__typename: string, +aliased_double_under_id: string, + +aliased_id: string, + +aliased_typename: string, + +id: string, |}, set me(value: null | void): void, |}; export type UpdatableQuery = {| - variables: UpdatableQuery$variables, response: UpdatableQuery$data, + variables: UpdatableQuery$variables, |}; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation-type-refinement.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation-type-refinement.expected index 37443ff93c312..e8928bb589def 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation-type-refinement.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation-type-refinement.expected @@ -35,6 +35,6 @@ export type UpdatableQuery$data = {| set maybeNodeInterface(value: null | void): void, |}; export type UpdatableQuery = {| - variables: UpdatableQuery$variables, response: UpdatableQuery$data, + variables: UpdatableQuery$variables, |}; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation.expected index 43f7524ece28e..6b2857840a135 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/updatable-operation.expected @@ -15,6 +15,6 @@ export type UpdatableQuery$data = {| set me(value: null | void): void, |}; export type UpdatableQuery = {| - variables: UpdatableQuery$variables, response: UpdatableQuery$data, + variables: UpdatableQuery$variables, |}; diff --git a/compiler/crates/relay-typegen/tests/generate_flow_with_custom_id/fixtures/relay-client-id-field.expected b/compiler/crates/relay-typegen/tests/generate_flow_with_custom_id/fixtures/relay-client-id-field.expected index e0f1d8e520cd2..ef731b540259a 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow_with_custom_id/fixtures/relay-client-id-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow_with_custom_id/fixtures/relay-client-id-field.expected @@ -40,7 +40,6 @@ export type RelayClientIDFieldQuery$data = {| +node: ?{| +__id: string, +__typename: string, - +global_id: string, +commentBody?: ?{| +__id: string, +__typename: string, @@ -50,9 +49,10 @@ export type RelayClientIDFieldQuery$data = {| +text: ?string, |}, |}, + +global_id: string, |}, |}; export type RelayClientIDFieldQuery = {| - variables: RelayClientIDFieldQuery$variables, response: RelayClientIDFieldQuery$data, + variables: RelayClientIDFieldQuery$variables, |}; diff --git a/compiler/crates/relay-typegen/tests/generate_flow_with_custom_id/fixtures/simple.expected b/compiler/crates/relay-typegen/tests/generate_flow_with_custom_id/fixtures/simple.expected index b96919653ba75..942f6e342cce7 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow_with_custom_id/fixtures/simple.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow_with_custom_id/fixtures/simple.expected @@ -15,9 +15,9 @@ export type LinkedField$data = {| +global_id: string, +name: ?string, +profilePicture: ?{| + +height: ?number, +uri: ?string, +width: ?number, - +height: ?number, |}, +$fragmentType: LinkedField$fragmentType, |}; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected index 927b89e603bd3..9c1147112f012 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected @@ -50,18 +50,18 @@ fragment UserFrag2 on User { ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; export type ConcreateTypes$data = { - readonly actor: { + readonly actor: ({ readonly __typename: "Page"; readonly id: string; readonly " $fragmentSpreads": FragmentRefs<"PageFragment">; } | { readonly __typename: "User"; - readonly name: string | null; + readonly name: (string | null); } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly __typename: "%other"; - } | null; + } | null); readonly " $fragmentType": "ConcreateTypes"; }; export type ConcreateTypes$key = { @@ -71,15 +71,15 @@ export type ConcreateTypes$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type FragmentSpread$data = { - readonly id: string; - readonly justFrag: { + readonly fragAndField: ({ + readonly uri: (string | null); readonly " $fragmentSpreads": FragmentRefs<"PictureFragment">; - } | null; - readonly fragAndField: { - readonly uri: string | null; + } | null); + readonly id: string; + readonly justFrag: ({ readonly " $fragmentSpreads": FragmentRefs<"PictureFragment">; - } | null; - readonly " $fragmentSpreads": FragmentRefs<"OtherFragment" | "UserFrag1" | "UserFrag2">; + } | null); + readonly " $fragmentSpreads": FragmentRefs<("OtherFragment" | "UserFrag1" | "UserFrag2")>; readonly " $fragmentType": "FragmentSpread"; }; export type FragmentSpread$key = { @@ -98,7 +98,7 @@ export type OtherFragment$key = { }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type PageFragment$data = { +export type PageFragment$data = ({ readonly __typename: "Page"; readonly " $fragmentType": "PageFragment"; } | { @@ -106,14 +106,14 @@ export type PageFragment$data = { // value in case none of the concrete values match. readonly __typename: "%other"; readonly " $fragmentType": "PageFragment"; -}; +}); export type PageFragment$key = { readonly " $data"?: PageFragment$data; readonly " $fragmentSpreads": FragmentRefs<"PageFragment">; }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type PictureFragment$data = { +export type PictureFragment$data = ({ readonly __typename: "Image"; readonly " $fragmentType": "PictureFragment"; } | { @@ -121,14 +121,14 @@ export type PictureFragment$data = { // value in case none of the concrete values match. readonly __typename: "%other"; readonly " $fragmentType": "PictureFragment"; -}; +}); export type PictureFragment$key = { readonly " $data"?: PictureFragment$data; readonly " $fragmentSpreads": FragmentRefs<"PictureFragment">; }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type UserFrag1$data = { +export type UserFrag1$data = ({ readonly __typename: "User"; readonly " $fragmentType": "UserFrag1"; } | { @@ -136,14 +136,14 @@ export type UserFrag1$data = { // value in case none of the concrete values match. readonly __typename: "%other"; readonly " $fragmentType": "UserFrag1"; -}; +}); export type UserFrag1$key = { readonly " $data"?: UserFrag1$data; readonly " $fragmentSpreads": FragmentRefs<"UserFrag1">; }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type UserFrag2$data = { +export type UserFrag2$data = ({ readonly __typename: "User"; readonly " $fragmentType": "UserFrag2"; } | { @@ -151,7 +151,7 @@ export type UserFrag2$data = { // value in case none of the concrete values match. readonly __typename: "%other"; readonly " $fragmentType": "UserFrag2"; -}; +}); export type UserFrag2$key = { readonly " $data"?: UserFrag2$data; readonly " $fragmentSpreads": FragmentRefs<"UserFrag2">; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected index f5b5a538f0cd5..3255f3f37dad0 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected @@ -67,10 +67,10 @@ fragment SomeFragment on User { import { FragmentRefs } from "relay-runtime"; export type InlineFragment$data = { readonly id: string; - readonly name?: string | null; - readonly message?: { - readonly text: string | null; - } | null; + readonly message?: ({ + readonly text: (string | null); + } | null); + readonly name?: (string | null); readonly " $fragmentType": "InlineFragment"; }; export type InlineFragment$key = { @@ -81,7 +81,7 @@ export type InlineFragment$key = { import { FragmentRefs } from "relay-runtime"; export type InlineFragmentConditionalID$data = { readonly id?: string; - readonly name?: string | null; + readonly name?: (string | null); readonly " $fragmentType": "InlineFragmentConditionalID"; }; export type InlineFragmentConditionalID$key = { @@ -91,16 +91,16 @@ export type InlineFragmentConditionalID$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type InlineFragmentKitchenSink$data = { - readonly actor: { + readonly actor: ({ readonly id: string; - readonly profilePicture: { - readonly uri: string | null; - readonly width?: number | null; - readonly height?: number | null; - } | null; - readonly name?: string | null; + readonly name?: (string | null); + readonly profilePicture: ({ + readonly height?: (number | null); + readonly uri: (string | null); + readonly width?: (number | null); + } | null); readonly " $fragmentSpreads": FragmentRefs<"SomeFragment">; - } | null; + } | null); readonly " $fragmentType": "InlineFragmentKitchenSink"; }; export type InlineFragmentKitchenSink$key = { @@ -110,14 +110,14 @@ export type InlineFragmentKitchenSink$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type InlineFragmentWithOverlappingFields$data = { - readonly hometown?: { + readonly hometown?: ({ readonly id: string; - readonly name: string | null; - readonly message?: { - readonly text: string | null; - } | null; - } | null; - readonly name?: string | null; + readonly message?: ({ + readonly text: (string | null); + } | null); + readonly name: (string | null); + } | null); + readonly name?: (string | null); readonly " $fragmentType": "InlineFragmentWithOverlappingFields"; }; export type InlineFragmentWithOverlappingFields$key = { @@ -126,7 +126,7 @@ export type InlineFragmentWithOverlappingFields$key = { }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type SomeFragment$data = { +export type SomeFragment$data = ({ readonly __typename: "User"; readonly " $fragmentType": "SomeFragment"; } | { @@ -134,7 +134,7 @@ export type SomeFragment$data = { // value in case none of the concrete values match. readonly __typename: "%other"; readonly " $fragmentType": "SomeFragment"; -}; +}); export type SomeFragment$key = { readonly " $data"?: SomeFragment$data; readonly " $fragmentSpreads": FragmentRefs<"SomeFragment">; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected index 11f844e52f872..fe7a0c21c3ccb 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected @@ -29,36 +29,36 @@ query UnionTypeTest { ==================================== OUTPUT =================================== export type UnionTypeTest$variables = {}; export type UnionTypeTest$data = { - readonly neverNode: { + readonly neverNode: ({ readonly __typename: "FakeNode"; readonly id: string; } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly __typename: "%other"; - } | null; + } | null); }; export type UnionTypeTest = { - variables: UnionTypeTest$variables; response: UnionTypeTest$data; + variables: UnionTypeTest$variables; }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type LinkedField$data = { - readonly profilePicture: { - readonly uri: string | null; - readonly width: number | null; - readonly height: number | null; - } | null; - readonly hometown: { + readonly actor: ({ readonly id: string; - readonly profilePicture: { - readonly uri: string | null; - } | null; - } | null; - readonly actor: { + } | null); + readonly hometown: ({ readonly id: string; - } | null; + readonly profilePicture: ({ + readonly uri: (string | null); + } | null); + } | null); + readonly profilePicture: ({ + readonly height: (number | null); + readonly uri: (string | null); + readonly width: (number | null); + } | null); readonly " $fragmentType": "LinkedField"; }; export type LinkedField$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected index 14e4e1e51a48f..7e2ba290645b0 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected @@ -26,25 +26,25 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { import { FragmentRefs } from "relay-runtime"; export type NameRendererQuery$variables = {}; export type NameRendererQuery$data = { - readonly me: { - readonly nameRenderer: { - readonly __fragmentPropName?: string | null; - readonly __module_component?: string | null; - readonly " $fragmentSpreads": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">; - } | null; - } | null; + readonly me: ({ + readonly nameRenderer: ({ + readonly __fragmentPropName?: (string | null); + readonly __module_component?: (string | null); + readonly " $fragmentSpreads": FragmentRefs<("PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name")>; + } | null); + } | null); }; export type NameRendererQuery = { - variables: NameRendererQuery$variables; response: NameRendererQuery$data; + variables: NameRendererQuery$variables; }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type MarkdownUserNameRenderer_name$data = { - readonly markdown: string | null; - readonly data: { - readonly markup: string | null; - } | null; + readonly data: ({ + readonly markup: (string | null); + } | null); + readonly markdown: (string | null); readonly " $fragmentType": "MarkdownUserNameRenderer_name"; }; export type MarkdownUserNameRenderer_name$key = { @@ -54,10 +54,10 @@ export type MarkdownUserNameRenderer_name$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type PlainUserNameRenderer_name$data = { - readonly plaintext: string | null; - readonly data: { - readonly text: string | null; - } | null; + readonly data: ({ + readonly text: (string | null); + } | null); + readonly plaintext: (string | null); readonly " $fragmentType": "PlainUserNameRenderer_name"; }; export type PlainUserNameRenderer_name$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected index 941c533133126..8e49d22de0f1c 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected @@ -24,10 +24,10 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; export type MarkdownUserNameRenderer_name$data = { - readonly markdown: string | null; - readonly data: { - readonly markup: string | null; - } | null; + readonly data: ({ + readonly markup: (string | null); + } | null); + readonly markdown: (string | null); readonly " $fragmentType": "MarkdownUserNameRenderer_name"; }; export type MarkdownUserNameRenderer_name$key = { @@ -38,11 +38,11 @@ export type MarkdownUserNameRenderer_name$key = { import { FragmentRefs } from "relay-runtime"; export type NameRendererFragment$data = { readonly id: string; - readonly nameRenderer: { - readonly __fragmentPropName?: string | null; - readonly __module_component?: string | null; - readonly " $fragmentSpreads": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">; - } | null; + readonly nameRenderer: ({ + readonly __fragmentPropName?: (string | null); + readonly __module_component?: (string | null); + readonly " $fragmentSpreads": FragmentRefs<("PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name")>; + } | null); readonly " $fragmentType": "NameRendererFragment"; }; export type NameRendererFragment$key = { @@ -52,10 +52,10 @@ export type NameRendererFragment$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type PlainUserNameRenderer_name$data = { - readonly plaintext: string | null; - readonly data: { - readonly text: string | null; - } | null; + readonly data: ({ + readonly text: (string | null); + } | null); + readonly plaintext: (string | null); readonly " $fragmentType": "PlainUserNameRenderer_name"; }; export type PlainUserNameRenderer_name$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-input-has-array.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-input-has-array.expected index 0bbbaaed1d8dd..83907b1f89e7a 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-input-has-array.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-input-has-array.expected @@ -8,29 +8,29 @@ mutation InputHasArray($input: UpdateAllSeenStateInput) @raw_response_type { } ==================================== OUTPUT =================================== export type UpdateAllSeenStateInput = { - clientMutationId?: string | null; - storyIds?: ReadonlyArray | null; + clientMutationId?: (string | null); + storyIds?: (ReadonlyArray<(string | null)> | null); }; export type InputHasArray$variables = { - input?: UpdateAllSeenStateInput | null; + input?: (UpdateAllSeenStateInput | null); }; export type InputHasArray$data = { - readonly viewerNotificationsUpdateAllSeenState: { - readonly stories: ReadonlyArray<{ - readonly actorCount: number | null; - } | null> | null; - } | null; + readonly viewerNotificationsUpdateAllSeenState: ({ + readonly stories: (ReadonlyArray<({ + readonly actorCount: (number | null); + } | null)> | null); + } | null); }; export type InputHasArray$rawResponse = { - readonly viewerNotificationsUpdateAllSeenState: { - readonly stories: ReadonlyArray<{ - readonly actorCount: number | null; + readonly viewerNotificationsUpdateAllSeenState: ({ + readonly stories: (ReadonlyArray<({ + readonly actorCount: (number | null); readonly id: string; - } | null> | null; - } | null; + } | null)> | null); + } | null); }; export type InputHasArray = { - variables: InputHasArray$variables; - response: InputHasArray$data; rawResponse: InputHasArray$rawResponse; + response: InputHasArray$data; + variables: InputHasArray$variables; }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-client-extension.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-client-extension.expected index b47e233b8d2e4..801da077786ba 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-client-extension.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-client-extension.expected @@ -20,33 +20,33 @@ type Foo { } ==================================== OUTPUT =================================== export type UpdateAllSeenStateInput = { - clientMutationId?: string | null; - storyIds?: ReadonlyArray | null; + clientMutationId?: (string | null); + storyIds?: (ReadonlyArray<(string | null)> | null); }; export type Test$variables = { - input?: UpdateAllSeenStateInput | null; + input?: (UpdateAllSeenStateInput | null); }; export type Test$data = { - readonly viewerNotificationsUpdateAllSeenState: { - readonly stories: ReadonlyArray<{ - readonly foos: ReadonlyArray<{ - readonly bar: string | null; - } | null> | null; - } | null> | null; - } | null; + readonly viewerNotificationsUpdateAllSeenState: ({ + readonly stories: (ReadonlyArray<({ + readonly foos: (ReadonlyArray<({ + readonly bar: (string | null); + } | null)> | null); + } | null)> | null); + } | null); }; export type Test$rawResponse = { - readonly viewerNotificationsUpdateAllSeenState: { - readonly stories: ReadonlyArray<{ + readonly viewerNotificationsUpdateAllSeenState: ({ + readonly stories: (ReadonlyArray<({ + readonly foos?: (ReadonlyArray<({ + readonly bar: (string | null); + } | null)> | null); readonly id: string; - readonly foos?: ReadonlyArray<{ - readonly bar: string | null; - } | null> | null; - } | null> | null; - } | null; + } | null)> | null); + } | null); }; export type Test = { - variables: Test$variables; - response: Test$data; rawResponse: Test$rawResponse; + response: Test$data; + variables: Test$variables; }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected index 0df586bfa0c71..c97efb5f50c48 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected @@ -28,72 +28,72 @@ fragment FriendFragment on User { } ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; -export type TestEnums = "mark" | "zuck" | "%future added value"; +export type TestEnums = ("mark" | "zuck" | "%future added value"); export type CommentCreateInput = { - clientMutationId?: string | null; - feedbackId?: string | null; - feedback?: CommentfeedbackFeedback | null; + clientMutationId?: (string | null); + feedback?: (CommentfeedbackFeedback | null); + feedbackId?: (string | null); }; export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null; + comment?: (FeedbackcommentComment | null); }; export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null; + feedback?: (CommentfeedbackFeedback | null); }; export type CommentCreateMutation$variables = { + first?: (number | null); input: CommentCreateInput; - first?: number | null; - orderBy?: ReadonlyArray | null; + orderBy?: (ReadonlyArray | null); }; export type CommentCreateMutation$data = { - readonly commentCreate: { - readonly comment: { - readonly friends: { - readonly edges: ReadonlyArray<{ - readonly node: { - readonly id: string; + readonly commentCreate: ({ + readonly comment: ({ + readonly friends: ({ + readonly edges: (ReadonlyArray<({ + readonly node: ({ readonly __typename: string; + readonly id: string; readonly " $fragmentSpreads": FragmentRefs<"FriendFragment">; - } | null; - } | null> | null; - } | null; - } | null; - } | null; + } | null); + } | null)> | null); + } | null); + } | null); + } | null); }; export type CommentCreateMutation$rawResponse = { - readonly commentCreate: { - readonly comment: { - readonly friends: { - readonly edges: ReadonlyArray<{ - readonly node: { - readonly id: string; + readonly commentCreate: ({ + readonly comment: ({ + readonly friends: ({ + readonly edges: (ReadonlyArray<({ + readonly node: ({ readonly __typename: "User"; - readonly name: string | null; - readonly lastName: string | null; - readonly profilePicture2: { - readonly test_enums: TestEnums | null; - } | null; - } | null; - } | null> | null; - } | null; + readonly id: string; + readonly lastName: (string | null); + readonly name: (string | null); + readonly profilePicture2: ({ + readonly test_enums: (TestEnums | null); + } | null); + } | null); + } | null)> | null); + } | null); readonly id: string; - } | null; - } | null; + } | null); + } | null); }; export type CommentCreateMutation = { - variables: CommentCreateMutation$variables; - response: CommentCreateMutation$data; rawResponse: CommentCreateMutation$rawResponse; + response: CommentCreateMutation$data; + variables: CommentCreateMutation$variables; }; ------------------------------------------------------------------------------- -export type TestEnums = "mark" | "zuck" | "%future added value"; +export type TestEnums = ("mark" | "zuck" | "%future added value"); import { FragmentRefs } from "relay-runtime"; export type FriendFragment$data = { - readonly name: string | null; - readonly lastName: string | null; - readonly profilePicture2: { - readonly test_enums: TestEnums | null; - } | null; + readonly lastName: (string | null); + readonly name: (string | null); + readonly profilePicture2: ({ + readonly test_enums: (TestEnums | null); + } | null); readonly " $fragmentType": "FriendFragment"; }; export type FriendFragment$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected index bc94c4958a3a0..ef655f9836fbf 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected @@ -33,65 +33,65 @@ fragment FeedbackFragment on Feedback { ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; export type CommentCreateInput = { - clientMutationId?: string | null; - feedbackId?: string | null; - feedback?: CommentfeedbackFeedback | null; + clientMutationId?: (string | null); + feedback?: (CommentfeedbackFeedback | null); + feedbackId?: (string | null); }; export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null; + comment?: (FeedbackcommentComment | null); }; export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null; + feedback?: (CommentfeedbackFeedback | null); }; export type CommentCreateMutation$variables = { + first?: (number | null); input: CommentCreateInput; - first?: number | null; - orderBy?: ReadonlyArray | null; + orderBy?: (ReadonlyArray | null); }; export type CommentCreateMutation$data = { - readonly commentCreate: { - readonly comment: { - readonly friends: { - readonly edges: ReadonlyArray<{ - readonly node: { - readonly lastName: string | null; + readonly commentCreate: ({ + readonly comment: ({ + readonly friends: ({ + readonly edges: (ReadonlyArray<({ + readonly node: ({ + readonly lastName: (string | null); readonly " $fragmentSpreads": FragmentRefs<"FriendFragment">; - } | null; - } | null> | null; - } | null; - } | null; - } | null; + } | null); + } | null)> | null); + } | null); + } | null); + } | null); }; export type CommentCreateMutation$rawResponse = { - readonly commentCreate: { - readonly comment: { - readonly friends: { - readonly edges: ReadonlyArray<{ - readonly node: { - readonly lastName: string | null; - readonly name: string | null; - readonly feedback: { + readonly commentCreate: ({ + readonly comment: ({ + readonly friends: ({ + readonly edges: (ReadonlyArray<({ + readonly node: ({ + readonly feedback: ({ readonly id: string; - readonly name: string | null; - } | null; + readonly name: (string | null); + } | null); readonly id: string; - } | null; - } | null> | null; - } | null; + readonly lastName: (string | null); + readonly name: (string | null); + } | null); + } | null)> | null); + } | null); readonly id: string; - } | null; - } | null; + } | null); + } | null); }; export type CommentCreateMutation = { - variables: CommentCreateMutation$variables; - response: CommentCreateMutation$data; rawResponse: CommentCreateMutation$rawResponse; + response: CommentCreateMutation$data; + variables: CommentCreateMutation$variables; }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type FeedbackFragment$data = { readonly id: string; - readonly name: string | null; + readonly name: (string | null); readonly " $fragmentType": "FeedbackFragment"; }; export type FeedbackFragment$key = { @@ -101,11 +101,11 @@ export type FeedbackFragment$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type FriendFragment$data = { - readonly name: string | null; - readonly lastName: string | null; - readonly feedback: { + readonly feedback: ({ readonly " $fragmentSpreads": FragmentRefs<"FeedbackFragment">; - } | null; + } | null); + readonly lastName: (string | null); + readonly name: (string | null); readonly " $fragmentType": "FriendFragment"; }; export type FriendFragment$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected index 9e5031ef83436..855e5f0a8b87c 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected @@ -29,74 +29,74 @@ fragment InlineFragmentWithOverlappingFields on Actor { ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; export type CommentCreateInput = { - clientMutationId?: string | null; - feedbackId?: string | null; - feedback?: CommentfeedbackFeedback | null; + clientMutationId?: (string | null); + feedback?: (CommentfeedbackFeedback | null); + feedbackId?: (string | null); }; export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null; + comment?: (FeedbackcommentComment | null); }; export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null; + feedback?: (CommentfeedbackFeedback | null); }; export type TestMutation$variables = { input: CommentCreateInput; }; export type TestMutation$data = { - readonly commentCreate: { - readonly viewer: { - readonly actor: { + readonly commentCreate: ({ + readonly viewer: ({ + readonly actor: ({ readonly " $fragmentSpreads": FragmentRefs<"InlineFragmentWithOverlappingFields">; - } | null; - } | null; - } | null; + } | null); + } | null); + } | null); }; export type TestMutation$rawResponse = { - readonly commentCreate: { - readonly viewer: { - readonly actor: { - readonly __typename: "User"; + readonly commentCreate: ({ + readonly viewer: ({ + readonly actor: ({ readonly __isActor: "User"; - readonly id: string; - readonly hometown: { + readonly __typename: "User"; + readonly hometown: ({ readonly id: string; - readonly name: string | null; - } | null; + readonly name: (string | null); + } | null); + readonly id: string; } | { - readonly __typename: "Page"; readonly __isActor: "Page"; - readonly id: string; - readonly name: string | null; - readonly hometown: { + readonly __typename: "Page"; + readonly hometown: ({ readonly id: string; - readonly message: { - readonly text: string | null; - } | null; - } | null; + readonly message: ({ + readonly text: (string | null); + } | null); + } | null); + readonly id: string; + readonly name: (string | null); } | { - readonly __typename: string; readonly __isActor: string; + readonly __typename: string; readonly id: string; - } | null; - } | null; - } | null; + } | null); + } | null); + } | null); }; export type TestMutation = { - variables: TestMutation$variables; - response: TestMutation$data; rawResponse: TestMutation$rawResponse; + response: TestMutation$data; + variables: TestMutation$variables; }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type InlineFragmentWithOverlappingFields$data = { - readonly hometown?: { + readonly hometown?: ({ readonly id: string; - readonly name: string | null; - readonly message?: { - readonly text: string | null; - } | null; - } | null; - readonly name?: string | null; + readonly message?: ({ + readonly text: (string | null); + } | null); + readonly name: (string | null); + } | null); + readonly name?: (string | null); readonly " $fragmentType": "InlineFragmentWithOverlappingFields"; }; export type InlineFragmentWithOverlappingFields$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation.expected index 54e749983e388..20ebcf30e794f 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation.expected @@ -16,33 +16,33 @@ mutation CommentCreateMutation( } ==================================== OUTPUT =================================== export type CommentCreateInput = { - clientMutationId?: string | null; - feedbackId?: string | null; - feedback?: CommentfeedbackFeedback | null; + clientMutationId?: (string | null); + feedback?: (CommentfeedbackFeedback | null); + feedbackId?: (string | null); }; export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null; + comment?: (FeedbackcommentComment | null); }; export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null; + feedback?: (CommentfeedbackFeedback | null); }; export type CommentCreateMutation$variables = { + first?: (number | null); input: CommentCreateInput; - first?: number | null; - orderBy?: ReadonlyArray | null; + orderBy?: (ReadonlyArray | null); }; export type CommentCreateMutation$data = { - readonly commentCreate: { - readonly comment: { + readonly commentCreate: ({ + readonly comment: ({ + readonly friends: ({ + readonly count: (number | null); + } | null); readonly id: string; - readonly name: string | null; - readonly friends: { - readonly count: number | null; - } | null; - } | null; - } | null; + readonly name: (string | null); + } | null); + } | null); }; export type CommentCreateMutation = { - variables: CommentCreateMutation$variables; response: CommentCreateMutation$data; + variables: CommentCreateMutation$variables; }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-handles.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-handles.expected index 6d9c51cc6dd2d..12f704155007a 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-handles.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-handles.expected @@ -21,50 +21,50 @@ export type LinkedHandleField$variables = { id: string; }; export type LinkedHandleField$data = { - readonly node: { - readonly friends?: { - readonly count: number | null; - } | null; - } | null; + readonly node: ({ + readonly friends?: ({ + readonly count: (number | null); + } | null); + } | null); }; export type LinkedHandleField$rawResponse = { - readonly node: { + readonly node: ({ readonly __typename: "User"; + readonly friends: ({ + readonly count: (number | null); + } | null); readonly id: string; - readonly friends: { - readonly count: number | null; - } | null; } | { readonly __typename: string; readonly id: string; - } | null; + } | null); }; export type LinkedHandleField = { - variables: LinkedHandleField$variables; - response: LinkedHandleField$data; rawResponse: LinkedHandleField$rawResponse; + response: LinkedHandleField$data; + variables: LinkedHandleField$variables; }; ------------------------------------------------------------------------------- export type ScalarHandleField$variables = { id: string; }; export type ScalarHandleField$data = { - readonly node: { - readonly name?: string | null; - } | null; + readonly node: ({ + readonly name?: (string | null); + } | null); }; export type ScalarHandleField$rawResponse = { - readonly node: { + readonly node: ({ readonly __typename: "User"; readonly id: string; - readonly name: string | null; + readonly name: (string | null); } | { readonly __typename: string; readonly id: string; - } | null; + } | null); }; export type ScalarHandleField = { - variables: ScalarHandleField$variables; - response: ScalarHandleField$data; rawResponse: ScalarHandleField$rawResponse; + response: ScalarHandleField$data; + variables: ScalarHandleField$variables; }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected index c96795ffd3747..eea58fa116b5f 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected @@ -31,60 +31,60 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { import { FragmentRefs, Local3DPayload } from "relay-runtime"; export type Test$variables = {}; export type Test$data = { - readonly node: { + readonly node: ({ readonly " $fragmentSpreads": FragmentRefs<"NameRendererFragment">; - } | null; + } | null); }; export type PlainUserNameRenderer_name = { - readonly plaintext: string | null; - readonly data: { - readonly text: string | null; - readonly id: string | null; - } | null; + readonly data: ({ + readonly id: (string | null); + readonly text: (string | null); + } | null); + readonly plaintext: (string | null); }; export type MarkdownUserNameRenderer_name = { - readonly markdown: string | null; - readonly data: { - readonly markup: string | null; - readonly id: string | null; - } | null; + readonly data: ({ + readonly id: (string | null); + readonly markup: (string | null); + } | null); + readonly markdown: (string | null); }; export type Test$rawResponse = { - readonly node: { + readonly node: ({ readonly __typename: "User"; readonly id: string; - readonly nameRenderer: { + readonly nameRenderer: ({ + readonly __module_component_NameRendererFragment: (any | null); + readonly __module_operation_NameRendererFragment: (any | null); readonly __typename: "PlainUserNameRenderer"; - readonly __module_operation_NameRendererFragment: any | null; - readonly __module_component_NameRendererFragment: any | null; } | Local3DPayload<"NameRendererFragment", { readonly __typename: "PlainUserNameRenderer"; }> | { + readonly __module_component_NameRendererFragment: (any | null); + readonly __module_operation_NameRendererFragment: (any | null); readonly __typename: "MarkdownUserNameRenderer"; - readonly __module_operation_NameRendererFragment: any | null; - readonly __module_component_NameRendererFragment: any | null; } | Local3DPayload<"NameRendererFragment", { readonly __typename: "MarkdownUserNameRenderer"; }> | { readonly __typename: string; - } | null; + } | null); } | { readonly __typename: string; readonly id: string; - } | null; + } | null); }; export type Test = { - variables: Test$variables; - response: Test$data; rawResponse: Test$rawResponse; + response: Test$data; + variables: Test$variables; }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type MarkdownUserNameRenderer_name$data = { - readonly markdown: string | null; - readonly data: { - readonly markup: string | null; - } | null; + readonly data: ({ + readonly markup: (string | null); + } | null); + readonly markdown: (string | null); readonly " $fragmentType": "MarkdownUserNameRenderer_name"; }; export type MarkdownUserNameRenderer_name$key = { @@ -95,11 +95,11 @@ export type MarkdownUserNameRenderer_name$key = { import { FragmentRefs } from "relay-runtime"; export type NameRendererFragment$data = { readonly id: string; - readonly nameRenderer: { - readonly __fragmentPropName?: string | null; - readonly __module_component?: string | null; - readonly " $fragmentSpreads": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">; - } | null; + readonly nameRenderer: ({ + readonly __fragmentPropName?: (string | null); + readonly __module_component?: (string | null); + readonly " $fragmentSpreads": FragmentRefs<("PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name")>; + } | null); readonly " $fragmentType": "NameRendererFragment"; }; export type NameRendererFragment$key = { @@ -109,10 +109,10 @@ export type NameRendererFragment$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type PlainUserNameRenderer_name$data = { - readonly plaintext: string | null; - readonly data: { - readonly text: string | null; - } | null; + readonly data: ({ + readonly text: (string | null); + } | null); + readonly plaintext: (string | null); readonly " $fragmentType": "PlainUserNameRenderer_name"; }; export type PlainUserNameRenderer_name$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected index c19ae96bd5e7b..fc4603e2a282b 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected @@ -20,42 +20,42 @@ fragment Test_userRenderer on PlainUserRenderer { import { FragmentRefs, Local3DPayload } from "relay-runtime"; export type Test$variables = {}; export type Test$data = { - readonly node: { + readonly node: ({ readonly " $fragmentSpreads": FragmentRefs<"Test_user">; - } | null; + } | null); }; export type Test_userRenderer = { - readonly user: { - readonly username: string | null; + readonly user: ({ readonly id: string; - } | null; + readonly username: (string | null); + } | null); }; export type Test$rawResponse = { - readonly node: { + readonly node: ({ readonly __typename: "User"; readonly id: string; - readonly plainUserRenderer: { - readonly __module_operation_Test_user: any | null; - readonly __module_component_Test_user: any | null; - } | Local3DPayload<"Test_user", {}> | null; + readonly plainUserRenderer: ({ + readonly __module_component_Test_user: (any | null); + readonly __module_operation_Test_user: (any | null); + } | Local3DPayload<"Test_user", {}> | null); } | { readonly __typename: string; readonly id: string; - } | null; + } | null); }; export type Test = { - variables: Test$variables; - response: Test$data; rawResponse: Test$rawResponse; + response: Test$data; + variables: Test$variables; }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type Test_user$data = { - readonly plainUserRenderer: { - readonly __fragmentPropName: string | null; - readonly __module_component: string | null; + readonly plainUserRenderer: ({ + readonly __fragmentPropName: (string | null); + readonly __module_component: (string | null); readonly " $fragmentSpreads": FragmentRefs<"Test_userRenderer">; - } | null; + } | null); readonly " $fragmentType": "Test_user"; }; export type Test_user$key = { @@ -65,9 +65,9 @@ export type Test_user$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type Test_userRenderer$data = { - readonly user: { - readonly username: string | null; - } | null; + readonly user: ({ + readonly username: (string | null); + } | null); readonly " $fragmentType": "Test_userRenderer"; }; export type Test_userRenderer$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected index 9737781864abd..a212ffd501ca6 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected @@ -51,95 +51,95 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { import { FragmentRefs, Local3DPayload } from "relay-runtime"; export type Test$variables = {}; export type Test$data = { - readonly node: { - readonly username?: string | null; + readonly node: ({ + readonly username?: (string | null); readonly " $fragmentSpreads": FragmentRefs<"NameRendererFragment">; - } | null; - readonly viewer: { - readonly actor: { - readonly name?: string | null; + } | null); + readonly viewer: ({ + readonly actor: ({ + readonly name?: (string | null); readonly " $fragmentSpreads": FragmentRefs<"AnotherNameRendererFragment">; - } | null; - } | null; + } | null); + } | null); }; export type PlainUserNameRenderer_name = { - readonly plaintext: string | null; - readonly data: { - readonly text: string | null; - readonly id: string | null; - } | null; + readonly data: ({ + readonly id: (string | null); + readonly text: (string | null); + } | null); + readonly plaintext: (string | null); }; export type MarkdownUserNameRenderer_name = { - readonly markdown: string | null; - readonly data: { - readonly markup: string | null; - readonly id: string | null; - } | null; + readonly data: ({ + readonly id: (string | null); + readonly markup: (string | null); + } | null); + readonly markdown: (string | null); }; export type Test$rawResponse = { - readonly node: { + readonly node: ({ readonly __typename: "User"; readonly id: string; - readonly username: string | null; - readonly nameRenderer: { + readonly nameRenderer: ({ + readonly __module_component_NameRendererFragment: (any | null); + readonly __module_operation_NameRendererFragment: (any | null); readonly __typename: "PlainUserNameRenderer"; - readonly __module_operation_NameRendererFragment: any | null; - readonly __module_component_NameRendererFragment: any | null; } | Local3DPayload<"NameRendererFragment", { readonly __typename: "PlainUserNameRenderer"; }> | { + readonly __module_component_NameRendererFragment: (any | null); + readonly __module_operation_NameRendererFragment: (any | null); readonly __typename: "MarkdownUserNameRenderer"; - readonly __module_operation_NameRendererFragment: any | null; - readonly __module_component_NameRendererFragment: any | null; } | Local3DPayload<"NameRendererFragment", { readonly __typename: "MarkdownUserNameRenderer"; }> | { readonly __typename: string; - } | null; + } | null); + readonly username: (string | null); } | { readonly __typename: string; readonly id: string; - } | null; - readonly viewer: { - readonly actor: { + } | null); + readonly viewer: ({ + readonly actor: ({ readonly __typename: "User"; readonly id: string; - readonly name: string | null; - readonly nameRenderer: { + readonly name: (string | null); + readonly nameRenderer: ({ + readonly __module_component_AnotherNameRendererFragment: (any | null); + readonly __module_operation_AnotherNameRendererFragment: (any | null); readonly __typename: "PlainUserNameRenderer"; - readonly __module_operation_AnotherNameRendererFragment: any | null; - readonly __module_component_AnotherNameRendererFragment: any | null; } | Local3DPayload<"AnotherNameRendererFragment", { readonly __typename: "PlainUserNameRenderer"; }> | { + readonly __module_component_AnotherNameRendererFragment: (any | null); + readonly __module_operation_AnotherNameRendererFragment: (any | null); readonly __typename: "MarkdownUserNameRenderer"; - readonly __module_operation_AnotherNameRendererFragment: any | null; - readonly __module_component_AnotherNameRendererFragment: any | null; } | Local3DPayload<"AnotherNameRendererFragment", { readonly __typename: "MarkdownUserNameRenderer"; }> | { readonly __typename: string; - } | null; + } | null); } | { readonly __typename: string; readonly id: string; - } | null; - } | null; + } | null); + } | null); }; export type Test = { - variables: Test$variables; - response: Test$data; rawResponse: Test$rawResponse; + response: Test$data; + variables: Test$variables; }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type AnotherNameRendererFragment$data = { - readonly name: string | null; - readonly nameRenderer: { - readonly __fragmentPropName?: string | null; - readonly __module_component?: string | null; - readonly " $fragmentSpreads": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">; - } | null; + readonly name: (string | null); + readonly nameRenderer: ({ + readonly __fragmentPropName?: (string | null); + readonly __module_component?: (string | null); + readonly " $fragmentSpreads": FragmentRefs<("PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name")>; + } | null); readonly " $fragmentType": "AnotherNameRendererFragment"; }; export type AnotherNameRendererFragment$key = { @@ -149,10 +149,10 @@ export type AnotherNameRendererFragment$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type MarkdownUserNameRenderer_name$data = { - readonly markdown: string | null; - readonly data: { - readonly markup: string | null; - } | null; + readonly data: ({ + readonly markup: (string | null); + } | null); + readonly markdown: (string | null); readonly " $fragmentType": "MarkdownUserNameRenderer_name"; }; export type MarkdownUserNameRenderer_name$key = { @@ -163,11 +163,11 @@ export type MarkdownUserNameRenderer_name$key = { import { FragmentRefs } from "relay-runtime"; export type NameRendererFragment$data = { readonly id: string; - readonly nameRenderer: { - readonly __fragmentPropName?: string | null; - readonly __module_component?: string | null; - readonly " $fragmentSpreads": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">; - } | null; + readonly nameRenderer: ({ + readonly __fragmentPropName?: (string | null); + readonly __module_component?: (string | null); + readonly " $fragmentSpreads": FragmentRefs<("PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name")>; + } | null); readonly " $fragmentType": "NameRendererFragment"; }; export type NameRendererFragment$key = { @@ -177,10 +177,10 @@ export type NameRendererFragment$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type PlainUserNameRenderer_name$data = { - readonly plaintext: string | null; - readonly data: { - readonly text: string | null; - } | null; + readonly data: ({ + readonly text: (string | null); + } | null); + readonly plaintext: (string | null); readonly " $fragmentType": "PlainUserNameRenderer_name"; }; export type PlainUserNameRenderer_name$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected index c6efa7eeda4c3..074564f83ef3c 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected @@ -18,43 +18,43 @@ fragment FriendFragment on User { ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; export type ExampleQuery$variables = { - id: string; condition: boolean; + id: string; }; export type ExampleQuery$data = { - readonly node: { + readonly node: ({ readonly " $fragmentSpreads": FragmentRefs<"FriendFragment">; - } | null; + } | null); }; export type ExampleQuery$rawResponse = { - readonly node: { + readonly node: ({ readonly __typename: "User"; - readonly id: string; - readonly name: string | null; - readonly lastName: string | null; - readonly feedback: { + readonly feedback: ({ readonly id: string; - readonly name: string | null; - } | null; + readonly name: (string | null); + } | null); + readonly id: string; + readonly lastName: (string | null); + readonly name: (string | null); } | { readonly __typename: string; readonly id: string; - } | null; + } | null); }; export type ExampleQuery = { - variables: ExampleQuery$variables; - response: ExampleQuery$data; rawResponse: ExampleQuery$rawResponse; + response: ExampleQuery$data; + variables: ExampleQuery$variables; }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type FriendFragment$data = { - readonly name?: string | null; - readonly lastName?: string | null; - readonly feedback?: { + readonly feedback?: ({ readonly id: string; - readonly name: string | null; - } | null; + readonly name: (string | null); + } | null); + readonly lastName?: (string | null); + readonly name?: (string | null); readonly " $fragmentType": "FriendFragment"; }; export type FriendFragment$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected index a61519bd27e67..70aadab8195c8 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected @@ -27,35 +27,35 @@ export type ExampleQuery$variables = { id: string; }; export type ExampleQuery$data = { - readonly node: { - readonly username: string | null; - readonly friends?: { - readonly count: number | null; - } | null; + readonly node: ({ + readonly friends?: ({ + readonly count: (number | null); + } | null); + readonly username: (string | null); readonly " $fragmentSpreads": FragmentRefs<"FriendFragment">; - } | null; + } | null); }; export type ExampleQuery$rawResponse = { - readonly node: { + readonly node: ({ readonly __typename: string; - readonly username: string | null; readonly id: string; - } | null; + readonly username: (string | null); + } | null); }; export type ExampleQuery = { - variables: ExampleQuery$variables; - response: ExampleQuery$data; rawResponse: ExampleQuery$rawResponse; + response: ExampleQuery$data; + variables: ExampleQuery$variables; }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type FriendFragment$data = { - readonly name?: string | null; - readonly lastName?: string | null; - readonly feedback?: { + readonly feedback?: ({ readonly id: string; - readonly name: string | null; - } | null; + readonly name: (string | null); + } | null); + readonly lastName?: (string | null); + readonly name?: (string | null); readonly " $fragmentType": "FriendFragment"; }; export type FriendFragment$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream-connection.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream-connection.expected index 35ca87a7a8c49..e0d92c0aeec17 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream-connection.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream-connection.expected @@ -19,49 +19,49 @@ query TestDefer @raw_response_type { ==================================== OUTPUT =================================== export type TestDefer$variables = {}; export type TestDefer$data = { - readonly node: { - readonly name?: string | null; - readonly friends?: { - readonly edges: ReadonlyArray<{ - readonly node: { - readonly actor: { - readonly name: string | null; - } | null; - } | null; - } | null> | null; - } | null; - } | null; + readonly node: ({ + readonly friends?: ({ + readonly edges: (ReadonlyArray<({ + readonly node: ({ + readonly actor: ({ + readonly name: (string | null); + } | null); + } | null); + } | null)> | null); + } | null); + readonly name?: (string | null); + } | null); }; export type TestDefer$rawResponse = { - readonly node: { + readonly node: ({ readonly __typename: "User"; - readonly id: string; - readonly name: string | null; - readonly friends: { - readonly edges: ReadonlyArray<{ - readonly node: { - readonly actor: { + readonly friends: ({ + readonly edges: (ReadonlyArray<({ + readonly cursor: (string | null); + readonly node: ({ + readonly __typename: "User"; + readonly actor: ({ readonly __typename: string; - readonly name: string | null; readonly id: string; - } | null; + readonly name: (string | null); + } | null); readonly id: string; - readonly __typename: "User"; - } | null; - readonly cursor: string | null; - } | null> | null; - readonly pageInfo: { - readonly endCursor: string | null; - readonly hasNextPage: boolean | null; - } | null; - } | null; + } | null); + } | null)> | null); + readonly pageInfo: ({ + readonly endCursor: (string | null); + readonly hasNextPage: (boolean | null); + } | null); + } | null); + readonly id: string; + readonly name: (string | null); } | { readonly __typename: string; readonly id: string; - } | null; + } | null); }; export type TestDefer = { - variables: TestDefer$variables; - response: TestDefer$data; rawResponse: TestDefer$rawResponse; + response: TestDefer$data; + variables: TestDefer$variables; }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream.expected index ddae6797f8bcb..93be9bfaf13e8 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream.expected @@ -20,42 +20,42 @@ query TestStream @raw_response_type { ==================================== OUTPUT =================================== export type TestStream$variables = {}; export type TestStream$data = { - readonly node: { - readonly name?: string | null; - readonly friends?: { - readonly edges: ReadonlyArray<{ - readonly node: { + readonly node: ({ + readonly friends?: ({ + readonly edges: (ReadonlyArray<({ + readonly node: ({ readonly id: string; - } | null; - } | null> | null; - } | null; - } | null; + } | null); + } | null)> | null); + } | null); + readonly name?: (string | null); + } | null); }; export type TestStream$rawResponse = { - readonly node: { + readonly node: ({ readonly __typename: "User"; - readonly id: string; - readonly name: string | null; - readonly friends: { - readonly edges: ReadonlyArray<{ - readonly node: { - readonly id: string; + readonly friends: ({ + readonly edges: (ReadonlyArray<({ + readonly cursor: (string | null); + readonly node: ({ readonly __typename: "User"; - } | null; - readonly cursor: string | null; - } | null> | null; - readonly pageInfo: { - readonly endCursor: string | null; - readonly hasNextPage: boolean | null; - } | null; - } | null; + readonly id: string; + } | null); + } | null)> | null); + readonly pageInfo: ({ + readonly endCursor: (string | null); + readonly hasNextPage: (boolean | null); + } | null); + } | null); + readonly id: string; + readonly name: (string | null); } | { readonly __typename: string; readonly id: string; - } | null; + } | null); }; export type TestStream = { - variables: TestStream$variables; - response: TestStream$data; rawResponse: TestStream$rawResponse; + response: TestStream$data; + variables: TestStream$variables; }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected index f8ed2d1a2c6e8..5706df721a0a5 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected @@ -12,21 +12,21 @@ export type RefetchableFragmentQuery$variables = { id: string; }; export type RefetchableFragmentQuery$data = { - readonly node: { + readonly node: ({ readonly " $fragmentSpreads": FragmentRefs<"RefetchableFragment">; - } | null; + } | null); }; export type RefetchableFragmentQuery = { - variables: RefetchableFragmentQuery$variables; response: RefetchableFragmentQuery$data; + variables: RefetchableFragmentQuery$variables; }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type RefetchableFragment$data = { + readonly fragAndField: ({ + readonly uri: (string | null); + } | null); readonly id: string; - readonly fragAndField: { - readonly uri: string | null; - } | null; readonly " $fragmentType": "RefetchableFragment"; }; export type RefetchableFragment$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected index da5a6f6fc3698..952db31861e15 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected @@ -12,19 +12,19 @@ export type FlowRefetchableFragmentQuery$variables = { id: string; }; export type FlowRefetchableFragmentQuery$data = { - readonly node: { + readonly node: ({ readonly " $fragmentSpreads": FragmentRefs<"FlowRefetchableFragment">; - } | null; + } | null); }; export type FlowRefetchableFragmentQuery = { - variables: FlowRefetchableFragmentQuery$variables; response: FlowRefetchableFragmentQuery$data; + variables: FlowRefetchableFragmentQuery$variables; }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type FlowRefetchableFragment$data = { readonly id: string; - readonly name?: string | null; + readonly name?: (string | null); readonly " $fragmentType": "FlowRefetchableFragment"; }; export type FlowRefetchableFragment$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected index b39092eab4b1c..e625279876da6 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected @@ -32,27 +32,27 @@ export type RelayClientIDFieldQuery$variables = { }; export type RelayClientIDFieldQuery$data = { readonly __id: string; - readonly me: { + readonly me: ({ readonly __id: string; readonly __typename: string; readonly id: string; - } | null; - readonly node: { + } | null); + readonly node: ({ readonly __id: string; readonly __typename: string; - readonly id: string; - readonly commentBody?: { + readonly commentBody?: ({ readonly __id: string; readonly __typename: string; - readonly text?: { + readonly text?: ({ readonly __id: string; readonly __typename: string; - readonly text: string | null; - } | null; - } | null; - } | null; + readonly text: (string | null); + } | null); + } | null); + readonly id: string; + } | null); }; export type RelayClientIDFieldQuery = { - variables: RelayClientIDFieldQuery$variables; response: RelayClientIDFieldQuery$data; + variables: RelayClientIDFieldQuery$variables; }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected index 1f35e3a18c6f2..2fc76f98bdbdf 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected @@ -9,7 +9,7 @@ fragment Foo on Node { } ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; -export type Foo$data = { +export type Foo$data = ({ readonly __typename: "User"; readonly name: string; readonly " $fragmentType": "Foo"; @@ -18,7 +18,7 @@ export type Foo$data = { // value in case none of the concrete values match. readonly __typename: "%other"; readonly " $fragmentType": "Foo"; -} | null; +} | null); export type Foo$key = { readonly " $data"?: Foo$data; readonly " $fragmentSpreads": FragmentRefs<"Foo">; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-fragment.expected index f9b05c336f7e9..32749004a6b83 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-fragment.expected @@ -5,11 +5,11 @@ fragment NonNullFragment on User { } ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; -export type NonNullFragment$data = { - readonly firstName: string | null; +export type NonNullFragment$data = ({ + readonly firstName: (string | null); readonly lastName: string; readonly " $fragmentType": "NonNullFragment"; -} | null; +} | null); export type NonNullFragment$key = { readonly " $data"?: NonNullFragment$data; readonly " $fragmentSpreads": FragmentRefs<"NonNullFragment">; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected index b425616c395ac..e7c4b32a9b240 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected @@ -9,11 +9,11 @@ fragment NonNullFragment on User { ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; export type NonNullFragment$data = { - readonly firstName: string | null; - readonly screennames: ReadonlyArray<{ - readonly name: string | null; + readonly firstName: (string | null); + readonly screennames: (ReadonlyArray<({ + readonly name: (string | null); readonly service: string; - } | null> | null; + } | null)> | null); readonly " $fragmentType": "NonNullFragment"; }; export type NonNullFragment$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-query.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-query.expected index 7426b4cc29a18..055aa8fd236d1 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-query.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-query.expected @@ -7,13 +7,13 @@ query FooQuery { } ==================================== OUTPUT =================================== export type FooQuery$variables = {}; -export type FooQuery$data = { +export type FooQuery$data = ({ readonly me: { - readonly firstName: string | null; + readonly firstName: (string | null); readonly lastName: string; }; -} | null; +} | null); export type FooQuery = { - variables: FooQuery$variables; response: FooQuery$data; + variables: FooQuery$variables; }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-up-to-mutation-response.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-up-to-mutation-response.expected index 8de6c21a19661..9c7fc150331b2 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-up-to-mutation-response.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-up-to-mutation-response.expected @@ -8,27 +8,27 @@ mutation CommentCreateMutation($input: CommentCreateInput!) { } ==================================== OUTPUT =================================== export type CommentCreateInput = { - clientMutationId?: string | null; - feedbackId?: string | null; - feedback?: CommentfeedbackFeedback | null; + clientMutationId?: (string | null); + feedback?: (CommentfeedbackFeedback | null); + feedbackId?: (string | null); }; export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null; + comment?: (FeedbackcommentComment | null); }; export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null; + feedback?: (CommentfeedbackFeedback | null); }; export type CommentCreateMutation$variables = { input: CommentCreateInput; }; -export type CommentCreateMutation$data = { +export type CommentCreateMutation$data = ({ readonly commentCreate: { readonly comment: { readonly id: string; }; }; -} | null; +} | null); export type CommentCreateMutation = { - variables: CommentCreateMutation$variables; response: CommentCreateMutation$data; + variables: CommentCreateMutation$variables; }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected index de1a1fd3f26d6..74f4cd75eaf6e 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected @@ -29,35 +29,35 @@ fragment Foo on Node { } ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; -export type Bar$data = { +export type Bar$data = ({ + readonly body?: ({ + readonly text: (string | null); + } | null); readonly name?: string; - readonly body?: { - readonly text: string | null; - } | null; readonly " $fragmentType": "Bar"; -} | null; +} | null); export type Bar$key = { readonly " $data"?: Bar$data; readonly " $fragmentSpreads": FragmentRefs<"Bar">; }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type Foo$data = { +export type Foo$data = ({ readonly __typename: "User"; readonly name: string; readonly " $fragmentType": "Foo"; } | { readonly __typename: "Comment"; - readonly body: { - readonly text: string | null; - } | null; + readonly body: ({ + readonly text: (string | null); + } | null); readonly " $fragmentType": "Foo"; } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly __typename: "%other"; readonly " $fragmentType": "Foo"; -} | null; +} | null); export type Foo$key = { readonly " $data"?: Foo$data; readonly " $fragmentSpreads": FragmentRefs<"Foo">; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-raw-response-type.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-raw-response-type.expected index 018d1788235f7..b9026fa3495a3 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-raw-response-type.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-raw-response-type.expected @@ -7,20 +7,20 @@ query MyQuery @raw_response_type { } ==================================== OUTPUT =================================== export type MyQuery$variables = {}; -export type MyQuery$data = { +export type MyQuery$data = ({ readonly me: { readonly id: string; readonly name: string; }; -} | null; +} | null); export type MyQuery$rawResponse = { - readonly me: { + readonly me: ({ readonly id: string; - readonly name: string | null; - } | null; + readonly name: (string | null); + } | null); }; export type MyQuery = { - variables: MyQuery$variables; - response: MyQuery$data; rawResponse: MyQuery$rawResponse; + response: MyQuery$data; + variables: MyQuery$variables; }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected index a3f8eacc5264e..f0a86b3a63dc6 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected @@ -6,7 +6,7 @@ fragment NonNullFragment on User { ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; export type NonNullFragment$data = { - readonly firstName: string | null; + readonly firstName: (string | null); readonly lastName: string; readonly " $fragmentType": "NonNullFragment"; }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-query.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-query.expected index 2efa60cd78bf2..ca605064b605a 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-query.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-query.expected @@ -9,11 +9,11 @@ query FooQuery { export type FooQuery$variables = {}; export type FooQuery$data = { readonly me: { - readonly firstName: string | null; - readonly lastName: string | null; + readonly firstName: (string | null); + readonly lastName: (string | null); }; }; export type FooQuery = { - variables: FooQuery$variables; response: FooQuery$data; + variables: FooQuery$variables; }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throws-nested.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throws-nested.expected index 57a283e8c6c97..98113e8fbf876 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throws-nested.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throws-nested.expected @@ -8,12 +8,12 @@ query FooQuery { ==================================== OUTPUT =================================== export type FooQuery$variables = {}; export type FooQuery$data = { - readonly me: { - readonly firstName: string | null; + readonly me: ({ + readonly firstName: (string | null); readonly lastName: string; - } | null; + } | null); }; export type FooQuery = { - variables: FooQuery$variables; response: FooQuery$data; + variables: FooQuery$variables; }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required.expected index 1b8986bb53d7b..6c960c8adfb53 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required.expected @@ -8,12 +8,12 @@ query FooQuery { ==================================== OUTPUT =================================== export type FooQuery$variables = {}; export type FooQuery$data = { - readonly me: { - readonly firstName: string | null; + readonly me: ({ + readonly firstName: (string | null); readonly lastName: string; - } | null; + } | null); }; export type FooQuery = { - variables: FooQuery$variables; response: FooQuery$data; + variables: FooQuery$variables; }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected index a7899a8bd3ccc..f838a70863a51 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected @@ -29,58 +29,58 @@ export type ExampleQuery$variables = { id: string; }; export type ExampleQuery$data = { - readonly node: { + readonly node: ({ readonly id: string; - } | null; + } | null); }; export type ExampleQuery = { - variables: ExampleQuery$variables; response: ExampleQuery$data; + variables: ExampleQuery$variables; }; ------------------------------------------------------------------------------- export type CommentCreateInput = { - clientMutationId?: string | null; - feedbackId?: string | null; - feedback?: CommentfeedbackFeedback | null; + clientMutationId?: (string | null); + feedback?: (CommentfeedbackFeedback | null); + feedbackId?: (string | null); }; export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null; + comment?: (FeedbackcommentComment | null); }; export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null; + feedback?: (CommentfeedbackFeedback | null); }; export type TestMutation$variables = { input: CommentCreateInput; }; export type TestMutation$data = { - readonly commentCreate: { - readonly comment: { + readonly commentCreate: ({ + readonly comment: ({ readonly id: string; - } | null; - } | null; + } | null); + } | null); }; export type TestMutation = { - variables: TestMutation$variables; response: TestMutation$data; + variables: TestMutation$variables; }; ------------------------------------------------------------------------------- export type FeedbackLikeInput = { - clientMutationId?: string | null; - feedbackId?: string | null; + clientMutationId?: (string | null); + feedbackId?: (string | null); }; export type TestSubscription$variables = { - input?: FeedbackLikeInput | null; + input?: (FeedbackLikeInput | null); }; export type TestSubscription$data = { - readonly feedbackLikeSubscribe: { - readonly feedback: { + readonly feedbackLikeSubscribe: ({ + readonly feedback: ({ readonly id: string; - } | null; - } | null; + } | null); + } | null); }; export type TestSubscription = { - variables: TestSubscription$variables; response: TestSubscription$data; + variables: TestSubscription$variables; }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/scalar-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/scalar-field.expected index 037e61fa76cbe..82237c66ee515 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/scalar-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/scalar-field.expected @@ -13,20 +13,20 @@ fragment ScalarField on User { } } ==================================== OUTPUT =================================== -export type PersonalityTraits = "CHEERFUL" | "DERISIVE" | "HELPFUL" | "SNARKY" | "%future added value"; +export type PersonalityTraits = ("CHEERFUL" | "DERISIVE" | "HELPFUL" | "SNARKY" | "%future added value"); import { FragmentRefs } from "relay-runtime"; export type ScalarField$data = { + readonly aliasedLinkedField: ({ + readonly aliasedField: (number | null); + } | null); readonly id: string; - readonly name: string | null; - readonly websites: ReadonlyArray | null; - readonly traits: ReadonlyArray | null; - readonly aliasedLinkedField: { - readonly aliasedField: number | null; - } | null; - readonly screennames: ReadonlyArray<{ - readonly name: string | null; - readonly service: string | null; - } | null> | null; + readonly name: (string | null); + readonly screennames: (ReadonlyArray<({ + readonly name: (string | null); + readonly service: (string | null); + } | null)> | null); + readonly traits: (ReadonlyArray<(PersonalityTraits | null)> | null); + readonly websites: (ReadonlyArray<(string | null)> | null); readonly " $fragmentType": "ScalarField"; }; export type ScalarField$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/simple.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/simple.expected index bda7112236157..b9470b7070726 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/simple.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/simple.expected @@ -10,12 +10,12 @@ fragment LinkedField on User { ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; export type LinkedField$data = { - readonly name: string | null; - readonly profilePicture: { - readonly uri: string | null; - readonly width: number | null; - readonly height: number | null; - } | null; + readonly name: (string | null); + readonly profilePicture: ({ + readonly height: (number | null); + readonly uri: (string | null); + readonly width: (number | null); + } | null); readonly " $fragmentType": "LinkedField"; }; export type LinkedField$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected index 023c13577e336..bfe3cfd692705 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected @@ -18,22 +18,22 @@ fragment TypenameInsideWithOverlappingFields on Viewer { ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; export type TypenameInsideWithOverlappingFields$data = { - readonly actor: { + readonly actor: ({ readonly __typename: "Page"; readonly id: string; - readonly name: string | null; + readonly name: (string | null); } | { readonly __typename: "User"; readonly id: string; - readonly name: string | null; - readonly profile_picture: { - readonly uri: string | null; - } | null; + readonly name: (string | null); + readonly profile_picture: ({ + readonly uri: (string | null); + } | null); } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly __typename: "%other"; - } | null; + } | null); readonly " $fragmentType": "TypenameInsideWithOverlappingFields"; }; export type TypenameInsideWithOverlappingFields$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected index fcb5d266f2f67..65506f9385c2b 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected @@ -81,35 +81,35 @@ fragment TypenameAliases on Actor { } ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; -export type TypenameAlias$data = { +export type TypenameAlias$data = ({ readonly _typeAlias: "User"; - readonly firstName: string | null; + readonly firstName: (string | null); readonly " $fragmentType": "TypenameAlias"; } | { readonly _typeAlias: "Page"; - readonly username: string | null; + readonly username: (string | null); readonly " $fragmentType": "TypenameAlias"; } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly _typeAlias: "%other"; readonly " $fragmentType": "TypenameAlias"; -}; +}); export type TypenameAlias$key = { readonly " $data"?: TypenameAlias$data; readonly " $fragmentSpreads": FragmentRefs<"TypenameAlias">; }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type TypenameAliases$data = { +export type TypenameAliases$data = ({ readonly _typeAlias1: "User"; readonly _typeAlias2: "User"; - readonly firstName: string | null; + readonly firstName: (string | null); readonly " $fragmentType": "TypenameAliases"; } | { readonly _typeAlias1: "Page"; readonly _typeAlias2: "Page"; - readonly username: string | null; + readonly username: (string | null); readonly " $fragmentType": "TypenameAliases"; } | { // This will never be '%other', but we need some @@ -119,47 +119,47 @@ export type TypenameAliases$data = { // value in case none of the concrete values match. readonly _typeAlias2: "%other"; readonly " $fragmentType": "TypenameAliases"; -}; +}); export type TypenameAliases$key = { readonly " $data"?: TypenameAliases$data; readonly " $fragmentSpreads": FragmentRefs<"TypenameAliases">; }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type TypenameInside$data = { +export type TypenameInside$data = ({ readonly __typename: "User"; - readonly firstName: string | null; + readonly firstName: (string | null); readonly " $fragmentType": "TypenameInside"; } | { readonly __typename: "Page"; - readonly username: string | null; + readonly username: (string | null); readonly " $fragmentType": "TypenameInside"; } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly __typename: "%other"; readonly " $fragmentType": "TypenameInside"; -}; +}); export type TypenameInside$key = { readonly " $data"?: TypenameInside$data; readonly " $fragmentSpreads": FragmentRefs<"TypenameInside">; }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type TypenameOutside$data = { +export type TypenameOutside$data = ({ readonly __typename: "User"; - readonly firstName: string | null; + readonly firstName: (string | null); readonly " $fragmentType": "TypenameOutside"; } | { readonly __typename: "Page"; - readonly username: string | null; + readonly username: (string | null); readonly " $fragmentType": "TypenameOutside"; } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly __typename: "%other"; readonly " $fragmentType": "TypenameOutside"; -}; +}); export type TypenameOutside$key = { readonly " $data"?: TypenameOutside$data; readonly " $fragmentSpreads": FragmentRefs<"TypenameOutside">; @@ -168,13 +168,13 @@ export type TypenameOutside$key = { import { FragmentRefs } from "relay-runtime"; export type TypenameOutsideWithAbstractType$data = { readonly __typename: string; - readonly username?: string | null; - readonly address?: { - readonly city: string | null; - readonly country: string | null; - readonly street?: string | null; - } | null; - readonly firstName?: string | null; + readonly address?: ({ + readonly city: (string | null); + readonly country: (string | null); + readonly street?: (string | null); + } | null); + readonly firstName?: (string | null); + readonly username?: (string | null); readonly " $fragmentType": "TypenameOutsideWithAbstractType"; }; export type TypenameOutsideWithAbstractType$key = { @@ -185,9 +185,9 @@ export type TypenameOutsideWithAbstractType$key = { import { FragmentRefs } from "relay-runtime"; export type TypenameWithCommonSelections$data = { readonly __typename: string; - readonly name: string | null; - readonly firstName?: string | null; - readonly username?: string | null; + readonly firstName?: (string | null); + readonly name: (string | null); + readonly username?: (string | null); readonly " $fragmentType": "TypenameWithCommonSelections"; }; export type TypenameWithCommonSelections$key = { @@ -197,8 +197,8 @@ export type TypenameWithCommonSelections$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type TypenameWithoutSpreads$data = { - readonly firstName: string | null; readonly __typename: "User"; + readonly firstName: (string | null); readonly " $fragmentType": "TypenameWithoutSpreads"; }; export type TypenameWithoutSpreads$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected index 665074fb524da..5242032b13727 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected @@ -28,8 +28,8 @@ fragment AnotherRecursiveFragment on Image { ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; export type AnotherRecursiveFragment$data = { - readonly uri: string | null; - readonly height: number | null; + readonly height: (number | null); + readonly uri: (string | null); readonly " $fragmentType": "AnotherRecursiveFragment"; }; export type AnotherRecursiveFragment$key = { @@ -39,8 +39,8 @@ export type AnotherRecursiveFragment$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type PhotoFragment$data = { - readonly uri: string | null; - readonly width: number | null; + readonly uri: (string | null); + readonly width: (number | null); readonly " $fragmentType": "PhotoFragment"; }; export type PhotoFragment$key = { @@ -50,8 +50,8 @@ export type PhotoFragment$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type RecursiveFragment$data = { - readonly uri: string | null; - readonly width: number | null; + readonly uri: (string | null); + readonly width: (number | null); }; export type RecursiveFragment$key = { readonly " $data"?: RecursiveFragment$data; @@ -60,12 +60,12 @@ export type RecursiveFragment$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type UserProfile$data = { - readonly profilePicture: { - readonly uri: string | null; - readonly width: number | null; - readonly height: number | null; + readonly profilePicture: ({ + readonly height: (number | null); + readonly uri: (string | null); + readonly width: (number | null); readonly " $fragmentSpreads": FragmentRefs<"PhotoFragment">; - } | null; + } | null); readonly " $fragmentType": "UserProfile"; }; export type UserProfile$key = { diff --git a/packages/react-relay/__flowtests__/__generated__/ReactRelayPaginationContainerFlowtestQuery.graphql.js b/packages/react-relay/__flowtests__/__generated__/ReactRelayPaginationContainerFlowtestQuery.graphql.js index cf215a5ce862f..b2bae27277c61 100644 --- a/packages/react-relay/__flowtests__/__generated__/ReactRelayPaginationContainerFlowtestQuery.graphql.js +++ b/packages/react-relay/__flowtests__/__generated__/ReactRelayPaginationContainerFlowtestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<059d6a6d94da6f9b3cf43a0418ecc7b8>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type ReactRelayPaginationContainerFlowtestQuery$data = {| |}, |}; export type ReactRelayPaginationContainerFlowtestQuery = {| - variables: ReactRelayPaginationContainerFlowtestQuery$variables, response: ReactRelayPaginationContainerFlowtestQuery$data, + variables: ReactRelayPaginationContainerFlowtestQuery$variables, |}; */ diff --git a/packages/react-relay/__flowtests__/__generated__/ReactRelayRefetchContainerFlowtestQuery.graphql.js b/packages/react-relay/__flowtests__/__generated__/ReactRelayRefetchContainerFlowtestQuery.graphql.js index 194950119c41a..17394847ded8a 100644 --- a/packages/react-relay/__flowtests__/__generated__/ReactRelayRefetchContainerFlowtestQuery.graphql.js +++ b/packages/react-relay/__flowtests__/__generated__/ReactRelayRefetchContainerFlowtestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<6f9d544ba3d41de3f6b99fc398b5a293>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type ReactRelayRefetchContainerFlowtestQuery$data = {| |}, |}; export type ReactRelayRefetchContainerFlowtestQuery = {| - variables: ReactRelayRefetchContainerFlowtestQuery$variables, response: ReactRelayRefetchContainerFlowtestQuery$data, + variables: ReactRelayRefetchContainerFlowtestQuery$variables, |}; */ diff --git a/packages/react-relay/__tests__/__generated__/ReactRelayFragmentContainerReactDoubleEffectsTestUserQuery.graphql.js b/packages/react-relay/__tests__/__generated__/ReactRelayFragmentContainerReactDoubleEffectsTestUserQuery.graphql.js index bb2dda8703521..e5437b550ca98 100644 --- a/packages/react-relay/__tests__/__generated__/ReactRelayFragmentContainerReactDoubleEffectsTestUserQuery.graphql.js +++ b/packages/react-relay/__tests__/__generated__/ReactRelayFragmentContainerReactDoubleEffectsTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<2bad09c30d878d6358fd85f900c3404d>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type ReactRelayFragmentContainerReactDoubleEffectsTestUserQuery$data = {| |}, |}; export type ReactRelayFragmentContainerReactDoubleEffectsTestUserQuery = {| - variables: ReactRelayFragmentContainerReactDoubleEffectsTestUserQuery$variables, response: ReactRelayFragmentContainerReactDoubleEffectsTestUserQuery$data, + variables: ReactRelayFragmentContainerReactDoubleEffectsTestUserQuery$variables, |}; */ diff --git a/packages/react-relay/__tests__/__generated__/ReactRelayFragmentContainerTestUserQuery.graphql.js b/packages/react-relay/__tests__/__generated__/ReactRelayFragmentContainerTestUserQuery.graphql.js index b42676a0b9afe..22db50b83864b 100644 --- a/packages/react-relay/__tests__/__generated__/ReactRelayFragmentContainerTestUserQuery.graphql.js +++ b/packages/react-relay/__tests__/__generated__/ReactRelayFragmentContainerTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type ReactRelayFragmentContainerTestUserQuery$data = {| |}, |}; export type ReactRelayFragmentContainerTestUserQuery = {| - variables: ReactRelayFragmentContainerTestUserQuery$variables, response: ReactRelayFragmentContainerTestUserQuery$data, + variables: ReactRelayFragmentContainerTestUserQuery$variables, |}; */ diff --git a/packages/react-relay/__tests__/__generated__/ReactRelayFragmentContainerTestUserWithCondQuery.graphql.js b/packages/react-relay/__tests__/__generated__/ReactRelayFragmentContainerTestUserWithCondQuery.graphql.js index 96696d5e4b9bd..67d24b0493246 100644 --- a/packages/react-relay/__tests__/__generated__/ReactRelayFragmentContainerTestUserWithCondQuery.graphql.js +++ b/packages/react-relay/__tests__/__generated__/ReactRelayFragmentContainerTestUserWithCondQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<17e9de45ed875074b0d517f733e8af8e>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type ReactRelayFragmentContainerTestUserFragment$fragmentType = any; export type ReactRelayFragmentContainerTestUserWithCondQuery$variables = {| - id: string, condGlobal: boolean, + id: string, |}; export type ReactRelayFragmentContainerTestUserWithCondQuery$data = {| +node: ?{| @@ -27,8 +27,8 @@ export type ReactRelayFragmentContainerTestUserWithCondQuery$data = {| |}, |}; export type ReactRelayFragmentContainerTestUserWithCondQuery = {| - variables: ReactRelayFragmentContainerTestUserWithCondQuery$variables, response: ReactRelayFragmentContainerTestUserWithCondQuery$data, + variables: ReactRelayFragmentContainerTestUserWithCondQuery$variables, |}; */ diff --git a/packages/react-relay/__tests__/__generated__/ReactRelayFragmentContainerWithFragmentOwnershipTestUserQuery.graphql.js b/packages/react-relay/__tests__/__generated__/ReactRelayFragmentContainerWithFragmentOwnershipTestUserQuery.graphql.js index 8d5ce5807958f..704e5c28745d6 100644 --- a/packages/react-relay/__tests__/__generated__/ReactRelayFragmentContainerWithFragmentOwnershipTestUserQuery.graphql.js +++ b/packages/react-relay/__tests__/__generated__/ReactRelayFragmentContainerWithFragmentOwnershipTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<7f66db558949cd46ac76aa4d4dde1d29>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type ReactRelayFragmentContainerWithFragmentOwnershipTestUserQuery$data = |}, |}; export type ReactRelayFragmentContainerWithFragmentOwnershipTestUserQuery = {| - variables: ReactRelayFragmentContainerWithFragmentOwnershipTestUserQuery$variables, response: ReactRelayFragmentContainerWithFragmentOwnershipTestUserQuery$data, + variables: ReactRelayFragmentContainerWithFragmentOwnershipTestUserQuery$variables, |}; */ diff --git a/packages/react-relay/__tests__/__generated__/ReactRelayFragmentContainerWithFragmentOwnershipTestWithCondUserQuery.graphql.js b/packages/react-relay/__tests__/__generated__/ReactRelayFragmentContainerWithFragmentOwnershipTestWithCondUserQuery.graphql.js index 112be3d6dda66..d1802f6a4a2a0 100644 --- a/packages/react-relay/__tests__/__generated__/ReactRelayFragmentContainerWithFragmentOwnershipTestWithCondUserQuery.graphql.js +++ b/packages/react-relay/__tests__/__generated__/ReactRelayFragmentContainerWithFragmentOwnershipTestWithCondUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<247699880b13d26c357d9a0dca83e08f>> + * @generated SignedSource<<2527f774db5e9c16648591af77fa6aae>> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type ReactRelayFragmentContainerWithFragmentOwnershipTestUserFragment$fragmentType = any; export type ReactRelayFragmentContainerWithFragmentOwnershipTestWithCondUserQuery$variables = {| - id: string, condGlobal: boolean, + id: string, |}; export type ReactRelayFragmentContainerWithFragmentOwnershipTestWithCondUserQuery$data = {| +node: ?{| @@ -27,8 +27,8 @@ export type ReactRelayFragmentContainerWithFragmentOwnershipTestWithCondUserQuer |}, |}; export type ReactRelayFragmentContainerWithFragmentOwnershipTestWithCondUserQuery = {| - variables: ReactRelayFragmentContainerWithFragmentOwnershipTestWithCondUserQuery$variables, response: ReactRelayFragmentContainerWithFragmentOwnershipTestWithCondUserQuery$data, + variables: ReactRelayFragmentContainerWithFragmentOwnershipTestWithCondUserQuery$variables, |}; */ diff --git a/packages/react-relay/__tests__/__generated__/ReactRelayLocalQueryRendererTestSecondUserQuery.graphql.js b/packages/react-relay/__tests__/__generated__/ReactRelayLocalQueryRendererTestSecondUserQuery.graphql.js index 776208fd67fb9..c73ebf86e57ca 100644 --- a/packages/react-relay/__tests__/__generated__/ReactRelayLocalQueryRendererTestSecondUserQuery.graphql.js +++ b/packages/react-relay/__tests__/__generated__/ReactRelayLocalQueryRendererTestSecondUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<61f9c4f3cffca12ce1a1630e45f97189>> + * @generated SignedSource<<1ae3cbe772db396f69a9b885c55559b1>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type ReactRelayLocalQueryRendererTestSecondUserQuery$data = {| |}, |}; export type ReactRelayLocalQueryRendererTestSecondUserQuery = {| - variables: ReactRelayLocalQueryRendererTestSecondUserQuery$variables, response: ReactRelayLocalQueryRendererTestSecondUserQuery$data, + variables: ReactRelayLocalQueryRendererTestSecondUserQuery$variables, |}; */ diff --git a/packages/react-relay/__tests__/__generated__/ReactRelayLocalQueryRendererTestUserQuery.graphql.js b/packages/react-relay/__tests__/__generated__/ReactRelayLocalQueryRendererTestUserQuery.graphql.js index 7e8d8b9677464..c36b2db1fcf12 100644 --- a/packages/react-relay/__tests__/__generated__/ReactRelayLocalQueryRendererTestUserQuery.graphql.js +++ b/packages/react-relay/__tests__/__generated__/ReactRelayLocalQueryRendererTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<191b53ba7b74a8f54f4d8b233d288320>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -28,8 +28,8 @@ export type ReactRelayLocalQueryRendererTestUserQuery$data = {| |}, |}; export type ReactRelayLocalQueryRendererTestUserQuery = {| - variables: ReactRelayLocalQueryRendererTestUserQuery$variables, response: ReactRelayLocalQueryRendererTestUserQuery$data, + variables: ReactRelayLocalQueryRendererTestUserQuery$variables, |}; */ diff --git a/packages/react-relay/__tests__/__generated__/ReactRelayPaginationContainerReactDoubleEffectsTestUserFragment.graphql.js b/packages/react-relay/__tests__/__generated__/ReactRelayPaginationContainerReactDoubleEffectsTestUserFragment.graphql.js index 231b9d753c629..cdb44dea198a7 100644 --- a/packages/react-relay/__tests__/__generated__/ReactRelayPaginationContainerReactDoubleEffectsTestUserFragment.graphql.js +++ b/packages/react-relay/__tests__/__generated__/ReactRelayPaginationContainerReactDoubleEffectsTestUserFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<6ea4f39a00dea4b264dfb87ba1f54a75>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,8 +19,6 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type ReactRelayPaginationContainerReactDoubleEffectsTestUserFragment$fragmentType: FragmentType; export type ReactRelayPaginationContainerReactDoubleEffectsTestUserFragment$data = {| - +id: string, - +name: ?string, +friends: ?{| +edges: ?$ReadOnlyArray, |}, + +id: string, + +name: ?string, +$fragmentType: ReactRelayPaginationContainerReactDoubleEffectsTestUserFragment$fragmentType, |}; export type ReactRelayPaginationContainerReactDoubleEffectsTestUserFragment$key = { diff --git a/packages/react-relay/__tests__/__generated__/ReactRelayPaginationContainerReactDoubleEffectsTestUserQuery.graphql.js b/packages/react-relay/__tests__/__generated__/ReactRelayPaginationContainerReactDoubleEffectsTestUserQuery.graphql.js index 8cd57f71eb5d9..451d01b9fccc9 100644 --- a/packages/react-relay/__tests__/__generated__/ReactRelayPaginationContainerReactDoubleEffectsTestUserQuery.graphql.js +++ b/packages/react-relay/__tests__/__generated__/ReactRelayPaginationContainerReactDoubleEffectsTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<557907a745e009f2fdfe59677e2ce2f1>> + * @generated SignedSource<<5eecd1c549d031ce56a7572fed65bc28>> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type ReactRelayPaginationContainerReactDoubleEffectsTestUserFragment$fragmentType = any; export type ReactRelayPaginationContainerReactDoubleEffectsTestUserQuery$variables = {| - id: string, count: number, + id: string, |}; export type ReactRelayPaginationContainerReactDoubleEffectsTestUserQuery$data = {| +node: ?{| @@ -27,8 +27,8 @@ export type ReactRelayPaginationContainerReactDoubleEffectsTestUserQuery$data = |}, |}; export type ReactRelayPaginationContainerReactDoubleEffectsTestUserQuery = {| - variables: ReactRelayPaginationContainerReactDoubleEffectsTestUserQuery$variables, response: ReactRelayPaginationContainerReactDoubleEffectsTestUserQuery$data, + variables: ReactRelayPaginationContainerReactDoubleEffectsTestUserQuery$variables, |}; */ diff --git a/packages/react-relay/__tests__/__generated__/ReactRelayPaginationContainerTestNoConnectionOnFragmentUserQuery.graphql.js b/packages/react-relay/__tests__/__generated__/ReactRelayPaginationContainerTestNoConnectionOnFragmentUserQuery.graphql.js index 80dab48f69885..c5a3d2949a2a2 100644 --- a/packages/react-relay/__tests__/__generated__/ReactRelayPaginationContainerTestNoConnectionOnFragmentUserQuery.graphql.js +++ b/packages/react-relay/__tests__/__generated__/ReactRelayPaginationContainerTestNoConnectionOnFragmentUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<695f239d281809246e6c574c1ff0f60a>> + * @generated SignedSource<<04a7b7861bb1b35957154795a3a34f45>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,17 +25,17 @@ export type ReactRelayPaginationContainerTestNoConnectionOnFragmentUserQuery$var orderby?: ?$ReadOnlyArray, |}; export type ReactRelayPaginationContainerTestNoConnectionOnFragmentUserQuery$data = {| - +viewer: ?{| - +$fragmentSpreads: ReactRelayPaginationContainerTestNoConnectionOnFragmentViewerFragment$fragmentType, - |}, +node: ?{| +id: string, +$fragmentSpreads: ReactRelayPaginationContainerTestNoConnectionOnFragmentUserFragment$fragmentType, |}, + +viewer: ?{| + +$fragmentSpreads: ReactRelayPaginationContainerTestNoConnectionOnFragmentViewerFragment$fragmentType, + |}, |}; export type ReactRelayPaginationContainerTestNoConnectionOnFragmentUserQuery = {| - variables: ReactRelayPaginationContainerTestNoConnectionOnFragmentUserQuery$variables, response: ReactRelayPaginationContainerTestNoConnectionOnFragmentUserQuery$data, + variables: ReactRelayPaginationContainerTestNoConnectionOnFragmentUserQuery$variables, |}; */ diff --git a/packages/react-relay/__tests__/__generated__/ReactRelayPaginationContainerTestNoConnectionUserQuery.graphql.js b/packages/react-relay/__tests__/__generated__/ReactRelayPaginationContainerTestNoConnectionUserQuery.graphql.js index b4655c9a6fd37..04b18e2b4ee89 100644 --- a/packages/react-relay/__tests__/__generated__/ReactRelayPaginationContainerTestNoConnectionUserQuery.graphql.js +++ b/packages/react-relay/__tests__/__generated__/ReactRelayPaginationContainerTestNoConnectionUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<42210c39634d09ef1d94a6340715fe98>> * @flow * @lightSyntaxTransform * @nogrep @@ -30,8 +30,8 @@ export type ReactRelayPaginationContainerTestNoConnectionUserQuery$data = {| |}, |}; export type ReactRelayPaginationContainerTestNoConnectionUserQuery = {| - variables: ReactRelayPaginationContainerTestNoConnectionUserQuery$variables, response: ReactRelayPaginationContainerTestNoConnectionUserQuery$data, + variables: ReactRelayPaginationContainerTestNoConnectionUserQuery$variables, |}; */ diff --git a/packages/react-relay/__tests__/__generated__/ReactRelayPaginationContainerTestUserFragment.graphql.js b/packages/react-relay/__tests__/__generated__/ReactRelayPaginationContainerTestUserFragment.graphql.js index 1281a7916b5d2..509c4273010f1 100644 --- a/packages/react-relay/__tests__/__generated__/ReactRelayPaginationContainerTestUserFragment.graphql.js +++ b/packages/react-relay/__tests__/__generated__/ReactRelayPaginationContainerTestUserFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,7 +19,6 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type ReactRelayPaginationContainerTestUserFragment$fragmentType: FragmentType; export type ReactRelayPaginationContainerTestUserFragment$data = {| - +id: string, +friends: ?{| +edges: ?$ReadOnlyArray, |}, + +id: string, +$fragmentType: ReactRelayPaginationContainerTestUserFragment$fragmentType, |}; export type ReactRelayPaginationContainerTestUserFragment$key = { diff --git a/packages/react-relay/__tests__/__generated__/ReactRelayPaginationContainerTestUserQuery.graphql.js b/packages/react-relay/__tests__/__generated__/ReactRelayPaginationContainerTestUserQuery.graphql.js index 5ee5b7d3be32e..b08ae7da14a81 100644 --- a/packages/react-relay/__tests__/__generated__/ReactRelayPaginationContainerTestUserQuery.graphql.js +++ b/packages/react-relay/__tests__/__generated__/ReactRelayPaginationContainerTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<3c317381c0abd4dc4b51c28c6638a9cc>> + * @generated SignedSource<<93214d8f06ef389b223f63c54f12077a>> * @flow * @lightSyntaxTransform * @nogrep @@ -21,19 +21,19 @@ export type ReactRelayPaginationContainerTestUserQuery$variables = {| after?: ?string, count: number, id: string, - orderby?: ?$ReadOnlyArray, isViewerFriend?: ?boolean, + orderby?: ?$ReadOnlyArray, |}; export type ReactRelayPaginationContainerTestUserQuery$data = {| +node: ?{| - +id: string, +__typename: string, + +id: string, +$fragmentSpreads: ReactRelayPaginationContainerTestUserFragment$fragmentType, |}, |}; export type ReactRelayPaginationContainerTestUserQuery = {| - variables: ReactRelayPaginationContainerTestUserQuery$variables, response: ReactRelayPaginationContainerTestUserQuery$data, + variables: ReactRelayPaginationContainerTestUserQuery$variables, |}; */ diff --git a/packages/react-relay/__tests__/__generated__/ReactRelayPaginationContainerWithFragmentOwnershipTestUserFragment.graphql.js b/packages/react-relay/__tests__/__generated__/ReactRelayPaginationContainerWithFragmentOwnershipTestUserFragment.graphql.js index ca71973c41e7e..e707f67e7da64 100644 --- a/packages/react-relay/__tests__/__generated__/ReactRelayPaginationContainerWithFragmentOwnershipTestUserFragment.graphql.js +++ b/packages/react-relay/__tests__/__generated__/ReactRelayPaginationContainerWithFragmentOwnershipTestUserFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<307551ff7435842d356bfeb9476e7edd>> + * @generated SignedSource<<2371f791239a556bbb7dedddfde42412>> * @flow * @lightSyntaxTransform * @nogrep @@ -20,7 +20,6 @@ type ReactRelayPaginationContainerWithFragmentOwnershipTestUserFriendFragment$fr import type { FragmentType } from "relay-runtime"; declare export opaque type ReactRelayPaginationContainerWithFragmentOwnershipTestUserFragment$fragmentType: FragmentType; export type ReactRelayPaginationContainerWithFragmentOwnershipTestUserFragment$data = {| - +id: string, +friends: ?{| +edges: ?$ReadOnlyArray, |}, + +id: string, +$fragmentType: ReactRelayPaginationContainerWithFragmentOwnershipTestUserFragment$fragmentType, |}; export type ReactRelayPaginationContainerWithFragmentOwnershipTestUserFragment$key = { diff --git a/packages/react-relay/__tests__/__generated__/ReactRelayPaginationContainerWithFragmentOwnershipTestUserQuery.graphql.js b/packages/react-relay/__tests__/__generated__/ReactRelayPaginationContainerWithFragmentOwnershipTestUserQuery.graphql.js index 37dc198d88e1a..b8f57779e40a1 100644 --- a/packages/react-relay/__tests__/__generated__/ReactRelayPaginationContainerWithFragmentOwnershipTestUserQuery.graphql.js +++ b/packages/react-relay/__tests__/__generated__/ReactRelayPaginationContainerWithFragmentOwnershipTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<8d07e770c742da12c06c4177851b4d27>> * @flow * @lightSyntaxTransform * @nogrep @@ -21,19 +21,19 @@ export type ReactRelayPaginationContainerWithFragmentOwnershipTestUserQuery$vari after?: ?string, count: number, id: string, - orderby?: ?$ReadOnlyArray, isViewerFriend: boolean, + orderby?: ?$ReadOnlyArray, |}; export type ReactRelayPaginationContainerWithFragmentOwnershipTestUserQuery$data = {| +node: ?{| - +id: string, +__typename: string, + +id: string, +$fragmentSpreads: ReactRelayPaginationContainerWithFragmentOwnershipTestUserFragment$fragmentType, |}, |}; export type ReactRelayPaginationContainerWithFragmentOwnershipTestUserQuery = {| - variables: ReactRelayPaginationContainerWithFragmentOwnershipTestUserQuery$variables, response: ReactRelayPaginationContainerWithFragmentOwnershipTestUserQuery$data, + variables: ReactRelayPaginationContainerWithFragmentOwnershipTestUserQuery$variables, |}; */ diff --git a/packages/react-relay/__tests__/__generated__/ReactRelayQueryRendererReactDoubleEffectsTestUserQuery.graphql.js b/packages/react-relay/__tests__/__generated__/ReactRelayQueryRendererReactDoubleEffectsTestUserQuery.graphql.js index 0c59fe8718e35..c21773d9e5a72 100644 --- a/packages/react-relay/__tests__/__generated__/ReactRelayQueryRendererReactDoubleEffectsTestUserQuery.graphql.js +++ b/packages/react-relay/__tests__/__generated__/ReactRelayQueryRendererReactDoubleEffectsTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<240bfd57db85c1ddace4e65b76b95c83>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type ReactRelayQueryRendererReactDoubleEffectsTestUserQuery$data = {| |}, |}; export type ReactRelayQueryRendererReactDoubleEffectsTestUserQuery = {| - variables: ReactRelayQueryRendererReactDoubleEffectsTestUserQuery$variables, response: ReactRelayQueryRendererReactDoubleEffectsTestUserQuery$data, + variables: ReactRelayQueryRendererReactDoubleEffectsTestUserQuery$variables, |}; */ diff --git a/packages/react-relay/__tests__/__generated__/ReactRelayQueryRendererTestNextQuery.graphql.js b/packages/react-relay/__tests__/__generated__/ReactRelayQueryRendererTestNextQuery.graphql.js index f54d29b44b088..8c7c3a063eb05 100644 --- a/packages/react-relay/__tests__/__generated__/ReactRelayQueryRendererTestNextQuery.graphql.js +++ b/packages/react-relay/__tests__/__generated__/ReactRelayQueryRendererTestNextQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<09fdaa08eb0b3e1b4bba7fd84874cb7f>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type ReactRelayQueryRendererTestNextQuery$data = {| |}, |}; export type ReactRelayQueryRendererTestNextQuery = {| - variables: ReactRelayQueryRendererTestNextQuery$variables, response: ReactRelayQueryRendererTestNextQuery$data, + variables: ReactRelayQueryRendererTestNextQuery$variables, |}; */ diff --git a/packages/react-relay/__tests__/__generated__/ReactRelayQueryRendererTestQuery.graphql.js b/packages/react-relay/__tests__/__generated__/ReactRelayQueryRendererTestQuery.graphql.js index e4092edf84ed3..aa6bb5f8dfb8f 100644 --- a/packages/react-relay/__tests__/__generated__/ReactRelayQueryRendererTestQuery.graphql.js +++ b/packages/react-relay/__tests__/__generated__/ReactRelayQueryRendererTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<7637ec1e71c1663b3db8ba999d61685a>> + * @generated SignedSource<<1ad7129cfa018237b91b2f92d4369e56>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type ReactRelayQueryRendererTestQuery$data = {| |}, |}; export type ReactRelayQueryRendererTestQuery = {| - variables: ReactRelayQueryRendererTestQuery$variables, response: ReactRelayQueryRendererTestQuery$data, + variables: ReactRelayQueryRendererTestQuery$variables, |}; */ diff --git a/packages/react-relay/__tests__/__generated__/ReactRelayRefetchContainerReactDoubleEffectsTestUserQuery.graphql.js b/packages/react-relay/__tests__/__generated__/ReactRelayRefetchContainerReactDoubleEffectsTestUserQuery.graphql.js index 0817c057d9455..be6f838fd583d 100644 --- a/packages/react-relay/__tests__/__generated__/ReactRelayRefetchContainerReactDoubleEffectsTestUserQuery.graphql.js +++ b/packages/react-relay/__tests__/__generated__/ReactRelayRefetchContainerReactDoubleEffectsTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type ReactRelayRefetchContainerReactDoubleEffectsTestUserQuery$data = {| |}, |}; export type ReactRelayRefetchContainerReactDoubleEffectsTestUserQuery = {| - variables: ReactRelayRefetchContainerReactDoubleEffectsTestUserQuery$variables, response: ReactRelayRefetchContainerReactDoubleEffectsTestUserQuery$data, + variables: ReactRelayRefetchContainerReactDoubleEffectsTestUserQuery$variables, |}; */ diff --git a/packages/react-relay/__tests__/__generated__/ReactRelayRefetchContainerTestUserQuery.graphql.js b/packages/react-relay/__tests__/__generated__/ReactRelayRefetchContainerTestUserQuery.graphql.js index 240c524df014c..73cb24c198018 100644 --- a/packages/react-relay/__tests__/__generated__/ReactRelayRefetchContainerTestUserQuery.graphql.js +++ b/packages/react-relay/__tests__/__generated__/ReactRelayRefetchContainerTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<099e53aeefbfdb7220ca5a8dee16faeb>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type ReactRelayRefetchContainerTestUserQuery$data = {| |}, |}; export type ReactRelayRefetchContainerTestUserQuery = {| - variables: ReactRelayRefetchContainerTestUserQuery$variables, response: ReactRelayRefetchContainerTestUserQuery$data, + variables: ReactRelayRefetchContainerTestUserQuery$variables, |}; */ diff --git a/packages/react-relay/__tests__/__generated__/ReactRelayRefetchContainerTestUserWithCondQuery.graphql.js b/packages/react-relay/__tests__/__generated__/ReactRelayRefetchContainerTestUserWithCondQuery.graphql.js index a9461e52e0d31..cb83452670fee 100644 --- a/packages/react-relay/__tests__/__generated__/ReactRelayRefetchContainerTestUserWithCondQuery.graphql.js +++ b/packages/react-relay/__tests__/__generated__/ReactRelayRefetchContainerTestUserWithCondQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<0eaa0addad282db14090c16be213c419>> + * @generated SignedSource<<712529777ba328d807f51a5e8097b079>> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type ReactRelayRefetchContainerTestUserFragment$fragmentType = any; export type ReactRelayRefetchContainerTestUserWithCondQuery$variables = {| - id: string, condGlobal: boolean, + id: string, |}; export type ReactRelayRefetchContainerTestUserWithCondQuery$data = {| +node: ?{| @@ -27,8 +27,8 @@ export type ReactRelayRefetchContainerTestUserWithCondQuery$data = {| |}, |}; export type ReactRelayRefetchContainerTestUserWithCondQuery = {| - variables: ReactRelayRefetchContainerTestUserWithCondQuery$variables, response: ReactRelayRefetchContainerTestUserWithCondQuery$data, + variables: ReactRelayRefetchContainerTestUserWithCondQuery$variables, |}; */ diff --git a/packages/react-relay/__tests__/__generated__/ReactRelayRefetchContainerWithFragmentOwnershipTestUserQuery.graphql.js b/packages/react-relay/__tests__/__generated__/ReactRelayRefetchContainerWithFragmentOwnershipTestUserQuery.graphql.js index 5ff752c5e9e2a..5137ccc661907 100644 --- a/packages/react-relay/__tests__/__generated__/ReactRelayRefetchContainerWithFragmentOwnershipTestUserQuery.graphql.js +++ b/packages/react-relay/__tests__/__generated__/ReactRelayRefetchContainerWithFragmentOwnershipTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<5bed525bb955ef04dcc7d5cac3023e14>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type ReactRelayRefetchContainerWithFragmentOwnershipTestUserQuery$data = |}, |}; export type ReactRelayRefetchContainerWithFragmentOwnershipTestUserQuery = {| - variables: ReactRelayRefetchContainerWithFragmentOwnershipTestUserQuery$variables, response: ReactRelayRefetchContainerWithFragmentOwnershipTestUserQuery$data, + variables: ReactRelayRefetchContainerWithFragmentOwnershipTestUserQuery$variables, |}; */ diff --git a/packages/react-relay/__tests__/__generated__/ReactRelayTestMockerTestFragContainerTestQuery.graphql.js b/packages/react-relay/__tests__/__generated__/ReactRelayTestMockerTestFragContainerTestQuery.graphql.js index b75326607a931..fc8bb8487a2a4 100644 --- a/packages/react-relay/__tests__/__generated__/ReactRelayTestMockerTestFragContainerTestQuery.graphql.js +++ b/packages/react-relay/__tests__/__generated__/ReactRelayTestMockerTestFragContainerTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type ReactRelayTestMockerTestFragContainerTestQuery$data = {| |}, |}; export type ReactRelayTestMockerTestFragContainerTestQuery = {| - variables: ReactRelayTestMockerTestFragContainerTestQuery$variables, response: ReactRelayTestMockerTestFragContainerTestQuery$data, + variables: ReactRelayTestMockerTestFragContainerTestQuery$variables, |}; */ diff --git a/packages/react-relay/__tests__/__generated__/ReactRelayTestMockerTestNestedQuery.graphql.js b/packages/react-relay/__tests__/__generated__/ReactRelayTestMockerTestNestedQuery.graphql.js index 3ffc6a20652b0..ffcdac2c0e0b3 100644 --- a/packages/react-relay/__tests__/__generated__/ReactRelayTestMockerTestNestedQuery.graphql.js +++ b/packages/react-relay/__tests__/__generated__/ReactRelayTestMockerTestNestedQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type ReactRelayTestMockerTestNestedQuery$data = {| |}, |}; export type ReactRelayTestMockerTestNestedQuery = {| - variables: ReactRelayTestMockerTestNestedQuery$variables, response: ReactRelayTestMockerTestNestedQuery$data, + variables: ReactRelayTestMockerTestNestedQuery$variables, |}; */ diff --git a/packages/react-relay/__tests__/__generated__/ReactRelayTestMockerTestQuery.graphql.js b/packages/react-relay/__tests__/__generated__/ReactRelayTestMockerTestQuery.graphql.js index f9e6de7736195..9dc4defb0f634 100644 --- a/packages/react-relay/__tests__/__generated__/ReactRelayTestMockerTestQuery.graphql.js +++ b/packages/react-relay/__tests__/__generated__/ReactRelayTestMockerTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<42a642b6655405781e212ad72fb3c2dc>> + * @generated SignedSource<<753a41fc6a2e29a1f7b253272809f588>> * @flow * @lightSyntaxTransform * @nogrep @@ -23,8 +23,8 @@ export type ReactRelayTestMockerTestQuery$data = {| |}, |}; export type ReactRelayTestMockerTestQuery = {| - variables: ReactRelayTestMockerTestQuery$variables, response: ReactRelayTestMockerTestQuery$data, + variables: ReactRelayTestMockerTestQuery$variables, |}; */ diff --git a/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeTestMutation.graphql.js b/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeTestMutation.graphql.js index eb745aff022c9..36a9766b5d426 100644 --- a/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeTestMutation.graphql.js +++ b/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeTestMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<6e1aca5e33ccc8c77f2f66d02baca536>> + * @generated SignedSource<<63be9d860d5a2d2d7303680f0741bfca>> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Mutation } from 'relay-runtime'; export type CommentCreateInput = {| clientMutationId?: ?string, - feedbackId?: ?string, feedback?: ?CommentfeedbackFeedback, + feedbackId?: ?string, |}; export type CommentfeedbackFeedback = {| comment?: ?FeedbackcommentComment, @@ -36,8 +36,8 @@ export type ActorChangeTestMutation$data = {| |}, |}; export type ActorChangeTestMutation = {| - variables: ActorChangeTestMutation$variables, response: ActorChangeTestMutation$data, + variables: ActorChangeTestMutation$variables, |}; */ diff --git a/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeTestQuery.graphql.js b/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeTestQuery.graphql.js index a1e91fc00f9cb..ee96155291aaa 100644 --- a/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeTestQuery.graphql.js +++ b/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -23,22 +23,22 @@ export type ActorChangeTestQuery$data = {| +viewer: ?{| +newsFeed: ?{| +edges: ?$ReadOnlyArray, +node: ?{| +actor: ?{| +name: ?string, |}, |}, - +actor_node: ?ActorChangePoint<{| - +actor_key: string, - +$fragmentSpreads: ActorChangeTestFeedUnitFragment$fragmentType, - |}>, |}>, |}, |}, |}; export type ActorChangeTestQuery = {| - variables: ActorChangeTestQuery$variables, response: ActorChangeTestQuery$data, + variables: ActorChangeTestQuery$variables, |}; */ diff --git a/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeWithDeferTestFragment.graphql.js b/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeWithDeferTestFragment.graphql.js index 175a19d0cd913..54e4e0dc82f0e 100644 --- a/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeWithDeferTestFragment.graphql.js +++ b/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeWithDeferTestFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<197947a81b7c425d258cae36c6b9e419>> + * @generated SignedSource<<44974e2b3b10d999b44101e207009e4d>> * @flow * @lightSyntaxTransform * @nogrep @@ -20,10 +20,10 @@ type ActorChangeWithDeferTestDeferFragment$fragmentType = any; import type { FragmentType } from "relay-runtime"; declare export opaque type ActorChangeWithDeferTestFragment$fragmentType: FragmentType; export type ActorChangeWithDeferTestFragment$data = {| - +id: string, +actor: ?{| +name: ?string, |}, + +id: string, +$fragmentSpreads: ActorChangeWithDeferTestDeferFragment$fragmentType, +$fragmentType: ActorChangeWithDeferTestFragment$fragmentType, |}; diff --git a/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeWithDeferTestQuery.graphql.js b/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeWithDeferTestQuery.graphql.js index 8a3006e76798e..067735581c9fc 100644 --- a/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeWithDeferTestQuery.graphql.js +++ b/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeWithDeferTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<7625b6d8d33fd59d1d90108300eb62bc>> + * @generated SignedSource<<21c37300d71e1a1e8027bed2ca5c6044>> * @flow * @lightSyntaxTransform * @nogrep @@ -23,22 +23,22 @@ export type ActorChangeWithDeferTestQuery$data = {| +viewer: ?{| +newsFeed: ?{| +edges: ?$ReadOnlyArray, +node: ?{| +actor: ?{| +name: ?string, |}, |}, - +actor_node: ?ActorChangePoint<{| - +actor_key: string, - +$fragmentSpreads: ActorChangeWithDeferTestFragment$fragmentType, - |}>, |}>, |}, |}, |}; export type ActorChangeWithDeferTestQuery = {| - variables: ActorChangeWithDeferTestQuery$variables, response: ActorChangeWithDeferTestQuery$data, + variables: ActorChangeWithDeferTestQuery$variables, |}; */ diff --git a/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeWithMutationTestFragment.graphql.js b/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeWithMutationTestFragment.graphql.js index 2fabcf206a974..a2e4089d04800 100644 --- a/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeWithMutationTestFragment.graphql.js +++ b/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeWithMutationTestFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,11 +19,11 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type ActorChangeWithMutationTestFragment$fragmentType: FragmentType; export type ActorChangeWithMutationTestFragment$data = {| - +id: string, +actor: ?{| +id: string, +name: ?string, |}, + +id: string, +$fragmentType: ActorChangeWithMutationTestFragment$fragmentType, |}; export type ActorChangeWithMutationTestFragment$key = { diff --git a/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeWithMutationTestMutation.graphql.js b/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeWithMutationTestMutation.graphql.js index 4a56b48876713..a468b69d51ece 100644 --- a/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeWithMutationTestMutation.graphql.js +++ b/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeWithMutationTestMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -32,8 +32,8 @@ export type ActorChangeWithMutationTestMutation$data = {| |}, |}; export type ActorChangeWithMutationTestMutation = {| - variables: ActorChangeWithMutationTestMutation$variables, response: ActorChangeWithMutationTestMutation$data, + variables: ActorChangeWithMutationTestMutation$variables, |}; */ diff --git a/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeWithMutationTestQuery.graphql.js b/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeWithMutationTestQuery.graphql.js index bb0a8a21343de..64f896ba9ccdc 100644 --- a/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeWithMutationTestQuery.graphql.js +++ b/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeWithMutationTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<1bbeaefca076c087dc5fdc62b4825008>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -36,8 +36,8 @@ export type ActorChangeWithMutationTestQuery$data = {| |}, |}; export type ActorChangeWithMutationTestQuery = {| - variables: ActorChangeWithMutationTestQuery$variables, response: ActorChangeWithMutationTestQuery$data, + variables: ActorChangeWithMutationTestQuery$variables, |}; */ diff --git a/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeWithStreamTestFragment.graphql.js b/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeWithStreamTestFragment.graphql.js index 6cf906a49bf27..73379c7b00f80 100644 --- a/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeWithStreamTestFragment.graphql.js +++ b/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeWithStreamTestFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<6905645a65399c0f3da574d400e7c7f2>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,15 +19,15 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type ActorChangeWithStreamTestFragment$fragmentType: FragmentType; export type ActorChangeWithStreamTestFragment$data = {| - +id: string, - +message: ?{| - +text: ?string, - |}, +feedback: ?{| - +id: string, +actors: ?$ReadOnlyArray, + +id: string, + |}, + +id: string, + +message: ?{| + +text: ?string, |}, +$fragmentType: ActorChangeWithStreamTestFragment$fragmentType, |}; diff --git a/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeWithStreamTestQuery.graphql.js b/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeWithStreamTestQuery.graphql.js index 1fc7a27f36c37..9ff383f817c2f 100644 --- a/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeWithStreamTestQuery.graphql.js +++ b/packages/react-relay/multi-actor/__tests__/__generated__/ActorChangeWithStreamTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<98a78e8672ff7ed10edff8339e0e14ad>> + * @generated SignedSource<<61bd86870349ef51f6e85584c9175975>> * @flow * @lightSyntaxTransform * @nogrep @@ -32,8 +32,8 @@ export type ActorChangeWithStreamTestQuery$data = {| |}, |}; export type ActorChangeWithStreamTestQuery = {| - variables: ActorChangeWithStreamTestQuery$variables, response: ActorChangeWithStreamTestQuery$data, + variables: ActorChangeWithStreamTestQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/EntryPointContainerTestQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/EntryPointContainerTestQuery.graphql.js index 45fa946904849..e21345a87ea74 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/EntryPointContainerTestQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/EntryPointContainerTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<639c1986d7fbc604c279446ba89d4515>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type EntryPointContainerTestQuery$data = {| |}, |}; export type EntryPointContainerTestQuery = {| - variables: EntryPointContainerTestQuery$variables, response: EntryPointContainerTestQuery$data, + variables: EntryPointContainerTestQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceRequiredFieldTestUserFragment.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceRequiredFieldTestUserFragment.graphql.js index 0f66d1837fbdf..476eff659ba73 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceRequiredFieldTestUserFragment.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceRequiredFieldTestUserFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<63ba144491799e69bde97a99e186723c>> + * @generated SignedSource<<04fe1751d3abfa2bd637de3a665abee9>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,9 +19,9 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type FragmentResourceRequiredFieldTestUserFragment$fragmentType: FragmentType; export type FragmentResourceRequiredFieldTestUserFragment$data = ?{| + +alternate_name: string, +id: string, +name: string, - +alternate_name: string, +$fragmentType: FragmentResourceRequiredFieldTestUserFragment$fragmentType, |}; export type FragmentResourceRequiredFieldTestUserFragment$key = { diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceRequiredFieldTestUserQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceRequiredFieldTestUserQuery.graphql.js index e967279da1ca1..a6dd96f63ff4c 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceRequiredFieldTestUserQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceRequiredFieldTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<41189d73723f6f579e2d29aafe95c9c2>> + * @generated SignedSource<<48178e47e37324dc0808503e9002aa9d>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type FragmentResourceRequiredFieldTestUserQuery$data = {| |}, |}; export type FragmentResourceRequiredFieldTestUserQuery = {| - variables: FragmentResourceRequiredFieldTestUserQuery$variables, response: FragmentResourceRequiredFieldTestUserQuery$data, + variables: FragmentResourceRequiredFieldTestUserQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceTest1Query.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceTest1Query.graphql.js index b0bdb4fb23448..2c46128a63f5b 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceTest1Query.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceTest1Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<5b722031c71cadebb7bc1c4848d125a1>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type FragmentResourceTest1Query$data = {| |}, |}; export type FragmentResourceTest1Query = {| - variables: FragmentResourceTest1Query$variables, response: FragmentResourceTest1Query$data, + variables: FragmentResourceTest1Query$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceTest2Query.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceTest2Query.graphql.js index a87e3780cd69f..dc7d301bf2c4f 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceTest2Query.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceTest2Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<847806d04dde36200e2a1d1f6b4d3fbc>> + * @generated SignedSource<<70c5018cbd98eff4a7116307eb090b77>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type FragmentResourceTest2Query$data = {| |}, |}; export type FragmentResourceTest2Query = {| - variables: FragmentResourceTest2Query$variables, response: FragmentResourceTest2Query$data, + variables: FragmentResourceTest2Query$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceTest3Query.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceTest3Query.graphql.js index d141b51b0d4a7..f29d92fb590b5 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceTest3Query.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceTest3Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<9ec3594ad9d64687b3f7fab71664d89e>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type FragmentResourceTest3Query$data = {| |}>, |}; export type FragmentResourceTest3Query = {| - variables: FragmentResourceTest3Query$variables, response: FragmentResourceTest3Query$data, + variables: FragmentResourceTest3Query$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceTest4Query.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceTest4Query.graphql.js index bee28105a0748..1d134ae770477 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceTest4Query.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceTest4Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<397cf4ed066999cfe51071e3034cfe59>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type FragmentResourceTest4Query$data = {| +$fragmentSpreads: FragmentResourceTest4Fragment$fragmentType, |}; export type FragmentResourceTest4Query = {| - variables: FragmentResourceTest4Query$variables, response: FragmentResourceTest4Query$data, + variables: FragmentResourceTest4Query$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceTest5Query.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceTest5Query.graphql.js index 00557d526b197..4cbc2a99dcad0 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceTest5Query.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceTest5Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<6ecddaaa16819e6742c57373dfdb36e6>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type FragmentResourceTest5Query$data = {| +$fragmentSpreads: FragmentResourceTest5Fragment$fragmentType, |}; export type FragmentResourceTest5Query = {| - variables: FragmentResourceTest5Query$variables, response: FragmentResourceTest5Query$data, + variables: FragmentResourceTest5Query$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceTest6Query.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceTest6Query.graphql.js index 1ef0a6d30baec..b99a69e1ac0f4 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceTest6Query.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceTest6Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type FragmentResourceTest6Fragment$fragmentType = any; export type FragmentResourceTest6Query$variables = {| - id: string, foo: boolean, + id: string, |}; export type FragmentResourceTest6Query$data = {| +node: ?{| @@ -29,8 +29,8 @@ export type FragmentResourceTest6Query$data = {| |}, |}; export type FragmentResourceTest6Query = {| - variables: FragmentResourceTest6Query$variables, response: FragmentResourceTest6Query$data, + variables: FragmentResourceTest6Query$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceWithOperationTrackerTestFriendsPaginationQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceWithOperationTrackerTestFriendsPaginationQuery.graphql.js index a9256c616e3df..8e2d11665420d 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceWithOperationTrackerTestFriendsPaginationQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceWithOperationTrackerTestFriendsPaginationQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<12fbdb2a984cd41e4966cd85536cdfc8>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -32,8 +32,8 @@ export type FragmentResourceWithOperationTrackerTestFriendsPaginationQuery$data |}, |}; export type FragmentResourceWithOperationTrackerTestFriendsPaginationQuery = {| - variables: FragmentResourceWithOperationTrackerTestFriendsPaginationQuery$variables, response: FragmentResourceWithOperationTrackerTestFriendsPaginationQuery$data, + variables: FragmentResourceWithOperationTrackerTestFriendsPaginationQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceWithOperationTrackerTestMarkdownUserNameRenderer_name.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceWithOperationTrackerTestMarkdownUserNameRenderer_name.graphql.js index c69c6fcac4825..5390ed10e1327 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceWithOperationTrackerTestMarkdownUserNameRenderer_name.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceWithOperationTrackerTestMarkdownUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<4639eee0a1b846b65cbaab9bafe7c244>> + * @generated SignedSource<<979dd0ff9fd09ced9535e20a42b92c7b>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type FragmentResourceWithOperationTrackerTestMarkdownUserNameRenderer_name$fragmentType: FragmentType; export type FragmentResourceWithOperationTrackerTestMarkdownUserNameRenderer_name$data = {| - +markdown: ?string, +data: ?{| +markup: ?string, |}, + +markdown: ?string, +$fragmentType: FragmentResourceWithOperationTrackerTestMarkdownUserNameRenderer_name$fragmentType, |}; export type FragmentResourceWithOperationTrackerTestMarkdownUserNameRenderer_name$key = { diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceWithOperationTrackerTestNodeQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceWithOperationTrackerTestNodeQuery.graphql.js index 75683f3e48bc6..eaec60d6d5c57 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceWithOperationTrackerTestNodeQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceWithOperationTrackerTestNodeQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<3bd5d3ba125545bcebd9e0fdd6b118e2>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type FragmentResourceWithOperationTrackerTestNodeQuery$data = {| |}, |}; export type FragmentResourceWithOperationTrackerTestNodeQuery = {| - variables: FragmentResourceWithOperationTrackerTestNodeQuery$variables, response: FragmentResourceWithOperationTrackerTestNodeQuery$data, + variables: FragmentResourceWithOperationTrackerTestNodeQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceWithOperationTrackerTestPlainUserNameRenderer_name.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceWithOperationTrackerTestPlainUserNameRenderer_name.graphql.js index 2404ebcf52c90..b53373962b6ce 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceWithOperationTrackerTestPlainUserNameRenderer_name.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceWithOperationTrackerTestPlainUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<6fb5c7c347888a0bde2b036318917870>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type FragmentResourceWithOperationTrackerTestPlainUserNameRenderer_name$fragmentType: FragmentType; export type FragmentResourceWithOperationTrackerTestPlainUserNameRenderer_name$data = {| - +plaintext: ?string, +data: ?{| +text: ?string, |}, + +plaintext: ?string, +$fragmentType: FragmentResourceWithOperationTrackerTestPlainUserNameRenderer_name$fragmentType, |}; export type FragmentResourceWithOperationTrackerTestPlainUserNameRenderer_name$key = { diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceWithOperationTrackerTestViewerFriendsQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceWithOperationTrackerTestViewerFriendsQuery.graphql.js index 6452f8e7a5122..b0e60c88ee37d 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceWithOperationTrackerTestViewerFriendsQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/FragmentResourceWithOperationTrackerTestViewerFriendsQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<61baee9ff39eca0f0f8d6a5c7eb56d17>> * @flow * @lightSyntaxTransform * @nogrep @@ -32,8 +32,8 @@ export type FragmentResourceWithOperationTrackerTestViewerFriendsQuery$data = {| |}, |}; export type FragmentResourceWithOperationTrackerTestViewerFriendsQuery = {| - variables: FragmentResourceWithOperationTrackerTestViewerFriendsQuery$variables, response: FragmentResourceWithOperationTrackerTestViewerFriendsQuery$data, + variables: FragmentResourceWithOperationTrackerTestViewerFriendsQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/LazyLoadEntryPointContainerDEEPRECATEDTestQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/LazyLoadEntryPointContainerDEEPRECATEDTestQuery.graphql.js index f1279692f0c7b..dcc4e1f103d73 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/LazyLoadEntryPointContainerDEEPRECATEDTestQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/LazyLoadEntryPointContainerDEEPRECATEDTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<2b1ed0be1d87ebff0b31676b39c9daa6>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type LazyLoadEntryPointContainerDEEPRECATEDTestQuery$data = {| |}, |}; export type LazyLoadEntryPointContainerDEEPRECATEDTestQuery = {| - variables: LazyLoadEntryPointContainerDEEPRECATEDTestQuery$variables, response: LazyLoadEntryPointContainerDEEPRECATEDTestQuery$data, + variables: LazyLoadEntryPointContainerDEEPRECATEDTestQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest10Query.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest10Query.graphql.js index f0b4503656562..2becb85e0a418 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest10Query.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest10Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<6a895d43a917ca315fe7fc84c3321c77>> + * @generated SignedSource<<01f34c7f22bb4dab44f0fc4826b0a5f7>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type QueryResourceTest10Query$data = {| |}, |}; export type QueryResourceTest10Query = {| - variables: QueryResourceTest10Query$variables, response: QueryResourceTest10Query$data, + variables: QueryResourceTest10Query$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest1Query.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest1Query.graphql.js index 4c9f1d3167400..7762e2b5685fb 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest1Query.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest1Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<64f27fdeecbeee3819cd375087735e03>> + * @generated SignedSource<<626734fb905543fd77a4a4fdc3a672b6>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type QueryResourceTest1Query$data = {| |}, |}; export type QueryResourceTest1Query = {| - variables: QueryResourceTest1Query$variables, response: QueryResourceTest1Query$data, + variables: QueryResourceTest1Query$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest2Query.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest2Query.graphql.js index 128ce0d0ce744..76319879a0785 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest2Query.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest2Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<6bcda0d5984fcbbd6e1545f663ca7591>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type QueryResourceTest2Query$data = {| |}, |}; export type QueryResourceTest2Query = {| - variables: QueryResourceTest2Query$variables, response: QueryResourceTest2Query$data, + variables: QueryResourceTest2Query$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest3Query.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest3Query.graphql.js index 4210e8e6ca5f7..d16bfffde4e6d 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest3Query.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest3Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<3ffb81f10cd6206e1b7382b9e3240b06>> + * @generated SignedSource<<8ccc450a62a13c210dd2045f5c4e4b5e>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type QueryResourceTest3Query$data = {| |}, |}; export type QueryResourceTest3Query = {| - variables: QueryResourceTest3Query$variables, response: QueryResourceTest3Query$data, + variables: QueryResourceTest3Query$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest4Query.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest4Query.graphql.js index 1279515cc3f38..6b2d9289deb45 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest4Query.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest4Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<6d5c346863daba742ab9ea9acedb8125>> + * @generated SignedSource<<9845302997c9484cbab4cada237f9c07>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type QueryResourceTest4Query$data = {| |}, |}; export type QueryResourceTest4Query = {| - variables: QueryResourceTest4Query$variables, response: QueryResourceTest4Query$data, + variables: QueryResourceTest4Query$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest5Query.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest5Query.graphql.js index 9309bb14ab3c5..23de97ab20740 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest5Query.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest5Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<11bb48d888397cb4bf591fc9825da882>> + * @generated SignedSource<<6f4095120a82cfa97f63db97d7eb8116>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type QueryResourceTest5Query$data = {| |}, |}; export type QueryResourceTest5Query = {| - variables: QueryResourceTest5Query$variables, response: QueryResourceTest5Query$data, + variables: QueryResourceTest5Query$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest6Query.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest6Query.graphql.js index 8e3c94368c385..aa2c5d7e2d71b 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest6Query.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest6Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<079c0a91145316d2cbede051e3ba1b48>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type QueryResourceTest6Query$data = {| |}, |}; export type QueryResourceTest6Query = {| - variables: QueryResourceTest6Query$variables, response: QueryResourceTest6Query$data, + variables: QueryResourceTest6Query$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest7Query.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest7Query.graphql.js index 4451371ccf4ab..89cbc9e100cd9 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest7Query.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest7Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type QueryResourceTest7Query$data = {| |}, |}; export type QueryResourceTest7Query = {| - variables: QueryResourceTest7Query$variables, response: QueryResourceTest7Query$data, + variables: QueryResourceTest7Query$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest8Query.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest8Query.graphql.js index 6aaf2ea707583..5e7184d1a97f2 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest8Query.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest8Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<9b0cd4947554a27e132e8af71bed9b1f>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -28,8 +28,8 @@ export type QueryResourceTest8Query$data = {| |}, |}; export type QueryResourceTest8Query = {| - variables: QueryResourceTest8Query$variables, response: QueryResourceTest8Query$data, + variables: QueryResourceTest8Query$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest9Query.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest9Query.graphql.js index fd97c8dc1b061..cd6011d2fe939 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest9Query.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/QueryResourceTest9Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<5677ef16b2c326cea7e6297cf32d90e8>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type QueryResourceTest9Query$data = {| |}, |}; export type QueryResourceTest9Query = {| - variables: QueryResourceTest9Query$variables, response: QueryResourceTest9Query$data, + variables: QueryResourceTest9Query$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/loadQuerySourceBehaviorTestQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/loadQuerySourceBehaviorTestQuery.graphql.js index 48968bdad1093..a0732b0767b7b 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/loadQuerySourceBehaviorTestQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/loadQuerySourceBehaviorTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<8d63482b89cc8fc5e463cfc79fe2b43d>> + * @generated SignedSource<<5c81830e5d1eb65781977f94b047f64a>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type loadQuerySourceBehaviorTestQuery$data = {| |}, |}; export type loadQuerySourceBehaviorTestQuery = {| - variables: loadQuerySourceBehaviorTestQuery$variables, response: loadQuerySourceBehaviorTestQuery$data, + variables: loadQuerySourceBehaviorTestQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/loadQueryStoreBehaviorTestQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/loadQueryStoreBehaviorTestQuery.graphql.js index 2374708d08ed2..f3148bbe88ba8 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/loadQueryStoreBehaviorTestQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/loadQueryStoreBehaviorTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<6d17e767ad006fa8d8ffbbc3e60651b1>> * @flow * @lightSyntaxTransform * @nogrep @@ -21,13 +21,13 @@ export type loadQueryStoreBehaviorTestQuery$variables = {| |}; export type loadQueryStoreBehaviorTestQuery$data = {| +node: ?{| - +name: ?string, +id: string, + +name: ?string, |}, |}; export type loadQueryStoreBehaviorTestQuery = {| - variables: loadQueryStoreBehaviorTestQuery$variables, response: loadQueryStoreBehaviorTestQuery$data, + variables: loadQueryStoreBehaviorTestQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/loadQueryTestQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/loadQueryTestQuery.graphql.js index 0262de294f554..dd9d847cc811d 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/loadQueryTestQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/loadQueryTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<26ce7f04c139ce29a8f87e43605f313e>> + * @generated SignedSource<<0fe92c6e42ab59e10f28aa729236ff99>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type loadQueryTestQuery$data = {| |}, |}; export type loadQueryTestQuery = {| - variables: loadQueryTestQuery$variables, response: loadQueryTestQuery$data, + variables: loadQueryTestQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/preloadQueryDEPRECATEDTestQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/preloadQueryDEPRECATEDTestQuery.graphql.js index 1ea87142b374a..eace2045dfd40 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/preloadQueryDEPRECATEDTestQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/preloadQueryDEPRECATEDTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<5fdeee39b47f16ae335112169d38864b>> + * @generated SignedSource<<6d8511549ef0f0dd9b097e61e79da1ae>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type preloadQueryDEPRECATEDTestQuery$data = {| |}, |}; export type preloadQueryDEPRECATEDTestQuery = {| - variables: preloadQueryDEPRECATEDTestQuery$variables, response: preloadQueryDEPRECATEDTestQuery$data, + variables: preloadQueryDEPRECATEDTestQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/preloadQueryDEPRECATEDTest_ProvidedVarFragment.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/preloadQueryDEPRECATEDTest_ProvidedVarFragment.graphql.js index aa614fad1faa6..85c598f348616 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/preloadQueryDEPRECATEDTest_ProvidedVarFragment.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/preloadQueryDEPRECATEDTest_ProvidedVarFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,9 +19,9 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type preloadQueryDEPRECATEDTest_ProvidedVarFragment$fragmentType: FragmentType; export type preloadQueryDEPRECATEDTest_ProvidedVarFragment$data = {| - +name?: ?string, +firstName?: ?string, +lastName?: ?string, + +name?: ?string, +username?: ?string, +$fragmentType: preloadQueryDEPRECATEDTest_ProvidedVarFragment$fragmentType, |}; diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/preloadQueryDEPRECATEDTest_ProvidedVarQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/preloadQueryDEPRECATEDTest_ProvidedVarQuery.graphql.js index 98133fb0bafb7..531082c269df2 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/preloadQueryDEPRECATEDTest_ProvidedVarQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/preloadQueryDEPRECATEDTest_ProvidedVarQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -26,14 +26,14 @@ export type preloadQueryDEPRECATEDTest_ProvidedVarQuery$data = {| |}, |}; export type preloadQueryDEPRECATEDTest_ProvidedVarQuery = {| - variables: preloadQueryDEPRECATEDTest_ProvidedVarQuery$variables, response: preloadQueryDEPRECATEDTest_ProvidedVarQuery$data, + variables: preloadQueryDEPRECATEDTest_ProvidedVarQuery$variables, |}; type ProvidedVariablesType = {| - +__relay_internal__pv__RelayProvider_returnsTrue: {| + +__relay_internal__pv__RelayProvider_returnsFalse: {| +get: () => boolean, |}, - +__relay_internal__pv__RelayProvider_returnsFalse: {| + +__relay_internal__pv__RelayProvider_returnsTrue: {| +get: () => boolean, |}, |}; diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTest2Fragment.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTest2Fragment.graphql.js index de0b3d19536e9..18e5eaaf8a520 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTest2Fragment.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTest2Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -20,7 +20,6 @@ import type { FragmentType } from "relay-runtime"; declare export opaque type useBlockingPaginationFragmentTest2Fragment$fragmentType: FragmentType; type useBlockingPaginationFragmentTest2FragmentPaginationQuery$variables = any; export type useBlockingPaginationFragmentTest2Fragment$data = {| - +id: string, +friends: ?{| +edges: ?$ReadOnlyArray, |}, + +id: string, +$fragmentType: useBlockingPaginationFragmentTest2Fragment$fragmentType, |}; export type useBlockingPaginationFragmentTest2Fragment$key = { diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTest2FragmentPaginationQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTest2FragmentPaginationQuery.graphql.js index eb89422f0f29d..b8cb97fae8d0a 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTest2FragmentPaginationQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTest2FragmentPaginationQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<1a4f44c9aa8f96897837c07d32bdf22d>> + * @generated SignedSource<<1fd119e8059b5ecf42c2d9ed06c65226>> * @flow * @lightSyntaxTransform * @nogrep @@ -22,10 +22,10 @@ export type useBlockingPaginationFragmentTest2FragmentPaginationQuery$variables after?: ?string, before?: ?string, first?: ?number, + id: string, isViewerFriendLocal?: ?boolean, last?: ?number, orderby?: ?$ReadOnlyArray, - id: string, |}; export type useBlockingPaginationFragmentTest2FragmentPaginationQuery$data = {| +node: ?{| @@ -33,8 +33,8 @@ export type useBlockingPaginationFragmentTest2FragmentPaginationQuery$data = {| |}, |}; export type useBlockingPaginationFragmentTest2FragmentPaginationQuery = {| - variables: useBlockingPaginationFragmentTest2FragmentPaginationQuery$variables, response: useBlockingPaginationFragmentTest2FragmentPaginationQuery$data, + variables: useBlockingPaginationFragmentTest2FragmentPaginationQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTest4FragmentRefetchQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTest4FragmentRefetchQuery.graphql.js index 48bc9a7dc9ccc..42a18ad5a3955 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTest4FragmentRefetchQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTest4FragmentRefetchQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<8b6449695fa4943e1b13593553cdaf21>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type useBlockingPaginationFragmentTest4FragmentRefetchQuery$data = {| |}, |}; export type useBlockingPaginationFragmentTest4FragmentRefetchQuery = {| - variables: useBlockingPaginationFragmentTest4FragmentRefetchQuery$variables, response: useBlockingPaginationFragmentTest4FragmentRefetchQuery$data, + variables: useBlockingPaginationFragmentTest4FragmentRefetchQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTestNodeQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTestNodeQuery.graphql.js index bb06f5780850b..1cc56955ecb44 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTestNodeQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTestNodeQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<3a1922696ab03149a462e825f6cdeb95>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type useBlockingPaginationFragmentTestNodeQuery$data = {| |}, |}; export type useBlockingPaginationFragmentTestNodeQuery = {| - variables: useBlockingPaginationFragmentTestNodeQuery$variables, response: useBlockingPaginationFragmentTestNodeQuery$data, + variables: useBlockingPaginationFragmentTestNodeQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTestUserFragment.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTestUserFragment.graphql.js index 789af7595756f..6ec07baf3ca5f 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTestUserFragment.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTestUserFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<4a5f27ffb675500d998df57dd2314e65>> + * @generated SignedSource<<388314d3d0b5f25358a47379e481babe>> * @flow * @lightSyntaxTransform * @nogrep @@ -21,8 +21,6 @@ import type { FragmentType } from "relay-runtime"; declare export opaque type useBlockingPaginationFragmentTestUserFragment$fragmentType: FragmentType; type useBlockingPaginationFragmentTestUserFragmentPaginationQuery$variables = any; export type useBlockingPaginationFragmentTestUserFragment$data = {| - +id: string, - +name: ?string, +friends: ?{| +edges: ?$ReadOnlyArray, |}, + +id: string, + +name: ?string, +$fragmentType: useBlockingPaginationFragmentTestUserFragment$fragmentType, |}; export type useBlockingPaginationFragmentTestUserFragment$key = { diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTestUserFragmentPaginationQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTestUserFragmentPaginationQuery.graphql.js index cc1e42c98ae9e..a8fa1c956c74d 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTestUserFragmentPaginationQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTestUserFragmentPaginationQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<0b52f05bcda9bee094d976809c2fbece>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -22,11 +22,11 @@ export type useBlockingPaginationFragmentTestUserFragmentPaginationQuery$variabl after?: ?string, before?: ?string, first?: ?number, + id: string, isViewerFriendLocal?: ?boolean, last?: ?number, orderby?: ?$ReadOnlyArray, scale?: ?number, - id: string, |}; export type useBlockingPaginationFragmentTestUserFragmentPaginationQuery$data = {| +node: ?{| @@ -34,8 +34,8 @@ export type useBlockingPaginationFragmentTestUserFragmentPaginationQuery$data = |}, |}; export type useBlockingPaginationFragmentTestUserFragmentPaginationQuery = {| - variables: useBlockingPaginationFragmentTestUserFragmentPaginationQuery$variables, response: useBlockingPaginationFragmentTestUserFragmentPaginationQuery$data, + variables: useBlockingPaginationFragmentTestUserFragmentPaginationQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTestUserQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTestUserQuery.graphql.js index bf32ae5880e90..0f47612d1defa 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTestUserQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<340f15ef86766277abe91edb3f67ba56>> + * @generated SignedSource<<42ff2fc2410ae428b3b9c9fc4fbde69d>> * @flow * @lightSyntaxTransform * @nogrep @@ -18,13 +18,13 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type useBlockingPaginationFragmentTestUserFragment$fragmentType = any; export type useBlockingPaginationFragmentTestUserQuery$variables = {| - id: string, after?: ?string, - first?: ?number, before?: ?string, + first?: ?number, + id: string, + isViewerFriend?: ?boolean, last?: ?number, orderby?: ?$ReadOnlyArray, - isViewerFriend?: ?boolean, |}; export type useBlockingPaginationFragmentTestUserQuery$data = {| +node: ?{| @@ -32,8 +32,8 @@ export type useBlockingPaginationFragmentTestUserQuery$data = {| |}, |}; export type useBlockingPaginationFragmentTestUserQuery = {| - variables: useBlockingPaginationFragmentTestUserQuery$variables, response: useBlockingPaginationFragmentTestUserQuery$data, + variables: useBlockingPaginationFragmentTestUserQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTestUserQueryNestedFragmentQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTestUserQueryNestedFragmentQuery.graphql.js index d883aa831be73..a04c0adfe3742 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTestUserQueryNestedFragmentQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTestUserQueryNestedFragmentQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<9f7afea4bdb3f8df0175937f5fca6bf5>> * @flow * @lightSyntaxTransform * @nogrep @@ -18,13 +18,13 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type useBlockingPaginationFragmentTestUserFragment$fragmentType = any; export type useBlockingPaginationFragmentTestUserQueryNestedFragmentQuery$variables = {| - id: string, after?: ?string, - first?: ?number, before?: ?string, + first?: ?number, + id: string, + isViewerFriend?: ?boolean, last?: ?number, orderby?: ?$ReadOnlyArray, - isViewerFriend?: ?boolean, |}; export type useBlockingPaginationFragmentTestUserQueryNestedFragmentQuery$data = {| +node: ?{| @@ -34,8 +34,8 @@ export type useBlockingPaginationFragmentTestUserQueryNestedFragmentQuery$data = |}, |}; export type useBlockingPaginationFragmentTestUserQueryNestedFragmentQuery = {| - variables: useBlockingPaginationFragmentTestUserQueryNestedFragmentQuery$variables, response: useBlockingPaginationFragmentTestUserQueryNestedFragmentQuery$data, + variables: useBlockingPaginationFragmentTestUserQueryNestedFragmentQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTestUserQueryWithLiteralArgsQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTestUserQueryWithLiteralArgsQuery.graphql.js index 6fde3bec028db..751e38361f658 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTestUserQueryWithLiteralArgsQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTestUserQueryWithLiteralArgsQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<059f2a866e980df6cafa72a0109415bc>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -18,10 +18,10 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type useBlockingPaginationFragmentTestUserFragment$fragmentType = any; export type useBlockingPaginationFragmentTestUserQueryWithLiteralArgsQuery$variables = {| - id: string, after?: ?string, - first?: ?number, before?: ?string, + first?: ?number, + id: string, last?: ?number, |}; export type useBlockingPaginationFragmentTestUserQueryWithLiteralArgsQuery$data = {| @@ -30,8 +30,8 @@ export type useBlockingPaginationFragmentTestUserQueryWithLiteralArgsQuery$data |}, |}; export type useBlockingPaginationFragmentTestUserQueryWithLiteralArgsQuery = {| - variables: useBlockingPaginationFragmentTestUserQueryWithLiteralArgsQuery$variables, response: useBlockingPaginationFragmentTestUserQueryWithLiteralArgsQuery$data, + variables: useBlockingPaginationFragmentTestUserQueryWithLiteralArgsQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTestUserQueryWithoutIDQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTestUserQueryWithoutIDQuery.graphql.js index a2fb2dbdb90b9..f1a39c0b11441 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTestUserQueryWithoutIDQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentTestUserQueryWithoutIDQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<9a7f8fa58500d69599b23e141b76e213>> + * @generated SignedSource<<684943433c4031670e4779c24e64289f>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,11 +19,11 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type useBlockingPaginationFragmentTestUserFragment$fragmentType = any; export type useBlockingPaginationFragmentTestUserQueryWithoutIDQuery$variables = {| after?: ?string, - first?: ?number, before?: ?string, + first?: ?number, + isViewerFriend?: ?boolean, last?: ?number, orderby?: ?$ReadOnlyArray, - isViewerFriend?: ?boolean, |}; export type useBlockingPaginationFragmentTestUserQueryWithoutIDQuery$data = {| +viewer: ?{| @@ -33,8 +33,8 @@ export type useBlockingPaginationFragmentTestUserQueryWithoutIDQuery$data = {| |}, |}; export type useBlockingPaginationFragmentTestUserQueryWithoutIDQuery = {| - variables: useBlockingPaginationFragmentTestUserQueryWithoutIDQuery$variables, response: useBlockingPaginationFragmentTestUserQueryWithoutIDQuery$data, + variables: useBlockingPaginationFragmentTestUserQueryWithoutIDQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentWithSuspenseTransitionTestUserFragment.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentWithSuspenseTransitionTestUserFragment.graphql.js index 81ec2f0580ac3..13d6603c330ec 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentWithSuspenseTransitionTestUserFragment.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentWithSuspenseTransitionTestUserFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<58bc9bd8b95a29f10eff02badf3382c8>> + * @generated SignedSource<<47d69170f4fe31289591a7b4ea7baaff>> * @flow * @lightSyntaxTransform * @nogrep @@ -21,8 +21,6 @@ import type { FragmentType } from "relay-runtime"; declare export opaque type useBlockingPaginationFragmentWithSuspenseTransitionTestUserFragment$fragmentType: FragmentType; type useBlockingPaginationFragmentWithSuspenseTransitionTestUserFragmentPaginationQuery$variables = any; export type useBlockingPaginationFragmentWithSuspenseTransitionTestUserFragment$data = {| - +id: string, - +name: ?string, +friends: ?{| +edges: ?$ReadOnlyArray, |}, + +id: string, + +name: ?string, +$fragmentType: useBlockingPaginationFragmentWithSuspenseTransitionTestUserFragment$fragmentType, |}; export type useBlockingPaginationFragmentWithSuspenseTransitionTestUserFragment$key = { diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentWithSuspenseTransitionTestUserFragmentPaginationQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentWithSuspenseTransitionTestUserFragmentPaginationQuery.graphql.js index fdaa090f8cab3..c61117b1d810c 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentWithSuspenseTransitionTestUserFragmentPaginationQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentWithSuspenseTransitionTestUserFragmentPaginationQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -22,10 +22,10 @@ export type useBlockingPaginationFragmentWithSuspenseTransitionTestUserFragmentP after?: ?string, before?: ?string, first?: ?number, + id: string, isViewerFriendLocal?: ?boolean, last?: ?number, orderby?: ?$ReadOnlyArray, - id: string, |}; export type useBlockingPaginationFragmentWithSuspenseTransitionTestUserFragmentPaginationQuery$data = {| +node: ?{| @@ -33,8 +33,8 @@ export type useBlockingPaginationFragmentWithSuspenseTransitionTestUserFragmentP |}, |}; export type useBlockingPaginationFragmentWithSuspenseTransitionTestUserFragmentPaginationQuery = {| - variables: useBlockingPaginationFragmentWithSuspenseTransitionTestUserFragmentPaginationQuery$variables, response: useBlockingPaginationFragmentWithSuspenseTransitionTestUserFragmentPaginationQuery$data, + variables: useBlockingPaginationFragmentWithSuspenseTransitionTestUserFragmentPaginationQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentWithSuspenseTransitionTestUserQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentWithSuspenseTransitionTestUserQuery.graphql.js index e415a32648cba..6a2156e2b5d25 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentWithSuspenseTransitionTestUserQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentWithSuspenseTransitionTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<49bbc9c3bc35cbc3747c93a599b4a686>> * @flow * @lightSyntaxTransform * @nogrep @@ -18,13 +18,13 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type useBlockingPaginationFragmentWithSuspenseTransitionTestUserFragment$fragmentType = any; export type useBlockingPaginationFragmentWithSuspenseTransitionTestUserQuery$variables = {| - id: string, after?: ?string, - first?: ?number, before?: ?string, + first?: ?number, + id: string, + isViewerFriend?: ?boolean, last?: ?number, orderby?: ?$ReadOnlyArray, - isViewerFriend?: ?boolean, |}; export type useBlockingPaginationFragmentWithSuspenseTransitionTestUserQuery$data = {| +node: ?{| @@ -34,8 +34,8 @@ export type useBlockingPaginationFragmentWithSuspenseTransitionTestUserQuery$dat |}, |}; export type useBlockingPaginationFragmentWithSuspenseTransitionTestUserQuery = {| - variables: useBlockingPaginationFragmentWithSuspenseTransitionTestUserQuery$variables, response: useBlockingPaginationFragmentWithSuspenseTransitionTestUserQuery$data, + variables: useBlockingPaginationFragmentWithSuspenseTransitionTestUserQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentWithSuspenseTransitionTestUserQueryWithoutIDQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentWithSuspenseTransitionTestUserQueryWithoutIDQuery.graphql.js index de44a8b45b307..b1282d165b564 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentWithSuspenseTransitionTestUserQueryWithoutIDQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useBlockingPaginationFragmentWithSuspenseTransitionTestUserQueryWithoutIDQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<9690e430704cd41b7a3417965ce6bb0d>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,11 +19,11 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type useBlockingPaginationFragmentWithSuspenseTransitionTestUserFragment$fragmentType = any; export type useBlockingPaginationFragmentWithSuspenseTransitionTestUserQueryWithoutIDQuery$variables = {| after?: ?string, - first?: ?number, before?: ?string, + first?: ?number, + isViewerFriend?: ?boolean, last?: ?number, orderby?: ?$ReadOnlyArray, - isViewerFriend?: ?boolean, |}; export type useBlockingPaginationFragmentWithSuspenseTransitionTestUserQueryWithoutIDQuery$data = {| +viewer: ?{| @@ -33,8 +33,8 @@ export type useBlockingPaginationFragmentWithSuspenseTransitionTestUserQueryWith |}, |}; export type useBlockingPaginationFragmentWithSuspenseTransitionTestUserQueryWithoutIDQuery = {| - variables: useBlockingPaginationFragmentWithSuspenseTransitionTestUserQueryWithoutIDQuery$variables, response: useBlockingPaginationFragmentWithSuspenseTransitionTestUserQueryWithoutIDQuery$data, + variables: useBlockingPaginationFragmentWithSuspenseTransitionTestUserQueryWithoutIDQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useEntryPointLoaderReactDoubleEffectsTestUserQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useEntryPointLoaderReactDoubleEffectsTestUserQuery.graphql.js index 2e9763941d228..335406b715ec9 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useEntryPointLoaderReactDoubleEffectsTestUserQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useEntryPointLoaderReactDoubleEffectsTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<1f30867a9a0057d34fbc46478c6255c5>> * @flow * @lightSyntaxTransform * @nogrep @@ -28,8 +28,8 @@ export type useEntryPointLoaderReactDoubleEffectsTestUserQuery$data = {| |}, |}; export type useEntryPointLoaderReactDoubleEffectsTestUserQuery = {| - variables: useEntryPointLoaderReactDoubleEffectsTestUserQuery$variables, response: useEntryPointLoaderReactDoubleEffectsTestUserQuery$data, + variables: useEntryPointLoaderReactDoubleEffectsTestUserQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useFragmentNodeReactDoubleEffectsTestUserQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useFragmentNodeReactDoubleEffectsTestUserQuery.graphql.js index 08e97ce23f9b8..c23c309e624a1 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useFragmentNodeReactDoubleEffectsTestUserQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useFragmentNodeReactDoubleEffectsTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<32718e07409b92f3fe94fb2e525d969e>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type useFragmentNodeReactDoubleEffectsTestUserQuery$data = {| |}, |}; export type useFragmentNodeReactDoubleEffectsTestUserQuery = {| - variables: useFragmentNodeReactDoubleEffectsTestUserQuery$variables, response: useFragmentNodeReactDoubleEffectsTestUserQuery$data, + variables: useFragmentNodeReactDoubleEffectsTestUserQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useFragmentNodeRequiredTestUserQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useFragmentNodeRequiredTestUserQuery.graphql.js index 1a8ed80213827..5103d9b61558c 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useFragmentNodeRequiredTestUserQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useFragmentNodeRequiredTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<679536e712b0e623c1bff15eac8cf9d3>> + * @generated SignedSource<<49b20b1495d450f537699186ac35a719>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type useFragmentNodeRequiredTestUserQuery$data = {| |}, |}; export type useFragmentNodeRequiredTestUserQuery = {| - variables: useFragmentNodeRequiredTestUserQuery$variables, response: useFragmentNodeRequiredTestUserQuery$data, + variables: useFragmentNodeRequiredTestUserQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useFragmentNodeTestUserQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useFragmentNodeTestUserQuery.graphql.js index c438e8a6c0fbd..a4abbc3e43955 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useFragmentNodeTestUserQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useFragmentNodeTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<83987e1fa8d0395f95f677f0b8f585d7>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type useFragmentNodeTestUserQuery$data = {| |}, |}; export type useFragmentNodeTestUserQuery = {| - variables: useFragmentNodeTestUserQuery$variables, response: useFragmentNodeTestUserQuery$data, + variables: useFragmentNodeTestUserQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useFragmentNodeTestUsersQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useFragmentNodeTestUsersQuery.graphql.js index d445ca007d88f..48a9fc43ec1ac 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useFragmentNodeTestUsersQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useFragmentNodeTestUsersQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<4060f58bbe006f0877079d63ca6ac470>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type useFragmentNodeTestUsersQuery$data = {| |}>, |}; export type useFragmentNodeTestUsersQuery = {| - variables: useFragmentNodeTestUsersQuery$variables, response: useFragmentNodeTestUsersQuery$data, + variables: useFragmentNodeTestUsersQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useFragmentTestUserQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useFragmentTestUserQuery.graphql.js index 9200b8b7052fb..727d5f0c8770f 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useFragmentTestUserQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useFragmentTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<0e9dfc63b21343011122caeb97439d37>> + * @generated SignedSource<<6a8fcc9281a8f74812eb832c913fc514>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type useFragmentTestUserQuery$data = {| |}, |}; export type useFragmentTestUserQuery = {| - variables: useFragmentTestUserQuery$variables, response: useFragmentTestUserQuery$data, + variables: useFragmentTestUserQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useFragmentTestUsersQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useFragmentTestUsersQuery.graphql.js index b443a362d7094..9507ab64bbf87 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useFragmentTestUsersQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useFragmentTestUsersQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<86492672c9fe904fa173e6a2578e32e4>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type useFragmentTestUsersQuery$data = {| |}>, |}; export type useFragmentTestUsersQuery = {| - variables: useFragmentTestUsersQuery$variables, response: useFragmentTestUsersQuery$data, + variables: useFragmentTestUsersQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useIsParentQueryActiveTestUserQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useIsParentQueryActiveTestUserQuery.graphql.js index 068abf81efdf6..6f0b343bf4f58 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useIsParentQueryActiveTestUserQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useIsParentQueryActiveTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<69036b4325de6c366810f6d777c9bbb9>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type useIsParentQueryActiveTestUserQuery$data = {| |}, |}; export type useIsParentQueryActiveTestUserQuery = {| - variables: useIsParentQueryActiveTestUserQuery$variables, response: useIsParentQueryActiveTestUserQuery$data, + variables: useIsParentQueryActiveTestUserQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useLazyLoadQueryNodeFastRefreshTestUserQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useLazyLoadQueryNodeFastRefreshTestUserQuery.graphql.js index 905e89bf2a1de..423b723207bff 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useLazyLoadQueryNodeFastRefreshTestUserQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useLazyLoadQueryNodeFastRefreshTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -28,8 +28,8 @@ export type useLazyLoadQueryNodeFastRefreshTestUserQuery$data = {| |}, |}; export type useLazyLoadQueryNodeFastRefreshTestUserQuery = {| - variables: useLazyLoadQueryNodeFastRefreshTestUserQuery$variables, response: useLazyLoadQueryNodeFastRefreshTestUserQuery$data, + variables: useLazyLoadQueryNodeFastRefreshTestUserQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useLazyLoadQueryNodeReactDoubleEffectsTestUserQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useLazyLoadQueryNodeReactDoubleEffectsTestUserQuery.graphql.js index c426e4c117de7..04ca1df82936a 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useLazyLoadQueryNodeReactDoubleEffectsTestUserQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useLazyLoadQueryNodeReactDoubleEffectsTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<8e5d95e17367cfa15b1cbe06da954996>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -28,8 +28,8 @@ export type useLazyLoadQueryNodeReactDoubleEffectsTestUserQuery$data = {| |}, |}; export type useLazyLoadQueryNodeReactDoubleEffectsTestUserQuery = {| - variables: useLazyLoadQueryNodeReactDoubleEffectsTestUserQuery$variables, response: useLazyLoadQueryNodeReactDoubleEffectsTestUserQuery$data, + variables: useLazyLoadQueryNodeReactDoubleEffectsTestUserQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useLazyLoadQueryNodeReactDoubleEffectsTestUserQueryWithDeferQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useLazyLoadQueryNodeReactDoubleEffectsTestUserQueryWithDeferQuery.graphql.js index 50a76b0c318b9..c6e9a6cf13255 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useLazyLoadQueryNodeReactDoubleEffectsTestUserQueryWithDeferQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useLazyLoadQueryNodeReactDoubleEffectsTestUserQueryWithDeferQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<04f909138d4363c5043ce6594da8cc09>> + * @generated SignedSource<<2d77db37d76457913cd1ae745316a198>> * @flow * @lightSyntaxTransform * @nogrep @@ -28,8 +28,8 @@ export type useLazyLoadQueryNodeReactDoubleEffectsTestUserQueryWithDeferQuery$da |}, |}; export type useLazyLoadQueryNodeReactDoubleEffectsTestUserQueryWithDeferQuery = {| - variables: useLazyLoadQueryNodeReactDoubleEffectsTestUserQueryWithDeferQuery$variables, response: useLazyLoadQueryNodeReactDoubleEffectsTestUserQueryWithDeferQuery$data, + variables: useLazyLoadQueryNodeReactDoubleEffectsTestUserQueryWithDeferQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useLazyLoadQueryNodeTest1Query.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useLazyLoadQueryNodeTest1Query.graphql.js index f68a220b40810..de9eaf7327cee 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useLazyLoadQueryNodeTest1Query.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useLazyLoadQueryNodeTest1Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type useLazyLoadQueryNodeTest1Query$data = {| |}, |}; export type useLazyLoadQueryNodeTest1Query = {| - variables: useLazyLoadQueryNodeTest1Query$variables, response: useLazyLoadQueryNodeTest1Query$data, + variables: useLazyLoadQueryNodeTest1Query$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useLazyLoadQueryNodeTestOnlyFragmentsQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useLazyLoadQueryNodeTestOnlyFragmentsQuery.graphql.js index 63f627aef6a9f..73fe6f5fb3893 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useLazyLoadQueryNodeTestOnlyFragmentsQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useLazyLoadQueryNodeTestOnlyFragmentsQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<4abd5992318921b9e4f23a2a4f1c64d9>> + * @generated SignedSource<<5de3fc584be2abc43a974ac1b7756663>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type useLazyLoadQueryNodeTestOnlyFragmentsQuery$data = {| +$fragmentSpreads: useLazyLoadQueryNodeTestRootFragment$fragmentType, |}; export type useLazyLoadQueryNodeTestOnlyFragmentsQuery = {| - variables: useLazyLoadQueryNodeTestOnlyFragmentsQuery$variables, response: useLazyLoadQueryNodeTestOnlyFragmentsQuery$data, + variables: useLazyLoadQueryNodeTestOnlyFragmentsQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useLazyLoadQueryNodeTestUserQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useLazyLoadQueryNodeTestUserQuery.graphql.js index 5efc8254711c4..5af2da2bb1b36 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useLazyLoadQueryNodeTestUserQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useLazyLoadQueryNodeTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -28,8 +28,8 @@ export type useLazyLoadQueryNodeTestUserQuery$data = {| |}, |}; export type useLazyLoadQueryNodeTestUserQuery = {| - variables: useLazyLoadQueryNodeTestUserQuery$variables, response: useLazyLoadQueryNodeTestUserQuery$data, + variables: useLazyLoadQueryNodeTestUserQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useMutationFastRefreshTestCommentCreateMutation.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useMutationFastRefreshTestCommentCreateMutation.graphql.js index 4ea29feac7471..85034e8a8e8d0 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useMutationFastRefreshTestCommentCreateMutation.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useMutationFastRefreshTestCommentCreateMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<49bb47dbaf1d1c53c0c1b4a2c9b573ca>> + * @generated SignedSource<<8f00df834f4140f3a7219e4aeee74987>> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Mutation } from 'relay-runtime'; export type CommentCreateInput = {| clientMutationId?: ?string, - feedbackId?: ?string, feedback?: ?CommentfeedbackFeedback, + feedbackId?: ?string, |}; export type CommentfeedbackFeedback = {| comment?: ?FeedbackcommentComment, @@ -35,17 +35,17 @@ export type useMutationFastRefreshTestCommentCreateMutation$data = {| +feedbackCommentEdge: ?{| +cursor: ?string, +node: ?{| - +id: string, +body: ?{| +text: ?string, |}, + +id: string, |}, |}, |}, |}; export type useMutationFastRefreshTestCommentCreateMutation = {| - variables: useMutationFastRefreshTestCommentCreateMutation$variables, response: useMutationFastRefreshTestCommentCreateMutation$data, + variables: useMutationFastRefreshTestCommentCreateMutation$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useMutationTest1Mutation.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useMutationTest1Mutation.graphql.js index c6e6fec3ad11c..2a1aae59b7481 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useMutationTest1Mutation.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useMutationTest1Mutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<0451d58ff47d1b99e93cdaef39bce528>> + * @generated SignedSource<<943b7724c1cf5b7947865e9ba976868c>> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Mutation } from 'relay-runtime'; export type CommentCreateInput = {| clientMutationId?: ?string, - feedbackId?: ?string, feedback?: ?CommentfeedbackFeedback, + feedbackId?: ?string, |}; export type CommentfeedbackFeedback = {| comment?: ?FeedbackcommentComment, @@ -35,17 +35,17 @@ export type useMutationTest1Mutation$data = {| +feedbackCommentEdge: ?{| +cursor: ?string, +node: ?{| - +id: string, +body: ?{| +text: ?string, |}, + +id: string, |}, |}, |}, |}; export type useMutationTest1Mutation = {| - variables: useMutationTest1Mutation$variables, response: useMutationTest1Mutation$data, + variables: useMutationTest1Mutation$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useMutationTest2Mutation.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useMutationTest2Mutation.graphql.js index 80f7a0fb42d99..87da770b0810e 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useMutationTest2Mutation.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useMutationTest2Mutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<68c6d752205f6fe9b348a387c7435173>> + * @generated SignedSource<<07d673db7fcc70fb4e2c05da6ad6ce62>> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Mutation } from 'relay-runtime'; export type CommentCreateInput = {| clientMutationId?: ?string, - feedbackId?: ?string, feedback?: ?CommentfeedbackFeedback, + feedbackId?: ?string, |}; export type CommentfeedbackFeedback = {| comment?: ?FeedbackcommentComment, @@ -35,17 +35,17 @@ export type useMutationTest2Mutation$data = {| +feedbackCommentEdge: ?{| +cursor: ?string, +node: ?{| - +id: string, +body: ?{| +text: ?string, |}, + +id: string, |}, |}, |}, |}; export type useMutationTest2Mutation = {| - variables: useMutationTest2Mutation$variables, response: useMutationTest2Mutation$data, + variables: useMutationTest2Mutation$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTest3FragmentRefetchQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTest3FragmentRefetchQuery.graphql.js index cb757789b59ab..ff3a84f7745fe 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTest3FragmentRefetchQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTest3FragmentRefetchQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type usePaginationFragmentTest3FragmentRefetchQuery$data = {| |}, |}; export type usePaginationFragmentTest3FragmentRefetchQuery = {| - variables: usePaginationFragmentTest3FragmentRefetchQuery$variables, response: usePaginationFragmentTest3FragmentRefetchQuery$data, + variables: usePaginationFragmentTest3FragmentRefetchQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestStoryFragment.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestStoryFragment.graphql.js index 428ed826d72c4..6de8dc82d3609 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestStoryFragment.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestStoryFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<89c554d1d0e3887265a83d2cb14dddd2>> + * @generated SignedSource<<34917de16ef068375a69147e66b7ba8a>> * @flow * @lightSyntaxTransform * @nogrep @@ -20,6 +20,7 @@ import type { FragmentType } from "relay-runtime"; declare export opaque type usePaginationFragmentTestStoryFragment$fragmentType: FragmentType; type usePaginationFragmentTestStoryFragmentRefetchQuery$variables = any; export type usePaginationFragmentTestStoryFragment$data = {| + +__token: string, +comments: ?{| +edges: ?$ReadOnlyArray, |}, +fetch_id: string, - +__token: string, +$fragmentType: usePaginationFragmentTestStoryFragment$fragmentType, |}; export type usePaginationFragmentTestStoryFragment$key = { diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestStoryFragmentRefetchQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestStoryFragmentRefetchQuery.graphql.js index a8cfae93bb679..4b8ac040dafee 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestStoryFragmentRefetchQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestStoryFragmentRefetchQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<2981c796c75d07d7a7417cf8c5e745db>> * @flow * @lightSyntaxTransform * @nogrep @@ -29,8 +29,8 @@ export type usePaginationFragmentTestStoryFragmentRefetchQuery$data = {| |}, |}; export type usePaginationFragmentTestStoryFragmentRefetchQuery = {| - variables: usePaginationFragmentTestStoryFragmentRefetchQuery$variables, response: usePaginationFragmentTestStoryFragmentRefetchQuery$data, + variables: usePaginationFragmentTestStoryFragmentRefetchQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestStoryQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestStoryQuery.graphql.js index 7d0a5c3ef8c63..e0833b90eb040 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestStoryQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestStoryQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<1e23cc50dbdbd2432b8152d74fe0ffbc>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type usePaginationFragmentTestStoryQuery$data = {| |}, |}; export type usePaginationFragmentTestStoryQuery = {| - variables: usePaginationFragmentTestStoryQuery$variables, response: usePaginationFragmentTestStoryQuery$data, + variables: usePaginationFragmentTestStoryQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserFragment.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserFragment.graphql.js index 1da14224185ec..1067821319a23 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserFragment.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<8e1756c0473705244fa2617c4045898c>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -21,8 +21,6 @@ import type { FragmentType } from "relay-runtime"; declare export opaque type usePaginationFragmentTestUserFragment$fragmentType: FragmentType; type usePaginationFragmentTestUserFragmentPaginationQuery$variables = any; export type usePaginationFragmentTestUserFragment$data = {| - +id: string, - +name: ?string, +friends: ?{| +edges: ?$ReadOnlyArray, |}, + +id: string, + +name: ?string, +$fragmentType: usePaginationFragmentTestUserFragment$fragmentType, |}; export type usePaginationFragmentTestUserFragment$key = { diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserFragmentPaginationQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserFragmentPaginationQuery.graphql.js index 8ce22b9618493..46a3daf3d1fd7 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserFragmentPaginationQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserFragmentPaginationQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<2a4aa1e02b0d6c6c6b5d87e7b040712c>> * @flow * @lightSyntaxTransform * @nogrep @@ -22,11 +22,11 @@ export type usePaginationFragmentTestUserFragmentPaginationQuery$variables = {| after?: ?string, before?: ?string, first?: ?number, + id: string, isViewerFriendLocal?: ?boolean, last?: ?number, orderby?: ?$ReadOnlyArray, scale?: ?number, - id: string, |}; export type usePaginationFragmentTestUserFragmentPaginationQuery$data = {| +node: ?{| @@ -34,8 +34,8 @@ export type usePaginationFragmentTestUserFragmentPaginationQuery$data = {| |}, |}; export type usePaginationFragmentTestUserFragmentPaginationQuery = {| - variables: usePaginationFragmentTestUserFragmentPaginationQuery$variables, response: usePaginationFragmentTestUserFragmentPaginationQuery$data, + variables: usePaginationFragmentTestUserFragmentPaginationQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserFragmentStreamingPaginationQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserFragmentStreamingPaginationQuery.graphql.js index 4f4ac116fc78f..aca9d13d4839c 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserFragmentStreamingPaginationQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserFragmentStreamingPaginationQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<33d40615ec7a0122e6432899ce4e81ac>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -22,11 +22,11 @@ export type usePaginationFragmentTestUserFragmentStreamingPaginationQuery$variab after?: ?string, before?: ?string, first?: ?number, + id: string, isViewerFriendLocal?: ?boolean, last?: ?number, orderby?: ?$ReadOnlyArray, scale?: ?number, - id: string, |}; export type usePaginationFragmentTestUserFragmentStreamingPaginationQuery$data = {| +node: ?{| @@ -34,8 +34,8 @@ export type usePaginationFragmentTestUserFragmentStreamingPaginationQuery$data = |}, |}; export type usePaginationFragmentTestUserFragmentStreamingPaginationQuery = {| - variables: usePaginationFragmentTestUserFragmentStreamingPaginationQuery$variables, response: usePaginationFragmentTestUserFragmentStreamingPaginationQuery$data, + variables: usePaginationFragmentTestUserFragmentStreamingPaginationQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserFragmentWithStreaming.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserFragmentWithStreaming.graphql.js index d4f6e49dc65f9..715d470e91f31 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserFragmentWithStreaming.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserFragmentWithStreaming.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<586a2008ff42777ca256e69a1ffcb139>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -21,8 +21,6 @@ import type { FragmentType } from "relay-runtime"; declare export opaque type usePaginationFragmentTestUserFragmentWithStreaming$fragmentType: FragmentType; type usePaginationFragmentTestUserFragmentStreamingPaginationQuery$variables = any; export type usePaginationFragmentTestUserFragmentWithStreaming$data = {| - +id: string, - +name: ?string, +friends: ?{| +edges: ?$ReadOnlyArray, |}, + +id: string, + +name: ?string, +$fragmentType: usePaginationFragmentTestUserFragmentWithStreaming$fragmentType, |}; export type usePaginationFragmentTestUserFragmentWithStreaming$key = { diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserQuery.graphql.js index e0e74a09461fc..95c4af4717386 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<0940e7a3ab736e73f65d77d1d145fb4a>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -18,13 +18,13 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type usePaginationFragmentTestUserFragment$fragmentType = any; export type usePaginationFragmentTestUserQuery$variables = {| - id: string, after?: ?string, - first?: ?number, before?: ?string, + first?: ?number, + id: string, + isViewerFriend?: ?boolean, last?: ?number, orderby?: ?$ReadOnlyArray, - isViewerFriend?: ?boolean, |}; export type usePaginationFragmentTestUserQuery$data = {| +node: ?{| @@ -32,8 +32,8 @@ export type usePaginationFragmentTestUserQuery$data = {| |}, |}; export type usePaginationFragmentTestUserQuery = {| - variables: usePaginationFragmentTestUserQuery$variables, response: usePaginationFragmentTestUserQuery$data, + variables: usePaginationFragmentTestUserQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserQueryNestedFragmentQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserQueryNestedFragmentQuery.graphql.js index 09923068cdd26..cdd4ae9b3b6b5 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserQueryNestedFragmentQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserQueryNestedFragmentQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<00e3f5c23522b2aae8e35becb6bac31c>> * @flow * @lightSyntaxTransform * @nogrep @@ -18,13 +18,13 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type usePaginationFragmentTestUserFragment$fragmentType = any; export type usePaginationFragmentTestUserQueryNestedFragmentQuery$variables = {| - id: string, after?: ?string, - first?: ?number, before?: ?string, + first?: ?number, + id: string, + isViewerFriend?: ?boolean, last?: ?number, orderby?: ?$ReadOnlyArray, - isViewerFriend?: ?boolean, |}; export type usePaginationFragmentTestUserQueryNestedFragmentQuery$data = {| +node: ?{| @@ -34,8 +34,8 @@ export type usePaginationFragmentTestUserQueryNestedFragmentQuery$data = {| |}, |}; export type usePaginationFragmentTestUserQueryNestedFragmentQuery = {| - variables: usePaginationFragmentTestUserQueryNestedFragmentQuery$variables, response: usePaginationFragmentTestUserQueryNestedFragmentQuery$data, + variables: usePaginationFragmentTestUserQueryNestedFragmentQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserQueryWithLiteralArgsQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserQueryWithLiteralArgsQuery.graphql.js index c9c79b391b2e4..27ffe06892ed8 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserQueryWithLiteralArgsQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserQueryWithLiteralArgsQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -18,10 +18,10 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type usePaginationFragmentTestUserFragment$fragmentType = any; export type usePaginationFragmentTestUserQueryWithLiteralArgsQuery$variables = {| - id: string, after?: ?string, - first?: ?number, before?: ?string, + first?: ?number, + id: string, last?: ?number, |}; export type usePaginationFragmentTestUserQueryWithLiteralArgsQuery$data = {| @@ -30,8 +30,8 @@ export type usePaginationFragmentTestUserQueryWithLiteralArgsQuery$data = {| |}, |}; export type usePaginationFragmentTestUserQueryWithLiteralArgsQuery = {| - variables: usePaginationFragmentTestUserQueryWithLiteralArgsQuery$variables, response: usePaginationFragmentTestUserQueryWithLiteralArgsQuery$data, + variables: usePaginationFragmentTestUserQueryWithLiteralArgsQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserQueryWithStreamingQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserQueryWithStreamingQuery.graphql.js index efc1ebf706142..615392bea0d33 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserQueryWithStreamingQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserQueryWithStreamingQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<8b0aa8ffc610c283fdfc038d1917649f>> + * @generated SignedSource<<571a1be2b8651735ff59efd557720930>> * @flow * @lightSyntaxTransform * @nogrep @@ -18,13 +18,13 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type usePaginationFragmentTestUserFragmentWithStreaming$fragmentType = any; export type usePaginationFragmentTestUserQueryWithStreamingQuery$variables = {| - id: string, after?: ?string, - first?: ?number, before?: ?string, + first?: ?number, + id: string, + isViewerFriend?: ?boolean, last?: ?number, orderby?: ?$ReadOnlyArray, - isViewerFriend?: ?boolean, |}; export type usePaginationFragmentTestUserQueryWithStreamingQuery$data = {| +node: ?{| @@ -32,8 +32,8 @@ export type usePaginationFragmentTestUserQueryWithStreamingQuery$data = {| |}, |}; export type usePaginationFragmentTestUserQueryWithStreamingQuery = {| - variables: usePaginationFragmentTestUserQueryWithStreamingQuery$variables, response: usePaginationFragmentTestUserQueryWithStreamingQuery$data, + variables: usePaginationFragmentTestUserQueryWithStreamingQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserQueryWithoutIDQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserQueryWithoutIDQuery.graphql.js index ada1401bf082a..3b37d273eb6f4 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserQueryWithoutIDQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/usePaginationFragmentTestUserQueryWithoutIDQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<56e0996f549e73a8dd1118b208d2a0ca>> + * @generated SignedSource<<63d79d6f17e2fa9807f051e8902c3fba>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,11 +19,11 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type usePaginationFragmentTestUserFragment$fragmentType = any; export type usePaginationFragmentTestUserQueryWithoutIDQuery$variables = {| after?: ?string, - first?: ?number, before?: ?string, + first?: ?number, + isViewerFriend?: ?boolean, last?: ?number, orderby?: ?$ReadOnlyArray, - isViewerFriend?: ?boolean, |}; export type usePaginationFragmentTestUserQueryWithoutIDQuery$data = {| +viewer: ?{| @@ -33,8 +33,8 @@ export type usePaginationFragmentTestUserQueryWithoutIDQuery$data = {| |}, |}; export type usePaginationFragmentTestUserQueryWithoutIDQuery = {| - variables: usePaginationFragmentTestUserQueryWithoutIDQuery$variables, response: usePaginationFragmentTestUserQueryWithoutIDQuery$data, + variables: usePaginationFragmentTestUserQueryWithoutIDQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/usePreloadedQueryProvidedVariablesTest_Fragment.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/usePreloadedQueryProvidedVariablesTest_Fragment.graphql.js index b060553bd8362..cec386a478ddf 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/usePreloadedQueryProvidedVariablesTest_Fragment.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/usePreloadedQueryProvidedVariablesTest_Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<801f3d305184e4f72e016e44e0c121c6>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,9 +19,9 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type usePreloadedQueryProvidedVariablesTest_Fragment$fragmentType: FragmentType; export type usePreloadedQueryProvidedVariablesTest_Fragment$data = {| - +name?: ?string, +firstName?: ?string, +lastName?: ?string, + +name?: ?string, +username?: ?string, +$fragmentType: usePreloadedQueryProvidedVariablesTest_Fragment$fragmentType, |}; diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/usePreloadedQueryProvidedVariablesTest_Query.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/usePreloadedQueryProvidedVariablesTest_Query.graphql.js index 4de40e0bc2e44..2c199d63a06a7 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/usePreloadedQueryProvidedVariablesTest_Query.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/usePreloadedQueryProvidedVariablesTest_Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<609dc7fc7ce06146c64248d3cc61f7b3>> + * @generated SignedSource<<8fb793b5cb506c9e9892152cfeb04853>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,14 +27,14 @@ export type usePreloadedQueryProvidedVariablesTest_Query$data = {| |}, |}; export type usePreloadedQueryProvidedVariablesTest_Query = {| - variables: usePreloadedQueryProvidedVariablesTest_Query$variables, response: usePreloadedQueryProvidedVariablesTest_Query$data, + variables: usePreloadedQueryProvidedVariablesTest_Query$variables, |}; type ProvidedVariablesType = {| - +__relay_internal__pv__RelayProvider_returnsTrue: {| + +__relay_internal__pv__RelayProvider_returnsFalse: {| +get: () => boolean, |}, - +__relay_internal__pv__RelayProvider_returnsFalse: {| + +__relay_internal__pv__RelayProvider_returnsTrue: {| +get: () => boolean, |}, |}; diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/usePreloadedQueryProvidedVariablesTest_badQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/usePreloadedQueryProvidedVariablesTest_badQuery.graphql.js index 5fc394858e624..329a6bdb9e565 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/usePreloadedQueryProvidedVariablesTest_badQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/usePreloadedQueryProvidedVariablesTest_badQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<270401a0ef815400ae3917618a084a1a>> + * @generated SignedSource<<9834004803718eb7f320a5979c51f90c>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type usePreloadedQueryProvidedVariablesTest_badQuery$data = {| |}, |}; export type usePreloadedQueryProvidedVariablesTest_badQuery = {| - variables: usePreloadedQueryProvidedVariablesTest_badQuery$variables, response: usePreloadedQueryProvidedVariablesTest_badQuery$data, + variables: usePreloadedQueryProvidedVariablesTest_badQuery$variables, |}; type ProvidedVariablesType = {| +__relay_internal__pv__RelayProvider_impure: {| diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/usePreloadedQueryReactDoubleEffectsTestDeferQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/usePreloadedQueryReactDoubleEffectsTestDeferQuery.graphql.js index 6535807b8c245..d94717b1d7e96 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/usePreloadedQueryReactDoubleEffectsTestDeferQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/usePreloadedQueryReactDoubleEffectsTestDeferQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<82340cbbba2ac952112d25883521b841>> + * @generated SignedSource<<982aa376c24e68ffe817346e25712d10>> * @flow * @lightSyntaxTransform * @nogrep @@ -28,8 +28,8 @@ export type usePreloadedQueryReactDoubleEffectsTestDeferQuery$data = {| |}, |}; export type usePreloadedQueryReactDoubleEffectsTestDeferQuery = {| - variables: usePreloadedQueryReactDoubleEffectsTestDeferQuery$variables, response: usePreloadedQueryReactDoubleEffectsTestDeferQuery$data, + variables: usePreloadedQueryReactDoubleEffectsTestDeferQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/usePreloadedQueryReactDoubleEffectsTestQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/usePreloadedQueryReactDoubleEffectsTestQuery.graphql.js index e4c7b3b13d148..4bac374a19efd 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/usePreloadedQueryReactDoubleEffectsTestQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/usePreloadedQueryReactDoubleEffectsTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -28,8 +28,8 @@ export type usePreloadedQueryReactDoubleEffectsTestQuery$data = {| |}, |}; export type usePreloadedQueryReactDoubleEffectsTestQuery = {| - variables: usePreloadedQueryReactDoubleEffectsTestQuery$variables, response: usePreloadedQueryReactDoubleEffectsTestQuery$data, + variables: usePreloadedQueryReactDoubleEffectsTestQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/usePreloadedQueryTestQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/usePreloadedQueryTestQuery.graphql.js index e499031a77514..b525dad9e5789 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/usePreloadedQueryTestQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/usePreloadedQueryTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<6da492c6731a9963d5a8bf1e1ac0f8e1>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type usePreloadedQueryTestQuery$data = {| |}, |}; export type usePreloadedQueryTestQuery = {| - variables: usePreloadedQueryTestQuery$variables, response: usePreloadedQueryTestQuery$data, + variables: usePreloadedQueryTestQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useQueryLoaderLiveQueryTestQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useQueryLoaderLiveQueryTestQuery.graphql.js index 75372ab58a272..a29911d6d3141 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useQueryLoaderLiveQueryTestQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useQueryLoaderLiveQueryTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<3f4ed65a788c7c0220c3067eb9805121>> + * @generated SignedSource<<833cefbc735dce8f949d195bb13c7999>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type useQueryLoaderLiveQueryTestQuery$data = {| |}, |}; export type useQueryLoaderLiveQueryTestQuery = {| - variables: useQueryLoaderLiveQueryTestQuery$variables, response: useQueryLoaderLiveQueryTestQuery$data, + variables: useQueryLoaderLiveQueryTestQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useQueryLoaderMultipleCallsTestQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useQueryLoaderMultipleCallsTestQuery.graphql.js index 1885f79261fd7..18f0622a87a11 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useQueryLoaderMultipleCallsTestQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useQueryLoaderMultipleCallsTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<4c2d200e3565951977538ce51bbee628>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type useQueryLoaderMultipleCallsTestQuery$data = {| |}, |}; export type useQueryLoaderMultipleCallsTestQuery = {| - variables: useQueryLoaderMultipleCallsTestQuery$variables, response: useQueryLoaderMultipleCallsTestQuery$data, + variables: useQueryLoaderMultipleCallsTestQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useQueryLoaderReactDoubleEffectsTestQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useQueryLoaderReactDoubleEffectsTestQuery.graphql.js index 32c709c0c4b57..2967db847d062 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useQueryLoaderReactDoubleEffectsTestQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useQueryLoaderReactDoubleEffectsTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<38bbeec6fdfdf3fc87c94f0c72424b4e>> * @flow * @lightSyntaxTransform * @nogrep @@ -28,8 +28,8 @@ export type useQueryLoaderReactDoubleEffectsTestQuery$data = {| |}, |}; export type useQueryLoaderReactDoubleEffectsTestQuery = {| - variables: useQueryLoaderReactDoubleEffectsTestQuery$variables, response: useQueryLoaderReactDoubleEffectsTestQuery$data, + variables: useQueryLoaderReactDoubleEffectsTestQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useQueryLoaderTestQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useQueryLoaderTestQuery.graphql.js index 68d5df4bee7b7..979f7a7edc774 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useQueryLoaderTestQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useQueryLoaderTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<926e046bd1b5049bfd90f81df3440e1a>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type useQueryLoaderTestQuery$data = {| |}, |}; export type useQueryLoaderTestQuery = {| - variables: useQueryLoaderTestQuery$variables, response: useQueryLoaderTestQuery$data, + variables: useQueryLoaderTestQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTest1Fragment.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTest1Fragment.graphql.js index 9b0f9ebb794dc..8b3c7a3d434c4 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTest1Fragment.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTest1Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<04408dc85d1c3ca84d8319fe3ee21a84>> + * @generated SignedSource<<885cedfc37aa745143f5cbe26f920c0f>> * @flow * @lightSyntaxTransform * @nogrep @@ -20,11 +20,11 @@ import type { FragmentType } from "relay-runtime"; declare export opaque type useRefetchableFragmentNodeTest1Fragment$fragmentType: FragmentType; type useRefetchableFragmentNodeTest1FragmentRefetchQuery$variables = any; export type useRefetchableFragmentNodeTest1Fragment$data = {| + +__token: string, +actor: ?{| +name: ?string, |}, +fetch_id: string, - +__token: string, +$fragmentType: useRefetchableFragmentNodeTest1Fragment$fragmentType, |}; export type useRefetchableFragmentNodeTest1Fragment$key = { diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTest1FragmentRefetchQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTest1FragmentRefetchQuery.graphql.js index f3caf6f3e60c3..c090274736d08 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTest1FragmentRefetchQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTest1FragmentRefetchQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<84b636e99bae32072d37339e8b5c8884>> + * @generated SignedSource<<777fa398ddf3ed2a7098e5d08e2534b5>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type useRefetchableFragmentNodeTest1FragmentRefetchQuery$data = {| |}, |}; export type useRefetchableFragmentNodeTest1FragmentRefetchQuery = {| - variables: useRefetchableFragmentNodeTest1FragmentRefetchQuery$variables, response: useRefetchableFragmentNodeTest1FragmentRefetchQuery$data, + variables: useRefetchableFragmentNodeTest1FragmentRefetchQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTest1Query.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTest1Query.graphql.js index d30f885813617..604919cc87930 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTest1Query.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTest1Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type useRefetchableFragmentNodeTest1Query$data = {| |}, |}; export type useRefetchableFragmentNodeTest1Query = {| - variables: useRefetchableFragmentNodeTest1Query$variables, response: useRefetchableFragmentNodeTest1Query$data, + variables: useRefetchableFragmentNodeTest1Query$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTest2Query.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTest2Query.graphql.js index 93130a3c5f096..c7045ba85848f 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTest2Query.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTest2Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<135fc83cbbd96265300c6c0ec5a80667>> + * @generated SignedSource<<8d4ddf6199a3c3a45c5d83337b7e4e75>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type useRefetchableFragmentNodeTest2Query$data = {| |}, |}; export type useRefetchableFragmentNodeTest2Query = {| - variables: useRefetchableFragmentNodeTest2Query$variables, response: useRefetchableFragmentNodeTest2Query$data, + variables: useRefetchableFragmentNodeTest2Query$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTest3FragmentRefetchQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTest3FragmentRefetchQuery.graphql.js index f67895879dd71..b289dcebdab3e 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTest3FragmentRefetchQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTest3FragmentRefetchQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<37f77d69b0586a7e7bf948e949d5e99c>> + * @generated SignedSource<<406b9c1975251c4b818ebc567dbd79ee>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,8 +19,8 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; type useRefetchableFragmentNodeTest3Fragment$fragmentType = any; export type useRefetchableFragmentNodeTest3FragmentRefetchQuery$variables = {| - scale?: ?number, id: string, + scale?: ?number, |}; export type useRefetchableFragmentNodeTest3FragmentRefetchQuery$data = {| +node: ?{| @@ -28,8 +28,8 @@ export type useRefetchableFragmentNodeTest3FragmentRefetchQuery$data = {| |}, |}; export type useRefetchableFragmentNodeTest3FragmentRefetchQuery = {| - variables: useRefetchableFragmentNodeTest3FragmentRefetchQuery$variables, response: useRefetchableFragmentNodeTest3FragmentRefetchQuery$data, + variables: useRefetchableFragmentNodeTest3FragmentRefetchQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTestUserFragmentRefetchQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTestUserFragmentRefetchQuery.graphql.js index f54cbcd934cf6..7f8436e68004b 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTestUserFragmentRefetchQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTestUserFragmentRefetchQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<9966390d90e3afb6dc25b2ca79fc24d6>> + * @generated SignedSource<<633855b8029b0dd62718400015b9de79>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,8 +19,8 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; type useRefetchableFragmentNodeTestUserFragment$fragmentType = any; export type useRefetchableFragmentNodeTestUserFragmentRefetchQuery$variables = {| - scale?: ?number, id: string, + scale?: ?number, |}; export type useRefetchableFragmentNodeTestUserFragmentRefetchQuery$data = {| +node: ?{| @@ -28,8 +28,8 @@ export type useRefetchableFragmentNodeTestUserFragmentRefetchQuery$data = {| |}, |}; export type useRefetchableFragmentNodeTestUserFragmentRefetchQuery = {| - variables: useRefetchableFragmentNodeTestUserFragmentRefetchQuery$variables, response: useRefetchableFragmentNodeTestUserFragmentRefetchQuery$data, + variables: useRefetchableFragmentNodeTestUserFragmentRefetchQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTestUserFragmentWithArgsRefetchQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTestUserFragmentWithArgsRefetchQuery.graphql.js index 017db99716228..07563a7006df9 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTestUserFragmentWithArgsRefetchQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTestUserFragmentWithArgsRefetchQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<8dacef87964d58434d17edd7bd8104af>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,8 +19,8 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; type useRefetchableFragmentNodeTestUserFragmentWithArgs$fragmentType = any; export type useRefetchableFragmentNodeTestUserFragmentWithArgsRefetchQuery$variables = {| - scaleLocal: number, id: string, + scaleLocal: number, |}; export type useRefetchableFragmentNodeTestUserFragmentWithArgsRefetchQuery$data = {| +node: ?{| @@ -28,8 +28,8 @@ export type useRefetchableFragmentNodeTestUserFragmentWithArgsRefetchQuery$data |}, |}; export type useRefetchableFragmentNodeTestUserFragmentWithArgsRefetchQuery = {| - variables: useRefetchableFragmentNodeTestUserFragmentWithArgsRefetchQuery$variables, response: useRefetchableFragmentNodeTestUserFragmentWithArgsRefetchQuery$data, + variables: useRefetchableFragmentNodeTestUserFragmentWithArgsRefetchQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTestUserQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTestUserQuery.graphql.js index d221f5a41f850..828beb1431810 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTestUserQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type useRefetchableFragmentNodeTestUserQuery$data = {| |}, |}; export type useRefetchableFragmentNodeTestUserQuery = {| - variables: useRefetchableFragmentNodeTestUserQuery$variables, response: useRefetchableFragmentNodeTestUserQuery$data, + variables: useRefetchableFragmentNodeTestUserQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTestUserQueryNestedFragmentQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTestUserQueryNestedFragmentQuery.graphql.js index ececf5b660f51..77fd85ff6843b 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTestUserQueryNestedFragmentQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTestUserQueryNestedFragmentQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<97034a7a3ac74484b480ac8a900e558d>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -29,8 +29,8 @@ export type useRefetchableFragmentNodeTestUserQueryNestedFragmentQuery$data = {| |}, |}; export type useRefetchableFragmentNodeTestUserQueryNestedFragmentQuery = {| - variables: useRefetchableFragmentNodeTestUserQueryNestedFragmentQuery$variables, response: useRefetchableFragmentNodeTestUserQueryNestedFragmentQuery$data, + variables: useRefetchableFragmentNodeTestUserQueryNestedFragmentQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTestUserQueryWithArgsQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTestUserQueryWithArgsQuery.graphql.js index 554a225bee9b2..c6bbd911170c2 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTestUserQueryWithArgsQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTestUserQueryWithArgsQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type useRefetchableFragmentNodeTestUserQueryWithArgsQuery$data = {| |}, |}; export type useRefetchableFragmentNodeTestUserQueryWithArgsQuery = {| - variables: useRefetchableFragmentNodeTestUserQueryWithArgsQuery$variables, response: useRefetchableFragmentNodeTestUserQueryWithArgsQuery$data, + variables: useRefetchableFragmentNodeTestUserQueryWithArgsQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTestUserQueryWithLiteralArgsQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTestUserQueryWithLiteralArgsQuery.graphql.js index 78ea2d76bf0a1..2d3c2e10cdf6f 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTestUserQueryWithLiteralArgsQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeTestUserQueryWithLiteralArgsQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<8393c69b3c9cc9343038e835bfa9a460>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type useRefetchableFragmentNodeTestUserQueryWithLiteralArgsQuery$data = { |}, |}; export type useRefetchableFragmentNodeTestUserQueryWithLiteralArgsQuery = {| - variables: useRefetchableFragmentNodeTestUserQueryWithLiteralArgsQuery$variables, response: useRefetchableFragmentNodeTestUserQueryWithLiteralArgsQuery$data, + variables: useRefetchableFragmentNodeTestUserQueryWithLiteralArgsQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeWithSuspenseTransitionTestUserFragmentRefetchQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeWithSuspenseTransitionTestUserFragmentRefetchQuery.graphql.js index c5a9d0d607e6e..26a7a514cab63 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeWithSuspenseTransitionTestUserFragmentRefetchQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeWithSuspenseTransitionTestUserFragmentRefetchQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,8 +19,8 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; type useRefetchableFragmentNodeWithSuspenseTransitionTestUserFragment$fragmentType = any; export type useRefetchableFragmentNodeWithSuspenseTransitionTestUserFragmentRefetchQuery$variables = {| - scale?: ?number, id: string, + scale?: ?number, |}; export type useRefetchableFragmentNodeWithSuspenseTransitionTestUserFragmentRefetchQuery$data = {| +node: ?{| @@ -28,8 +28,8 @@ export type useRefetchableFragmentNodeWithSuspenseTransitionTestUserFragmentRefe |}, |}; export type useRefetchableFragmentNodeWithSuspenseTransitionTestUserFragmentRefetchQuery = {| - variables: useRefetchableFragmentNodeWithSuspenseTransitionTestUserFragmentRefetchQuery$variables, response: useRefetchableFragmentNodeWithSuspenseTransitionTestUserFragmentRefetchQuery$data, + variables: useRefetchableFragmentNodeWithSuspenseTransitionTestUserFragmentRefetchQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeWithSuspenseTransitionTestUserQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeWithSuspenseTransitionTestUserQuery.graphql.js index ad60f969c340f..7c04ac6f31e46 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeWithSuspenseTransitionTestUserQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentNodeWithSuspenseTransitionTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<042ceae9cc76d97407cf91e6ce872530>> + * @generated SignedSource<<09c7362acfd63e27b5f08053786924d7>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type useRefetchableFragmentNodeWithSuspenseTransitionTestUserQuery$data = |}, |}; export type useRefetchableFragmentNodeWithSuspenseTransitionTestUserQuery = {| - variables: useRefetchableFragmentNodeWithSuspenseTransitionTestUserQuery$variables, response: useRefetchableFragmentNodeWithSuspenseTransitionTestUserQuery$data, + variables: useRefetchableFragmentNodeWithSuspenseTransitionTestUserQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentTestUserFragmentRefetchQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentTestUserFragmentRefetchQuery.graphql.js index 72d0503b44b0f..6426e17ca2b3b 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentTestUserFragmentRefetchQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentTestUserFragmentRefetchQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<01351d8392c9c8bab604401f4471d084>> + * @generated SignedSource<<1f77482303cc32a6c2f868309bcc633c>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,8 +19,8 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; type useRefetchableFragmentTestUserFragment$fragmentType = any; export type useRefetchableFragmentTestUserFragmentRefetchQuery$variables = {| - scale?: ?number, id: string, + scale?: ?number, |}; export type useRefetchableFragmentTestUserFragmentRefetchQuery$data = {| +node: ?{| @@ -28,8 +28,8 @@ export type useRefetchableFragmentTestUserFragmentRefetchQuery$data = {| |}, |}; export type useRefetchableFragmentTestUserFragmentRefetchQuery = {| - variables: useRefetchableFragmentTestUserFragmentRefetchQuery$variables, response: useRefetchableFragmentTestUserFragmentRefetchQuery$data, + variables: useRefetchableFragmentTestUserFragmentRefetchQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentTestUserQuery.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentTestUserQuery.graphql.js index c26ff6b98628b..620d7f9e03d7c 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentTestUserQuery.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useRefetchableFragmentTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<311b09ccb3ddb771984678967a833222>> + * @generated SignedSource<<2eb40068aca3833a408fa43df3f8c345>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type useRefetchableFragmentTestUserQuery$data = {| |}, |}; export type useRefetchableFragmentTestUserQuery = {| - variables: useRefetchableFragmentTestUserQuery$variables, response: useRefetchableFragmentTestUserQuery$data, + variables: useRefetchableFragmentTestUserQuery$variables, |}; */ diff --git a/packages/react-relay/relay-hooks/__tests__/__generated__/useSubscriptionTestCommentCreateSubscription.graphql.js b/packages/react-relay/relay-hooks/__tests__/__generated__/useSubscriptionTestCommentCreateSubscription.graphql.js index a0fed17aefbeb..ad9ed13746ff4 100644 --- a/packages/react-relay/relay-hooks/__tests__/__generated__/useSubscriptionTestCommentCreateSubscription.graphql.js +++ b/packages/react-relay/relay-hooks/__tests__/__generated__/useSubscriptionTestCommentCreateSubscription.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -28,17 +28,17 @@ export type useSubscriptionTestCommentCreateSubscription$data = {| +commentCreateSubscribe: ?{| +feedbackCommentEdge: ?{| +node: ?{| - +id: string, +body: ?{| +text: ?string, |}, + +id: string, |}, |}, |}, |}; export type useSubscriptionTestCommentCreateSubscription = {| - variables: useSubscriptionTestCommentCreateSubscription$variables, response: useSubscriptionTestCommentCreateSubscription$data, + variables: useSubscriptionTestCommentCreateSubscription$variables, |}; */ diff --git a/packages/relay-runtime/handlers/connection/__tests__/__generated__/ConnectionHandlerTestConnectionQuery.graphql.js b/packages/relay-runtime/handlers/connection/__tests__/__generated__/ConnectionHandlerTestConnectionQuery.graphql.js index 57c31a0b1153a..a35ea87757c16 100644 --- a/packages/relay-runtime/handlers/connection/__tests__/__generated__/ConnectionHandlerTestConnectionQuery.graphql.js +++ b/packages/relay-runtime/handlers/connection/__tests__/__generated__/ConnectionHandlerTestConnectionQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -17,10 +17,10 @@ /*:: import type { ConcreteRequest, Query } from 'relay-runtime'; export type ConnectionHandlerTestConnectionQuery$variables = {| - id: string, + after?: ?string, before?: ?string, count?: ?number, - after?: ?string, + id: string, orderby?: ?$ReadOnlyArray, |}; export type ConnectionHandlerTestConnectionQuery$data = {| @@ -43,8 +43,8 @@ export type ConnectionHandlerTestConnectionQuery$data = {| |}, |}; export type ConnectionHandlerTestConnectionQuery = {| - variables: ConnectionHandlerTestConnectionQuery$variables, response: ConnectionHandlerTestConnectionQuery$data, + variables: ConnectionHandlerTestConnectionQuery$variables, |}; */ diff --git a/packages/relay-runtime/multi-actor-environment/__tests__/__generated__/MultiActorEnvironmentExecuteMutationTestCommentFragment.graphql.js b/packages/relay-runtime/multi-actor-environment/__tests__/__generated__/MultiActorEnvironmentExecuteMutationTestCommentFragment.graphql.js index 4abecadeb08a2..42c44046e7616 100644 --- a/packages/relay-runtime/multi-actor-environment/__tests__/__generated__/MultiActorEnvironmentExecuteMutationTestCommentFragment.graphql.js +++ b/packages/relay-runtime/multi-actor-environment/__tests__/__generated__/MultiActorEnvironmentExecuteMutationTestCommentFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<0c6d31e6827b2d88bcf4bedd7897b612>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type MultiActorEnvironmentExecuteMutationTestCommentFragment$fragmentType: FragmentType; export type MultiActorEnvironmentExecuteMutationTestCommentFragment$data = {| - +id: string, +body: ?{| +text: ?string, |}, + +id: string, +$fragmentType: MultiActorEnvironmentExecuteMutationTestCommentFragment$fragmentType, |}; export type MultiActorEnvironmentExecuteMutationTestCommentFragment$key = { diff --git a/packages/relay-runtime/multi-actor-environment/__tests__/__generated__/MultiActorEnvironmentExecuteMutationTestCommentQuery.graphql.js b/packages/relay-runtime/multi-actor-environment/__tests__/__generated__/MultiActorEnvironmentExecuteMutationTestCommentQuery.graphql.js index 1d2a5c9d94dc2..270f537004ebf 100644 --- a/packages/relay-runtime/multi-actor-environment/__tests__/__generated__/MultiActorEnvironmentExecuteMutationTestCommentQuery.graphql.js +++ b/packages/relay-runtime/multi-actor-environment/__tests__/__generated__/MultiActorEnvironmentExecuteMutationTestCommentQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<69fe5c174c2f268642ad324880d2b580>> + * @generated SignedSource<<56ab1d13e10b08fc7986ad891663b696>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type MultiActorEnvironmentExecuteMutationTestCommentQuery$data = {| |}, |}; export type MultiActorEnvironmentExecuteMutationTestCommentQuery = {| - variables: MultiActorEnvironmentExecuteMutationTestCommentQuery$variables, response: MultiActorEnvironmentExecuteMutationTestCommentQuery$data, + variables: MultiActorEnvironmentExecuteMutationTestCommentQuery$variables, |}; */ diff --git a/packages/relay-runtime/multi-actor-environment/__tests__/__generated__/MultiActorEnvironmentExecuteMutationTestCreateCommentMutation.graphql.js b/packages/relay-runtime/multi-actor-environment/__tests__/__generated__/MultiActorEnvironmentExecuteMutationTestCreateCommentMutation.graphql.js index a49b887690020..3b326953e1342 100644 --- a/packages/relay-runtime/multi-actor-environment/__tests__/__generated__/MultiActorEnvironmentExecuteMutationTestCreateCommentMutation.graphql.js +++ b/packages/relay-runtime/multi-actor-environment/__tests__/__generated__/MultiActorEnvironmentExecuteMutationTestCreateCommentMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<15472543f5d84bb564dc6d663649045f>> + * @generated SignedSource<<73b4d54895271e075688622288caf89b>> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Mutation } from 'relay-runtime'; export type CommentCreateInput = {| clientMutationId?: ?string, - feedbackId?: ?string, feedback?: ?CommentfeedbackFeedback, + feedbackId?: ?string, |}; export type CommentfeedbackFeedback = {| comment?: ?FeedbackcommentComment, @@ -33,16 +33,16 @@ export type MultiActorEnvironmentExecuteMutationTestCreateCommentMutation$variab export type MultiActorEnvironmentExecuteMutationTestCreateCommentMutation$data = {| +commentCreate: ?{| +comment: ?{| - +id: string, +body: ?{| +text: ?string, |}, + +id: string, |}, |}, |}; export type MultiActorEnvironmentExecuteMutationTestCreateCommentMutation = {| - variables: MultiActorEnvironmentExecuteMutationTestCreateCommentMutation$variables, response: MultiActorEnvironmentExecuteMutationTestCreateCommentMutation$data, + variables: MultiActorEnvironmentExecuteMutationTestCreateCommentMutation$variables, |}; */ diff --git a/packages/relay-runtime/multi-actor-environment/__tests__/__generated__/MultiActorEnvironmentExecuteMutationTestCreateCommentWithSpreadMutation.graphql.js b/packages/relay-runtime/multi-actor-environment/__tests__/__generated__/MultiActorEnvironmentExecuteMutationTestCreateCommentWithSpreadMutation.graphql.js index bd55b1484a3d7..82b4e95712f02 100644 --- a/packages/relay-runtime/multi-actor-environment/__tests__/__generated__/MultiActorEnvironmentExecuteMutationTestCreateCommentWithSpreadMutation.graphql.js +++ b/packages/relay-runtime/multi-actor-environment/__tests__/__generated__/MultiActorEnvironmentExecuteMutationTestCreateCommentWithSpreadMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,8 +19,8 @@ import type { ConcreteRequest, Mutation } from 'relay-runtime'; type MultiActorEnvironmentExecuteMutationTestCommentFragment$fragmentType = any; export type CommentCreateInput = {| clientMutationId?: ?string, - feedbackId?: ?string, feedback?: ?CommentfeedbackFeedback, + feedbackId?: ?string, |}; export type CommentfeedbackFeedback = {| comment?: ?FeedbackcommentComment, @@ -39,8 +39,8 @@ export type MultiActorEnvironmentExecuteMutationTestCreateCommentWithSpreadMutat |}, |}; export type MultiActorEnvironmentExecuteMutationTestCreateCommentWithSpreadMutation = {| - variables: MultiActorEnvironmentExecuteMutationTestCreateCommentWithSpreadMutation$variables, response: MultiActorEnvironmentExecuteMutationTestCreateCommentWithSpreadMutation$data, + variables: MultiActorEnvironmentExecuteMutationTestCreateCommentWithSpreadMutation$variables, |}; */ diff --git a/packages/relay-runtime/multi-actor-environment/__tests__/__generated__/actorEnvironmentExecuteTestQuery.graphql.js b/packages/relay-runtime/multi-actor-environment/__tests__/__generated__/actorEnvironmentExecuteTestQuery.graphql.js index 3cda4f9bd6f34..e3b5e51a843ba 100644 --- a/packages/relay-runtime/multi-actor-environment/__tests__/__generated__/actorEnvironmentExecuteTestQuery.graphql.js +++ b/packages/relay-runtime/multi-actor-environment/__tests__/__generated__/actorEnvironmentExecuteTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<5983d2e100b9c534ea65fa42752604c4>> + * @generated SignedSource<<3b79df9396388ad9a6c76405bbe734b5>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type actorEnvironmentExecuteTestQuery$data = {| |}, |}; export type actorEnvironmentExecuteTestQuery = {| - variables: actorEnvironmentExecuteTestQuery$variables, response: actorEnvironmentExecuteTestQuery$data, + variables: actorEnvironmentExecuteTestQuery$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest1Fragment.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest1Fragment.graphql.js index 759f5832bbcc9..37073213ea0d2 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest1Fragment.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest1Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<09be9351a8c1b57ff490ce6bd92b5ff7>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type commitMutationTest1Fragment$fragmentType: FragmentType; export type commitMutationTest1Fragment$data = {| - +id: string, +body: ?{| +text: ?string, |}, + +id: string, +$fragmentType: commitMutationTest1Fragment$fragmentType, |}; export type commitMutationTest1Fragment$key = { diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest1Mutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest1Mutation.graphql.js index 7c444280f8fc2..e5b8ff7e73b9a 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest1Mutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest1Mutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<9529015bef5246632b3f831e4434a52d>> + * @generated SignedSource<<5abc17f1b608742297f625dcc89a3a6b>> * @flow * @lightSyntaxTransform * @nogrep @@ -35,8 +35,8 @@ export type commitMutationTest1Mutation$data = {| |}, |}; export type commitMutationTest1Mutation = {| - variables: commitMutationTest1Mutation$variables, response: commitMutationTest1Mutation$data, + variables: commitMutationTest1Mutation$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest1Query.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest1Query.graphql.js index 217cfdfb44e28..a7a4b5551f2af 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest1Query.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest1Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<76c4d211452d5829ffb8de9e224f0889>> * @flow * @lightSyntaxTransform * @nogrep @@ -30,8 +30,8 @@ export type commitMutationTest1Query$data = {| |}, |}; export type commitMutationTest1Query = {| - variables: commitMutationTest1Query$variables, response: commitMutationTest1Query$data, + variables: commitMutationTest1Query$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest2Fragment.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest2Fragment.graphql.js index 6a5a900ad1d85..be4099267453b 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest2Fragment.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest2Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<165580b8c1cc2192d58bb6689122ff76>> + * @generated SignedSource<<0725b25e56bdd40f29cedea9af0ced6e>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type commitMutationTest2Fragment$fragmentType: FragmentType; export type commitMutationTest2Fragment$data = {| - +id: string, +body: ?{| +text: ?string, |}, + +id: string, +$fragmentType: commitMutationTest2Fragment$fragmentType, |}; export type commitMutationTest2Fragment$key = { diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest2Mutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest2Mutation.graphql.js index b78bd4f2e1b0c..8546ca07b0b5a 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest2Mutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest2Mutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<929cd86c8e62d56532ee188ebaa55566>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -34,8 +34,8 @@ export type commitMutationTest2Mutation$data = {| |}, |}; export type commitMutationTest2Mutation = {| - variables: commitMutationTest2Mutation$variables, response: commitMutationTest2Mutation$data, + variables: commitMutationTest2Mutation$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest2Query.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest2Query.graphql.js index 1591eae5d27ab..feed03d2bdff6 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest2Query.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest2Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<1b17d2121b4192d39d8619e891b13a86>> + * @generated SignedSource<<1c69e624f7228dcb5e50d06bf721d431>> * @flow * @lightSyntaxTransform * @nogrep @@ -31,8 +31,8 @@ export type commitMutationTest2Query$data = {| |}, |}; export type commitMutationTest2Query = {| - variables: commitMutationTest2Query$variables, response: commitMutationTest2Query$data, + variables: commitMutationTest2Query$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest3Mutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest3Mutation.graphql.js index 8c3af16e18940..1a988623be7e8 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest3Mutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest3Mutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<446c7d4abfe5dfa2b5bb9d478deab3ab>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -34,8 +34,8 @@ export type commitMutationTest3Mutation$data = {| |}, |}; export type commitMutationTest3Mutation = {| - variables: commitMutationTest3Mutation$variables, response: commitMutationTest3Mutation$data, + variables: commitMutationTest3Mutation$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest3Query.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest3Query.graphql.js index 799c4d3025bc2..7001fbcdf43fc 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest3Query.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest3Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<9f4fb68f49a5c9e433eb5cf25decbbdd>> * @flow * @lightSyntaxTransform * @nogrep @@ -31,8 +31,8 @@ export type commitMutationTest3Query$data = {| |}, |}; export type commitMutationTest3Query = {| - variables: commitMutationTest3Query$variables, response: commitMutationTest3Query$data, + variables: commitMutationTest3Query$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest4Mutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest4Mutation.graphql.js index 3d7a7724ddb33..e6aea92fbc86e 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest4Mutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest4Mutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<04a258e523d648413dd93ebd5c4dfd36>> + * @generated SignedSource<<183a1672a1f62fd813c7d5bc5d03d32b>> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Mutation } from 'relay-runtime'; export type CommentCreateInput = {| clientMutationId?: ?string, - feedbackId?: ?string, feedback?: ?CommentfeedbackFeedback, + feedbackId?: ?string, |}; export type CommentfeedbackFeedback = {| comment?: ?FeedbackcommentComment, @@ -35,17 +35,17 @@ export type commitMutationTest4Mutation$data = {| +feedbackCommentEdge: ?{| +cursor: ?string, +node: ?{| - +id: string, +body: ?{| +text: ?string, |}, + +id: string, |}, |}, |}, |}; export type commitMutationTest4Mutation = {| - variables: commitMutationTest4Mutation$variables, response: commitMutationTest4Mutation$data, + variables: commitMutationTest4Mutation$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest4Query.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest4Query.graphql.js index 4b46fed23f4cc..0d81f16c500c4 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest4Query.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest4Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<100eac303d863aef24dedc354342de28>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -29,8 +29,8 @@ export type commitMutationTest4Query$data = {| |}, |}; export type commitMutationTest4Query = {| - variables: commitMutationTest4Query$variables, response: commitMutationTest4Query$data, + variables: commitMutationTest4Query$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest5Mutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest5Mutation.graphql.js index 24c508d0ed070..62f66fd7d494d 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest5Mutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest5Mutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<63057c47fad153bd7d6e3c86072844c2>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -35,8 +35,8 @@ export type commitMutationTest5Mutation$data = {| |}, |}; export type commitMutationTest5Mutation = {| - variables: commitMutationTest5Mutation$variables, response: commitMutationTest5Mutation$data, + variables: commitMutationTest5Mutation$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest5Query.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest5Query.graphql.js index 5d8f3d1ea0516..1b704eae26185 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest5Query.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest5Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<2b52c3824cce58b285d1cd07ae18a038>> + * @generated SignedSource<<1be14d516ef10bf420671c8b1b0a08e7>> * @flow * @lightSyntaxTransform * @nogrep @@ -30,8 +30,8 @@ export type commitMutationTest5Query$data = {| |}, |}; export type commitMutationTest5Query = {| - variables: commitMutationTest5Query$variables, response: commitMutationTest5Query$data, + variables: commitMutationTest5Query$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest6Mutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest6Mutation.graphql.js index 9a086f7d3e093..d176b7edef385 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest6Mutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest6Mutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Mutation } from 'relay-runtime'; export type CommentCreateInput = {| clientMutationId?: ?string, - feedbackId?: ?string, feedback?: ?CommentfeedbackFeedback, + feedbackId?: ?string, |}; export type CommentfeedbackFeedback = {| comment?: ?FeedbackcommentComment, @@ -33,16 +33,16 @@ export type commitMutationTest6Mutation$variables = {| export type commitMutationTest6Mutation$data = {| +commentCreate: ?{| +comment: ?{| - +id: string, +body: ?{| +text: ?string, |}, + +id: string, |}, |}, |}; export type commitMutationTest6Mutation = {| - variables: commitMutationTest6Mutation$variables, response: commitMutationTest6Mutation$data, + variables: commitMutationTest6Mutation$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest7Mutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest7Mutation.graphql.js index 0bab6a637ff49..c5c41abd06428 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest7Mutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTest7Mutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<6403b1d925f433da11adcedc505b73a1>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Mutation } from 'relay-runtime'; export type CommentCreateInput = {| clientMutationId?: ?string, - feedbackId?: ?string, feedback?: ?CommentfeedbackFeedback, + feedbackId?: ?string, |}; export type CommentfeedbackFeedback = {| comment?: ?FeedbackcommentComment, @@ -33,16 +33,16 @@ export type commitMutationTest7Mutation$variables = {| export type commitMutationTest7Mutation$data = {| +commentCreate: ?{| +comment: ?{| - +id: string, +body: ?{| +text: ?string, |}, + +id: string, |}, |}, |}; export type commitMutationTest7Mutation = {| - variables: commitMutationTest7Mutation$variables, response: commitMutationTest7Mutation$data, + variables: commitMutationTest7Mutation$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTestRequiredRootFieldMutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTestRequiredRootFieldMutation.graphql.js index 67b7cdca5ec9e..52934f1ccda99 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTestRequiredRootFieldMutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/commitMutationTestRequiredRootFieldMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<07d1e2e379df925d75ad8bfb4ffedd0e>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -29,8 +29,8 @@ export type commitMutationTestRequiredRootFieldMutation$data = {| |}, |}; export type commitMutationTestRequiredRootFieldMutation = {| - variables: commitMutationTestRequiredRootFieldMutation$variables, response: commitMutationTestRequiredRootFieldMutation$data, + variables: commitMutationTestRequiredRootFieldMutation$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/readUpdatableQueryEXPERIMENTALTest2UpdatableQuery.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/readUpdatableQueryEXPERIMENTALTest2UpdatableQuery.graphql.js index 090a412158713..e1fddac1f8da0 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/readUpdatableQueryEXPERIMENTALTest2UpdatableQuery.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/readUpdatableQueryEXPERIMENTALTest2UpdatableQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<1873eaa121a31ba18c5d12b3bd9d398b>> + * @generated SignedSource<<79462b649441341752e30df4df6cb6c8>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type readUpdatableQueryEXPERIMENTALTest2UpdatableQuery$data = {| set node(value: null | void): void, |}; export type readUpdatableQueryEXPERIMENTALTest2UpdatableQuery = {| - variables: readUpdatableQueryEXPERIMENTALTest2UpdatableQuery$variables, response: readUpdatableQueryEXPERIMENTALTest2UpdatableQuery$data, + variables: readUpdatableQueryEXPERIMENTALTest2UpdatableQuery$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/readUpdatableQueryEXPERIMENTALTestRegularQuery.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/readUpdatableQueryEXPERIMENTALTestRegularQuery.graphql.js index 1b70ca0e0678c..29e9c36d84b25 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/readUpdatableQueryEXPERIMENTALTestRegularQuery.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/readUpdatableQueryEXPERIMENTALTestRegularQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<0e5537bbc3cf22c6d825dc3928d1db6e>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -21,21 +21,21 @@ type readUpdatableQueryEXPERIMENTALTest_user$fragmentType = any; export type readUpdatableQueryEXPERIMENTALTestRegularQuery$variables = {||}; export type readUpdatableQueryEXPERIMENTALTestRegularQuery$data = {| +me: ?{| + +__id: string, +__isreadUpdatableQueryEXPERIMENTALTest_node?: string, - +id: string, - +name: ?string, +author: ?{| +client_best_friend: ?{| +name: ?string, |}, +client_nickname: ?string, |}, - +__id: string, + +id: string, + +name: ?string, +$fragmentSpreads: readUpdatableQueryEXPERIMENTALTest_node$fragmentType, |}, +node: ?{| - +__typename: string, +__id: string, + +__typename: string, +name?: ?string, +$fragmentSpreads: readUpdatableQueryEXPERIMENTALTest_user$fragmentType, |}, @@ -51,8 +51,8 @@ export type readUpdatableQueryEXPERIMENTALTestRegularQuery$data = {| |}, |}; export type readUpdatableQueryEXPERIMENTALTestRegularQuery = {| - variables: readUpdatableQueryEXPERIMENTALTestRegularQuery$variables, response: readUpdatableQueryEXPERIMENTALTestRegularQuery$data, + variables: readUpdatableQueryEXPERIMENTALTestRegularQuery$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/readUpdatableQueryEXPERIMENTALTestUpdatableQuery.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/readUpdatableQueryEXPERIMENTALTestUpdatableQuery.graphql.js index 15e33f8df2a31..8ea18562e3a9d 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/readUpdatableQueryEXPERIMENTALTestUpdatableQuery.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/readUpdatableQueryEXPERIMENTALTestUpdatableQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<330a97e51894f037540b684562ef2ad4>> + * @generated SignedSource<<8f3c23c7c6cd4b36b594dcc2d1c741ea>> * @flow * @lightSyntaxTransform * @nogrep @@ -21,8 +21,8 @@ type readUpdatableQueryEXPERIMENTALTest_user$fragmentType = any; export type readUpdatableQueryEXPERIMENTALTestUpdatableQuery$variables = {||}; export type readUpdatableQueryEXPERIMENTALTestUpdatableQuery$data = {| get me(): ?{| - +__typename: string, +__id: string, + +__typename: string, +id: string, name: ?string, get author(): ?{| @@ -30,9 +30,9 @@ export type readUpdatableQueryEXPERIMENTALTestUpdatableQuery$data = {| name: ?string, |}, set client_best_friend(value: ?{ - +$fragmentSpreads: readUpdatableQueryEXPERIMENTALTest_user$fragmentType, - +__typename: "User", +__id: string, + +__typename: "User", + +$fragmentSpreads: readUpdatableQueryEXPERIMENTALTest_user$fragmentType, ... }): void, |}, @@ -43,9 +43,9 @@ export type readUpdatableQueryEXPERIMENTALTestUpdatableQuery$data = {| set author2(value: null | void): void, |}, set me(value: ?{ - +$fragmentSpreads: readUpdatableQueryEXPERIMENTALTest_user$fragmentType, - +__typename: "User", +__id: string, + +__typename: "User", + +$fragmentSpreads: readUpdatableQueryEXPERIMENTALTest_user$fragmentType, ... }): void, get node(): ?({| @@ -68,9 +68,9 @@ export type readUpdatableQueryEXPERIMENTALTestUpdatableQuery$data = {| set parents(value: []): void, |}>, set parents(value: $ReadOnlyArray<{ - +$fragmentSpreads: readUpdatableQueryEXPERIMENTALTest_user$fragmentType, - +__typename: "User", +__id: string, + +__typename: "User", + +$fragmentSpreads: readUpdatableQueryEXPERIMENTALTest_user$fragmentType, ... }>): void, |} | {| @@ -83,15 +83,15 @@ export type readUpdatableQueryEXPERIMENTALTestUpdatableQuery$data = {| +id: string, |}, set node3(value: ?{ - +$fragmentSpreads: readUpdatableQueryEXPERIMENTALTest_node$fragmentType, - +__isreadUpdatableQueryEXPERIMENTALTest_node: string, +__id: string, + +__isreadUpdatableQueryEXPERIMENTALTest_node: string, + +$fragmentSpreads: readUpdatableQueryEXPERIMENTALTest_node$fragmentType, ... }): void, |}; export type readUpdatableQueryEXPERIMENTALTestUpdatableQuery = {| - variables: readUpdatableQueryEXPERIMENTALTestUpdatableQuery$variables, response: readUpdatableQueryEXPERIMENTALTestUpdatableQuery$data, + variables: readUpdatableQueryEXPERIMENTALTestUpdatableQuery$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/readUpdatableQueryEXPERIMENTALTest_node.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/readUpdatableQueryEXPERIMENTALTest_node.graphql.js index 14d0eb55bab81..565cf684411ec 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/readUpdatableQueryEXPERIMENTALTest_node.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/readUpdatableQueryEXPERIMENTALTest_node.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<51bf44b1d8d28dd4277dd4f2082a2acf>> + * @generated SignedSource<<7acb9c2f8f26b6b97afa135a82d3ebb8>> * @flow * @lightSyntaxTransform * @nogrep @@ -21,14 +21,14 @@ declare export opaque type readUpdatableQueryEXPERIMENTALTest_node$fragmentType: module.exports.validate = function validate(value/*: { +__id: string, - +$fragmentSpreads: readUpdatableQueryEXPERIMENTALTest_node$fragmentType, +__isreadUpdatableQueryEXPERIMENTALTest_node?: string, + +$fragmentSpreads: readUpdatableQueryEXPERIMENTALTest_node$fragmentType, ... -}*/)/*: { +}*/)/*: ({ +__id: string, - +$fragmentSpreads: readUpdatableQueryEXPERIMENTALTest_node$fragmentType, +__isreadUpdatableQueryEXPERIMENTALTest_node: string, + +$fragmentSpreads: readUpdatableQueryEXPERIMENTALTest_node$fragmentType, ... -} | false*/ { +} | false)*/ { return value.__isreadUpdatableQueryEXPERIMENTALTest_node != null ? (value/*: any*/) : false; }; diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/readUpdatableQueryEXPERIMENTALTest_user.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/readUpdatableQueryEXPERIMENTALTest_user.graphql.js index 6d6c3cddb5c84..a40f4fcc11a21 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/readUpdatableQueryEXPERIMENTALTest_user.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/readUpdatableQueryEXPERIMENTALTest_user.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<54f390e1f91118956687eaccbfd8378a>> * @flow * @lightSyntaxTransform * @nogrep @@ -21,14 +21,14 @@ declare export opaque type readUpdatableQueryEXPERIMENTALTest_user$fragmentType: module.exports.validate = function validate(value/*: { +__id: string, - +$fragmentSpreads: readUpdatableQueryEXPERIMENTALTest_user$fragmentType, +__typename: string, + +$fragmentSpreads: readUpdatableQueryEXPERIMENTALTest_user$fragmentType, ... -}*/)/*: { +}*/)/*: ({ +__id: string, - +$fragmentSpreads: readUpdatableQueryEXPERIMENTALTest_user$fragmentType, +__typename: "User", + +$fragmentSpreads: readUpdatableQueryEXPERIMENTALTest_user$fragmentType, ... -} | false*/ { +} | false)*/ { return value.__typename === 'User' ? (value/*: any*/) : false; }; diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest10ChangeNameIncludeBoolMutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest10ChangeNameIncludeBoolMutation.graphql.js index 60be3189c2da0..4ece2bb4dc41c 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest10ChangeNameIncludeBoolMutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest10ChangeNameIncludeBoolMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<729633ec2f62dc68213dc4f08477f558>> + * @generated SignedSource<<8f31a1c95c83dacf6c55ec8774a3572e>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,14 +27,14 @@ export type validateMutationTest10ChangeNameIncludeBoolMutation$variables = {| export type validateMutationTest10ChangeNameIncludeBoolMutation$data = {| +actorNameChange: ?{| +actor: ?{| - +username?: ?string, +canViewerLike?: ?boolean, + +username?: ?string, |}, |}, |}; export type validateMutationTest10ChangeNameIncludeBoolMutation = {| - variables: validateMutationTest10ChangeNameIncludeBoolMutation$variables, response: validateMutationTest10ChangeNameIncludeBoolMutation$data, + variables: validateMutationTest10ChangeNameIncludeBoolMutation$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest11ChangeNamePhonesMutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest11ChangeNamePhonesMutation.graphql.js index 9f4fad4cd4915..470aeaece2205 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest11ChangeNamePhonesMutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest11ChangeNamePhonesMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<9cd2f7972e47cc5610d794f17e8cb145>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -33,8 +33,8 @@ export type validateMutationTest11ChangeNamePhonesMutation$data = {| |}, |}; export type validateMutationTest11ChangeNamePhonesMutation = {| - variables: validateMutationTest11ChangeNamePhonesMutation$variables, response: validateMutationTest11ChangeNamePhonesMutation$data, + variables: validateMutationTest11ChangeNamePhonesMutation$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest12ChangeNamePhonesMutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest12ChangeNamePhonesMutation.graphql.js index 632ebec096262..6136cc728e18e 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest12ChangeNamePhonesMutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest12ChangeNamePhonesMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<41cef774645c135cf454cd8d971d24bd>> + * @generated SignedSource<<43e389952b5c0c01bcddf850a92be058>> * @flow * @lightSyntaxTransform * @nogrep @@ -33,8 +33,8 @@ export type validateMutationTest12ChangeNamePhonesMutation$data = {| |}, |}; export type validateMutationTest12ChangeNamePhonesMutation = {| - variables: validateMutationTest12ChangeNamePhonesMutation$variables, response: validateMutationTest12ChangeNamePhonesMutation$data, + variables: validateMutationTest12ChangeNamePhonesMutation$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest13ChangeNamePhonesMutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest13ChangeNamePhonesMutation.graphql.js index c5959c09a6584..0abd3ae7184bf 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest13ChangeNamePhonesMutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest13ChangeNamePhonesMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<63e94700b19bad368fb2e2455e076654>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -33,8 +33,8 @@ export type validateMutationTest13ChangeNamePhonesMutation$data = {| |}, |}; export type validateMutationTest13ChangeNamePhonesMutation = {| - variables: validateMutationTest13ChangeNamePhonesMutation$variables, response: validateMutationTest13ChangeNamePhonesMutation$data, + variables: validateMutationTest13ChangeNamePhonesMutation$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest14ChangeNamePhonesMutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest14ChangeNamePhonesMutation.graphql.js index 80b10978cba41..7cb5b8de0ae49 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest14ChangeNamePhonesMutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest14ChangeNamePhonesMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<2613b4b192436ba5dc0056dcd8b357f5>> * @flow * @lightSyntaxTransform * @nogrep @@ -33,8 +33,8 @@ export type validateMutationTest14ChangeNamePhonesMutation$data = {| |}, |}; export type validateMutationTest14ChangeNamePhonesMutation = {| - variables: validateMutationTest14ChangeNamePhonesMutation$variables, response: validateMutationTest14ChangeNamePhonesMutation$data, + variables: validateMutationTest14ChangeNamePhonesMutation$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest15ChangeNameWebsitesMutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest15ChangeNameWebsitesMutation.graphql.js index 893c8d82a5c0e..95d8edbdf0a17 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest15ChangeNameWebsitesMutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest15ChangeNameWebsitesMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<4fa1ca7a1ab2bef5998ba7723b959e0a>> * @flow * @lightSyntaxTransform * @nogrep @@ -31,8 +31,8 @@ export type validateMutationTest15ChangeNameWebsitesMutation$data = {| |}, |}; export type validateMutationTest15ChangeNameWebsitesMutation = {| - variables: validateMutationTest15ChangeNameWebsitesMutation$variables, response: validateMutationTest15ChangeNameWebsitesMutation$data, + variables: validateMutationTest15ChangeNameWebsitesMutation$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest16ChangeNameWebsitesMutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest16ChangeNameWebsitesMutation.graphql.js index 58e05f977decc..469a8780b6523 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest16ChangeNameWebsitesMutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest16ChangeNameWebsitesMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<733a91605423d11792b57f84ce060810>> + * @generated SignedSource<<1338667a699ba933e998e674b0c49631>> * @flow * @lightSyntaxTransform * @nogrep @@ -31,8 +31,8 @@ export type validateMutationTest16ChangeNameWebsitesMutation$data = {| |}, |}; export type validateMutationTest16ChangeNameWebsitesMutation = {| - variables: validateMutationTest16ChangeNameWebsitesMutation$variables, response: validateMutationTest16ChangeNameWebsitesMutation$data, + variables: validateMutationTest16ChangeNameWebsitesMutation$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest17ChangeNameMutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest17ChangeNameMutation.graphql.js index 309a89528c502..da36b86864e27 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest17ChangeNameMutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest17ChangeNameMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<903968499019ec5a2d1f183f0621fab5>> + * @generated SignedSource<<857b3d1d467f79edde320479c3cf0d8f>> * @flow * @lightSyntaxTransform * @nogrep @@ -31,8 +31,8 @@ export type validateMutationTest17ChangeNameMutation$data = {| |}, |}; export type validateMutationTest17ChangeNameMutation = {| - variables: validateMutationTest17ChangeNameMutation$variables, response: validateMutationTest17ChangeNameMutation$data, + variables: validateMutationTest17ChangeNameMutation$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest18ChangeNameMutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest18ChangeNameMutation.graphql.js index 9443fdc0095a6..474f85241d0f1 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest18ChangeNameMutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest18ChangeNameMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<077544714cbdfa6eac240ae0a7188043>> + * @generated SignedSource<<74665b635882e3c67dcf9eebd31dd208>> * @flow * @lightSyntaxTransform * @nogrep @@ -31,8 +31,8 @@ export type validateMutationTest18ChangeNameMutation$data = {| |}, |}; export type validateMutationTest18ChangeNameMutation = {| - variables: validateMutationTest18ChangeNameMutation$variables, response: validateMutationTest18ChangeNameMutation$data, + variables: validateMutationTest18ChangeNameMutation$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest19FeedbackLikeMutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest19FeedbackLikeMutation.graphql.js index 0c1df87cc99c4..31366ff28e78f 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest19FeedbackLikeMutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest19FeedbackLikeMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<70b9c2bd52135103370e358df1319415>> * @flow * @lightSyntaxTransform * @nogrep @@ -32,8 +32,8 @@ export type validateMutationTest19FeedbackLikeMutation$data = {| |}, |}; export type validateMutationTest19FeedbackLikeMutation = {| - variables: validateMutationTest19FeedbackLikeMutation$variables, response: validateMutationTest19FeedbackLikeMutation$data, + variables: validateMutationTest19FeedbackLikeMutation$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest1ChangeNameMutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest1ChangeNameMutation.graphql.js index bba21df502988..2729e56e9624c 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest1ChangeNameMutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest1ChangeNameMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<0cbe8527c25ce192e437efccf143b1a3>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -31,8 +31,8 @@ export type validateMutationTest1ChangeNameMutation$data = {| |}, |}; export type validateMutationTest1ChangeNameMutation = {| - variables: validateMutationTest1ChangeNameMutation$variables, response: validateMutationTest1ChangeNameMutation$data, + variables: validateMutationTest1ChangeNameMutation$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest20FeedbackLikeMutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest20FeedbackLikeMutation.graphql.js index fe4128bfa85c7..4f9dd1e555788 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest20FeedbackLikeMutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest20FeedbackLikeMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<8903453a9386df8a19f4718d225b7b65>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -32,8 +32,8 @@ export type validateMutationTest20FeedbackLikeMutation$data = {| |}, |}; export type validateMutationTest20FeedbackLikeMutation = {| - variables: validateMutationTest20FeedbackLikeMutation$variables, response: validateMutationTest20FeedbackLikeMutation$data, + variables: validateMutationTest20FeedbackLikeMutation$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest21FeedbackLikeGroovyMutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest21FeedbackLikeGroovyMutation.graphql.js index e698675085f23..4c3ef97ad0ad9 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest21FeedbackLikeGroovyMutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest21FeedbackLikeGroovyMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<0a0ad05cab7a7a6f6201d7da293fda3c>> + * @generated SignedSource<<863fa8fac9e49a075f11474b5fdab17d>> * @flow * @lightSyntaxTransform * @nogrep @@ -36,8 +36,8 @@ export type validateMutationTest21FeedbackLikeGroovyMutation$data = {| |}, |}; export type validateMutationTest21FeedbackLikeGroovyMutation = {| - variables: validateMutationTest21FeedbackLikeGroovyMutation$variables, response: validateMutationTest21FeedbackLikeGroovyMutation$data, + variables: validateMutationTest21FeedbackLikeGroovyMutation$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest2ChangeNameMutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest2ChangeNameMutation.graphql.js index 7f0d536585a0a..04d74af934ac0 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest2ChangeNameMutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest2ChangeNameMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<5b43e564b4ea599a9cfadea456dd007b>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -31,8 +31,8 @@ export type validateMutationTest2ChangeNameMutation$data = {| |}, |}; export type validateMutationTest2ChangeNameMutation = {| - variables: validateMutationTest2ChangeNameMutation$variables, response: validateMutationTest2ChangeNameMutation$data, + variables: validateMutationTest2ChangeNameMutation$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest3ChangeNameMutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest3ChangeNameMutation.graphql.js index 7eb15a4a1b043..e437cbacabdeb 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest3ChangeNameMutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest3ChangeNameMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -31,8 +31,8 @@ export type validateMutationTest3ChangeNameMutation$data = {| |}, |}; export type validateMutationTest3ChangeNameMutation = {| - variables: validateMutationTest3ChangeNameMutation$variables, response: validateMutationTest3ChangeNameMutation$data, + variables: validateMutationTest3ChangeNameMutation$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest4ChangeNameMutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest4ChangeNameMutation.graphql.js index bb8e540df4579..5e6076f9dbea2 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest4ChangeNameMutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest4ChangeNameMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<3ff36b4ce6399997bc5acc36b68dd95f>> * @flow * @lightSyntaxTransform * @nogrep @@ -31,8 +31,8 @@ export type validateMutationTest4ChangeNameMutation$data = {| |}, |}; export type validateMutationTest4ChangeNameMutation = {| - variables: validateMutationTest4ChangeNameMutation$variables, response: validateMutationTest4ChangeNameMutation$data, + variables: validateMutationTest4ChangeNameMutation$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest5ChangeNameBirthdayMutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest5ChangeNameBirthdayMutation.graphql.js index 6baf85de18a81..1b970a4a99030 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest5ChangeNameBirthdayMutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest5ChangeNameBirthdayMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<315b5b66bf32fed01c9548a618a14b82>> + * @generated SignedSource<<42df826f19a3f6053394a71718b62c43>> * @flow * @lightSyntaxTransform * @nogrep @@ -36,8 +36,8 @@ export type validateMutationTest5ChangeNameBirthdayMutation$data = {| |}, |}; export type validateMutationTest5ChangeNameBirthdayMutation = {| - variables: validateMutationTest5ChangeNameBirthdayMutation$variables, response: validateMutationTest5ChangeNameBirthdayMutation$data, + variables: validateMutationTest5ChangeNameBirthdayMutation$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest6ChangeNameBirthdayMutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest6ChangeNameBirthdayMutation.graphql.js index df2f36ca257b2..b0824a45256d3 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest6ChangeNameBirthdayMutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest6ChangeNameBirthdayMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<293fb260ec47c0d7da3d0254e7da34c7>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -36,8 +36,8 @@ export type validateMutationTest6ChangeNameBirthdayMutation$data = {| |}, |}; export type validateMutationTest6ChangeNameBirthdayMutation = {| - variables: validateMutationTest6ChangeNameBirthdayMutation$variables, response: validateMutationTest6ChangeNameBirthdayMutation$data, + variables: validateMutationTest6ChangeNameBirthdayMutation$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest7ChangeNameBirthdayMutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest7ChangeNameBirthdayMutation.graphql.js index 874fb440b1d62..353cb690495c8 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest7ChangeNameBirthdayMutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest7ChangeNameBirthdayMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<9be201ab74a88ae5fdd9eb6169e98025>> + * @generated SignedSource<<472881b23b6fb61fed2e5fffda587bc9>> * @flow * @lightSyntaxTransform * @nogrep @@ -36,8 +36,8 @@ export type validateMutationTest7ChangeNameBirthdayMutation$data = {| |}, |}; export type validateMutationTest7ChangeNameBirthdayMutation = {| - variables: validateMutationTest7ChangeNameBirthdayMutation$variables, response: validateMutationTest7ChangeNameBirthdayMutation$data, + variables: validateMutationTest7ChangeNameBirthdayMutation$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest8ChangeNameBirthdayWithNameMutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest8ChangeNameBirthdayWithNameMutation.graphql.js index 87ac4e576a446..e7b75bbd38cf2 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest8ChangeNameBirthdayWithNameMutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest8ChangeNameBirthdayWithNameMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<948a8967fd14cb3546cc3ff450129753>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,19 +26,19 @@ export type validateMutationTest8ChangeNameBirthdayWithNameMutation$variables = export type validateMutationTest8ChangeNameBirthdayWithNameMutation$data = {| +actorNameChange: ?{| +actor: ?{| - +name: ?string, +birthdate?: ?{| +day: ?number, +month: ?number, +year: ?number, |}, + +name: ?string, +username?: ?string, |}, |}, |}; export type validateMutationTest8ChangeNameBirthdayWithNameMutation = {| - variables: validateMutationTest8ChangeNameBirthdayWithNameMutation$variables, response: validateMutationTest8ChangeNameBirthdayWithNameMutation$data, + variables: validateMutationTest8ChangeNameBirthdayWithNameMutation$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest9ChangeNameIncludeMutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest9ChangeNameIncludeMutation.graphql.js index 548a35a2080d4..5dc273533ffe8 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest9ChangeNameIncludeMutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTest9ChangeNameIncludeMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<475201d1b7088506bf69373b6e4734d7>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -27,14 +27,14 @@ export type validateMutationTest9ChangeNameIncludeMutation$variables = {| export type validateMutationTest9ChangeNameIncludeMutation$data = {| +actorNameChange: ?{| +actor: ?{| - +username?: ?string, +canViewerLike?: ?boolean, + +username?: ?string, |}, |}, |}; export type validateMutationTest9ChangeNameIncludeMutation = {| - variables: validateMutationTest9ChangeNameIncludeMutation$variables, response: validateMutationTest9ChangeNameIncludeMutation$data, + variables: validateMutationTest9ChangeNameIncludeMutation$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTestFlightMutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTestFlightMutation.graphql.js index 11c78dd0b8e98..46b18bd80d6c8 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTestFlightMutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTestFlightMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,31 +19,31 @@ /*:: import type { ConcreteRequest, Mutation } from 'relay-runtime'; export type StoryUpdateInput = {| - clientMutationId?: ?string, body?: ?InputText, + clientMutationId?: ?string, |}; export type InputText = {| - text?: ?string, ranges?: ?$ReadOnlyArray, + text?: ?string, |}; export type validateMutationTestFlightMutation$variables = {| - input: StoryUpdateInput, count: number, + input: StoryUpdateInput, |}; export type validateMutationTestFlightMutation$data = {| +storyUpdate: ?{| +story: ?{| - +id: string, +body: ?{| +text: ?string, |}, +flightComponentValidateMutation: ?any, + +id: string, |}, |}, |}; export type validateMutationTestFlightMutation = {| - variables: validateMutationTestFlightMutation$variables, response: validateMutationTestFlightMutation$data, + variables: validateMutationTestFlightMutation$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTestIsActorInlineMutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTestIsActorInlineMutation.graphql.js index 9929aca205d1d..d725567fa7d99 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTestIsActorInlineMutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTestIsActorInlineMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -38,30 +38,30 @@ export type validateMutationTestIsActorInlineMutation$data = {| export type validateMutationTestIsActorInlineMutation$rawResponse = {| +actorNameChange: ?{| +actor: ?({| - +__typename: "User", +__isActor: "User", - +id: string, + +__typename: "User", +birthdate: ?{| +day: ?number, +month: ?number, +year: ?number, |}, + +id: string, |} | {| - +__typename: "Page", +__isActor: "Page", + +__typename: "Page", +id: string, +username: ?string, |} | {| - +__typename: string, +__isActor: string, + +__typename: string, +id: string, |}), |}, |}; export type validateMutationTestIsActorInlineMutation = {| - variables: validateMutationTestIsActorInlineMutation$variables, - response: validateMutationTestIsActorInlineMutation$data, rawResponse: validateMutationTestIsActorInlineMutation$rawResponse, + response: validateMutationTestIsActorInlineMutation$data, + variables: validateMutationTestIsActorInlineMutation$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTestIsActorMutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTestIsActorMutation.graphql.js index 3b1a44a2b17c2..20b7dfd3da555 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTestIsActorMutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTestIsActorMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<8dd2ab912a34bdcf601416a071497e0f>> * @flow * @lightSyntaxTransform * @nogrep @@ -34,30 +34,30 @@ export type validateMutationTestIsActorMutation$data = {| export type validateMutationTestIsActorMutation$rawResponse = {| +actorNameChange: ?{| +actor: ?({| - +__typename: "User", +__isActor: "User", - +id: string, + +__typename: "User", +birthdate: ?{| +day: ?number, +month: ?number, +year: ?number, |}, + +id: string, |} | {| - +__typename: "Page", +__isActor: "Page", + +__typename: "Page", +id: string, +username: ?string, |} | {| - +__typename: string, +__isActor: string, + +__typename: string, +id: string, |}), |}, |}; export type validateMutationTestIsActorMutation = {| - variables: validateMutationTestIsActorMutation$variables, - response: validateMutationTestIsActorMutation$data, rawResponse: validateMutationTestIsActorMutation$rawResponse, + response: validateMutationTestIsActorMutation$data, + variables: validateMutationTestIsActorMutation$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTestIsEntityInlineFragmentMutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTestIsEntityInlineFragmentMutation.graphql.js index 64260cf11b92d..3e89daa689048 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTestIsEntityInlineFragmentMutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTestIsEntityInlineFragmentMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<688296572cad8a83ebf177a834b6b578>> + * @generated SignedSource<<603b57faa7b74182f351ccb7aeef4a77>> * @flow * @lightSyntaxTransform * @nogrep @@ -33,17 +33,17 @@ export type validateMutationTestIsEntityInlineFragmentMutation$data = {| export type validateMutationTestIsEntityInlineFragmentMutation$rawResponse = {| +actorNameChange: ?{| +actor: ?{| - +__typename: string, +__isEntity: string, - +url: ?string, + +__typename: string, +id: string, + +url: ?string, |}, |}, |}; export type validateMutationTestIsEntityInlineFragmentMutation = {| - variables: validateMutationTestIsEntityInlineFragmentMutation$variables, - response: validateMutationTestIsEntityInlineFragmentMutation$data, rawResponse: validateMutationTestIsEntityInlineFragmentMutation$rawResponse, + response: validateMutationTestIsEntityInlineFragmentMutation$data, + variables: validateMutationTestIsEntityInlineFragmentMutation$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTestIsEntitySpreadFragmentMutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTestIsEntitySpreadFragmentMutation.graphql.js index fcdc350151456..b20f66c704bfe 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTestIsEntitySpreadFragmentMutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTestIsEntitySpreadFragmentMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -34,17 +34,17 @@ export type validateMutationTestIsEntitySpreadFragmentMutation$data = {| export type validateMutationTestIsEntitySpreadFragmentMutation$rawResponse = {| +actorNameChange: ?{| +actor: ?{| - +__typename: string, +__isEntity: string, - +url: ?string, + +__typename: string, +id: string, + +url: ?string, |}, |}, |}; export type validateMutationTestIsEntitySpreadFragmentMutation = {| - variables: validateMutationTestIsEntitySpreadFragmentMutation$variables, - response: validateMutationTestIsEntitySpreadFragmentMutation$data, rawResponse: validateMutationTestIsEntitySpreadFragmentMutation$rawResponse, + response: validateMutationTestIsEntitySpreadFragmentMutation$data, + variables: validateMutationTestIsEntitySpreadFragmentMutation$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTestIsNodeInlineFragmentMutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTestIsNodeInlineFragmentMutation.graphql.js index a52db6635dc5a..3042f0f342f80 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTestIsNodeInlineFragmentMutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTestIsNodeInlineFragmentMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<4716bc4f4026e03999605861796f9815>> + * @generated SignedSource<<2685f46f9a59a59e5466379cdfc016c0>> * @flow * @lightSyntaxTransform * @nogrep @@ -34,15 +34,15 @@ export type validateMutationTestIsNodeInlineFragmentMutation$rawResponse = {| +feedbackLike: ?{| +feedback: ?{| +__isNode: "Feedback", - +name: ?string, +id: string, + +name: ?string, |}, |}, |}; export type validateMutationTestIsNodeInlineFragmentMutation = {| - variables: validateMutationTestIsNodeInlineFragmentMutation$variables, - response: validateMutationTestIsNodeInlineFragmentMutation$data, rawResponse: validateMutationTestIsNodeInlineFragmentMutation$rawResponse, + response: validateMutationTestIsNodeInlineFragmentMutation$data, + variables: validateMutationTestIsNodeInlineFragmentMutation$variables, |}; */ diff --git a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTestIsNodeSpreadMutation.graphql.js b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTestIsNodeSpreadMutation.graphql.js index c5a3a27e2e845..974f6102267ee 100644 --- a/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTestIsNodeSpreadMutation.graphql.js +++ b/packages/relay-runtime/mutations/__tests__/__generated__/validateMutationTestIsNodeSpreadMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<6e2d010c78fadd5a7958da0515e20b9b>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -35,15 +35,15 @@ export type validateMutationTestIsNodeSpreadMutation$rawResponse = {| +feedbackLike: ?{| +feedback: ?{| +__isNode: "Feedback", - +name: ?string, +id: string, + +name: ?string, |}, |}, |}; export type validateMutationTestIsNodeSpreadMutation = {| - variables: validateMutationTestIsNodeSpreadMutation$variables, - response: validateMutationTestIsNodeSpreadMutation$data, rawResponse: validateMutationTestIsNodeSpreadMutation$rawResponse, + response: validateMutationTestIsNodeSpreadMutation$data, + variables: validateMutationTestIsNodeSpreadMutation$variables, |}; */ diff --git a/packages/relay-runtime/query/__tests__/__generated__/GraphQLTagTest1Query.graphql.js b/packages/relay-runtime/query/__tests__/__generated__/GraphQLTagTest1Query.graphql.js index 1e46d9d5141ae..7c9dc221d6ff0 100644 --- a/packages/relay-runtime/query/__tests__/__generated__/GraphQLTagTest1Query.graphql.js +++ b/packages/relay-runtime/query/__tests__/__generated__/GraphQLTagTest1Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<58bcabb8b8355f721232b53790308cb7>> * @flow * @lightSyntaxTransform * @nogrep @@ -23,8 +23,8 @@ export type GraphQLTagTest1Query$data = {| |}, |}; export type GraphQLTagTest1Query = {| - variables: GraphQLTagTest1Query$variables, response: GraphQLTagTest1Query$data, + variables: GraphQLTagTest1Query$variables, |}; */ diff --git a/packages/relay-runtime/query/__tests__/__generated__/GraphQLTagTest3UserFragment.graphql.js b/packages/relay-runtime/query/__tests__/__generated__/GraphQLTagTest3UserFragment.graphql.js index 6e0ce8bb8bb8d..6494575c8fc44 100644 --- a/packages/relay-runtime/query/__tests__/__generated__/GraphQLTagTest3UserFragment.graphql.js +++ b/packages/relay-runtime/query/__tests__/__generated__/GraphQLTagTest3UserFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<3b8e5bc2ca259a70d6689097489026e4>> * @flow * @lightSyntaxTransform * @nogrep @@ -20,8 +20,6 @@ import type { FragmentType } from "relay-runtime"; declare export opaque type GraphQLTagTest3UserFragment$fragmentType: FragmentType; type GraphQLTagTestUserFragment2RefetchQuery$variables = any; export type GraphQLTagTest3UserFragment$data = {| - +id: string, - +name: ?string, +friends: ?{| +edges: ?$ReadOnlyArray, |}, + +id: string, + +name: ?string, +$fragmentType: GraphQLTagTest3UserFragment$fragmentType, |}; export type GraphQLTagTest3UserFragment$key = { diff --git a/packages/relay-runtime/query/__tests__/__generated__/GraphQLTagTest6UserFragment.graphql.js b/packages/relay-runtime/query/__tests__/__generated__/GraphQLTagTest6UserFragment.graphql.js index 69e8a023e351b..ec218b6e717fb 100644 --- a/packages/relay-runtime/query/__tests__/__generated__/GraphQLTagTest6UserFragment.graphql.js +++ b/packages/relay-runtime/query/__tests__/__generated__/GraphQLTagTest6UserFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<2f6318f191b1a6e6e3e13bf30a5de793>> + * @generated SignedSource<<58cf4fb6a2b80bb82b65699f9966e11c>> * @flow * @lightSyntaxTransform * @nogrep @@ -20,8 +20,6 @@ import type { FragmentType } from "relay-runtime"; declare export opaque type GraphQLTagTest6UserFragment$fragmentType: FragmentType; type GraphQLTagTestUserFragment4RefetchQuery$variables = any; export type GraphQLTagTest6UserFragment$data = {| - +id: string, - +name: ?string, +friends: ?{| +edges: ?$ReadOnlyArray, |}, + +id: string, + +name: ?string, +$fragmentType: GraphQLTagTest6UserFragment$fragmentType, |}; export type GraphQLTagTest6UserFragment$key = { diff --git a/packages/relay-runtime/query/__tests__/__generated__/GraphQLTagTestUserFragment1RefetchQuery.graphql.js b/packages/relay-runtime/query/__tests__/__generated__/GraphQLTagTestUserFragment1RefetchQuery.graphql.js index dc7bfb96a97ce..5c40eaf69c979 100644 --- a/packages/relay-runtime/query/__tests__/__generated__/GraphQLTagTestUserFragment1RefetchQuery.graphql.js +++ b/packages/relay-runtime/query/__tests__/__generated__/GraphQLTagTestUserFragment1RefetchQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<5358afc9dc29cac944142e12b127032a>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type GraphQLTagTestUserFragment1RefetchQuery$data = {| |}, |}; export type GraphQLTagTestUserFragment1RefetchQuery = {| - variables: GraphQLTagTestUserFragment1RefetchQuery$variables, response: GraphQLTagTestUserFragment1RefetchQuery$data, + variables: GraphQLTagTestUserFragment1RefetchQuery$variables, |}; */ diff --git a/packages/relay-runtime/query/__tests__/__generated__/GraphQLTagTestUserFragment2RefetchQuery.graphql.js b/packages/relay-runtime/query/__tests__/__generated__/GraphQLTagTestUserFragment2RefetchQuery.graphql.js index 13f2bc5a807f1..e4e14683f91ff 100644 --- a/packages/relay-runtime/query/__tests__/__generated__/GraphQLTagTestUserFragment2RefetchQuery.graphql.js +++ b/packages/relay-runtime/query/__tests__/__generated__/GraphQLTagTestUserFragment2RefetchQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<5abf1eb136758620eecfde90a5e8ac14>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -29,8 +29,8 @@ export type GraphQLTagTestUserFragment2RefetchQuery$data = {| |}, |}; export type GraphQLTagTestUserFragment2RefetchQuery = {| - variables: GraphQLTagTestUserFragment2RefetchQuery$variables, response: GraphQLTagTestUserFragment2RefetchQuery$data, + variables: GraphQLTagTestUserFragment2RefetchQuery$variables, |}; */ diff --git a/packages/relay-runtime/query/__tests__/__generated__/GraphQLTagTestUserFragment3RefetchQuery.graphql.js b/packages/relay-runtime/query/__tests__/__generated__/GraphQLTagTestUserFragment3RefetchQuery.graphql.js index 9a46407e6c534..83c65a7c3d0cd 100644 --- a/packages/relay-runtime/query/__tests__/__generated__/GraphQLTagTestUserFragment3RefetchQuery.graphql.js +++ b/packages/relay-runtime/query/__tests__/__generated__/GraphQLTagTestUserFragment3RefetchQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<05c99c72a80120b2b8667643f43f283a>> + * @generated SignedSource<<9883fff64e0b052b3b6b9c33bf5a6a34>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type GraphQLTagTestUserFragment3RefetchQuery$data = {| |}, |}; export type GraphQLTagTestUserFragment3RefetchQuery = {| - variables: GraphQLTagTestUserFragment3RefetchQuery$variables, response: GraphQLTagTestUserFragment3RefetchQuery$data, + variables: GraphQLTagTestUserFragment3RefetchQuery$variables, |}; */ diff --git a/packages/relay-runtime/query/__tests__/__generated__/GraphQLTagTestUserFragment4RefetchQuery.graphql.js b/packages/relay-runtime/query/__tests__/__generated__/GraphQLTagTestUserFragment4RefetchQuery.graphql.js index 045650d822c8e..eaa2243134cc1 100644 --- a/packages/relay-runtime/query/__tests__/__generated__/GraphQLTagTestUserFragment4RefetchQuery.graphql.js +++ b/packages/relay-runtime/query/__tests__/__generated__/GraphQLTagTestUserFragment4RefetchQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<5a5acd8c0e1593f3f620dfb79ff610be>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -29,8 +29,8 @@ export type GraphQLTagTestUserFragment4RefetchQuery$data = {| |}, |}; export type GraphQLTagTestUserFragment4RefetchQuery = {| - variables: GraphQLTagTestUserFragment4RefetchQuery$variables, response: GraphQLTagTestUserFragment4RefetchQuery$data, + variables: GraphQLTagTestUserFragment4RefetchQuery$variables, |}; */ diff --git a/packages/relay-runtime/query/__tests__/__generated__/fetchQueryDEPRECATEDTestQuery.graphql.js b/packages/relay-runtime/query/__tests__/__generated__/fetchQueryDEPRECATEDTestQuery.graphql.js index 2b96667ab0761..32eb6aaa67264 100644 --- a/packages/relay-runtime/query/__tests__/__generated__/fetchQueryDEPRECATEDTestQuery.graphql.js +++ b/packages/relay-runtime/query/__tests__/__generated__/fetchQueryDEPRECATEDTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<35e14f36c8123d4d64f90cb6b17f0267>> + * @generated SignedSource<<9f3e1908cc72d4fd5a8ba908e741afa4>> * @flow * @lightSyntaxTransform * @nogrep @@ -28,8 +28,8 @@ export type fetchQueryDEPRECATEDTestQuery$data = {| |}, |}; export type fetchQueryDEPRECATEDTestQuery = {| - variables: fetchQueryDEPRECATEDTestQuery$variables, response: fetchQueryDEPRECATEDTestQuery$data, + variables: fetchQueryDEPRECATEDTestQuery$variables, |}; */ diff --git a/packages/relay-runtime/query/__tests__/__generated__/fetchQueryInternalTest1Query.graphql.js b/packages/relay-runtime/query/__tests__/__generated__/fetchQueryInternalTest1Query.graphql.js index e99d3a3e029d4..7fdde74a929eb 100644 --- a/packages/relay-runtime/query/__tests__/__generated__/fetchQueryInternalTest1Query.graphql.js +++ b/packages/relay-runtime/query/__tests__/__generated__/fetchQueryInternalTest1Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<7e627a1f73dd3ca56b9ad764e87e0130>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type fetchQueryInternalTest1Query$data = {| |}, |}; export type fetchQueryInternalTest1Query = {| - variables: fetchQueryInternalTest1Query$variables, response: fetchQueryInternalTest1Query$data, + variables: fetchQueryInternalTest1Query$variables, |}; */ diff --git a/packages/relay-runtime/query/__tests__/__generated__/fetchQueryInternalTest2Query.graphql.js b/packages/relay-runtime/query/__tests__/__generated__/fetchQueryInternalTest2Query.graphql.js index 2ef17964f3d88..d6e1ad260332c 100644 --- a/packages/relay-runtime/query/__tests__/__generated__/fetchQueryInternalTest2Query.graphql.js +++ b/packages/relay-runtime/query/__tests__/__generated__/fetchQueryInternalTest2Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<0da44a92eb6e658ef619d13bc16595d7>> * @flow * @lightSyntaxTransform * @nogrep @@ -33,8 +33,8 @@ export type fetchQueryInternalTest2Query$data = {| |}, |}; export type fetchQueryInternalTest2Query = {| - variables: fetchQueryInternalTest2Query$variables, response: fetchQueryInternalTest2Query$data, + variables: fetchQueryInternalTest2Query$variables, |}; */ diff --git a/packages/relay-runtime/query/__tests__/__generated__/fetchQueryInternalTest3Query.graphql.js b/packages/relay-runtime/query/__tests__/__generated__/fetchQueryInternalTest3Query.graphql.js index 9642bddb885a8..3a6fff18b44e0 100644 --- a/packages/relay-runtime/query/__tests__/__generated__/fetchQueryInternalTest3Query.graphql.js +++ b/packages/relay-runtime/query/__tests__/__generated__/fetchQueryInternalTest3Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<22af0d2a2f8d8f6b84b77da120b1644c>> + * @generated SignedSource<<06eb5016ddcea5197b2e9b490fcb814a>> * @flow * @lightSyntaxTransform * @nogrep @@ -33,8 +33,8 @@ export type fetchQueryInternalTest3Query$data = {| |}, |}; export type fetchQueryInternalTest3Query = {| - variables: fetchQueryInternalTest3Query$variables, response: fetchQueryInternalTest3Query$data, + variables: fetchQueryInternalTest3Query$variables, |}; */ diff --git a/packages/relay-runtime/query/__tests__/__generated__/fetchQueryInternalTestMarkdown1Fragment_name.graphql.js b/packages/relay-runtime/query/__tests__/__generated__/fetchQueryInternalTestMarkdown1Fragment_name.graphql.js index 8a9c2f0f2338b..b0b519c0b2a6d 100644 --- a/packages/relay-runtime/query/__tests__/__generated__/fetchQueryInternalTestMarkdown1Fragment_name.graphql.js +++ b/packages/relay-runtime/query/__tests__/__generated__/fetchQueryInternalTestMarkdown1Fragment_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<86f2f1954c32e8bd2eae956cf9044c1a>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,11 +19,11 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type fetchQueryInternalTestMarkdown1Fragment_name$fragmentType: FragmentType; export type fetchQueryInternalTestMarkdown1Fragment_name$data = {| - +markdown: ?string, + +__typename: "MarkdownUserNameRenderer", +data: ?{| +markup: ?string, |}, - +__typename: "MarkdownUserNameRenderer", + +markdown: ?string, +$fragmentType: fetchQueryInternalTestMarkdown1Fragment_name$fragmentType, |}; export type fetchQueryInternalTestMarkdown1Fragment_name$key = { diff --git a/packages/relay-runtime/query/__tests__/__generated__/fetchQueryInternalTestMarkdownFragment_name.graphql.js b/packages/relay-runtime/query/__tests__/__generated__/fetchQueryInternalTestMarkdownFragment_name.graphql.js index 19152c9d8f751..4758c71b74052 100644 --- a/packages/relay-runtime/query/__tests__/__generated__/fetchQueryInternalTestMarkdownFragment_name.graphql.js +++ b/packages/relay-runtime/query/__tests__/__generated__/fetchQueryInternalTestMarkdownFragment_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<849570677d208c3e81604c482df1dbd7>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,11 +19,11 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type fetchQueryInternalTestMarkdownFragment_name$fragmentType: FragmentType; export type fetchQueryInternalTestMarkdownFragment_name$data = {| - +markdown: ?string, + +__typename: "MarkdownUserNameRenderer", +data: ?{| +markup: ?string, |}, - +__typename: "MarkdownUserNameRenderer", + +markdown: ?string, +$fragmentType: fetchQueryInternalTestMarkdownFragment_name$fragmentType, |}; export type fetchQueryInternalTestMarkdownFragment_name$key = { diff --git a/packages/relay-runtime/query/__tests__/__generated__/fetchQueryInternalTestPlain1Fragment_name.graphql.js b/packages/relay-runtime/query/__tests__/__generated__/fetchQueryInternalTestPlain1Fragment_name.graphql.js index 51922448e15c5..1c007776c05a2 100644 --- a/packages/relay-runtime/query/__tests__/__generated__/fetchQueryInternalTestPlain1Fragment_name.graphql.js +++ b/packages/relay-runtime/query/__tests__/__generated__/fetchQueryInternalTestPlain1Fragment_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<89b9a203ad057e8a70831ca7f2664fa9>> + * @generated SignedSource<<9047eb79f04f30cdff82ed145002ea9d>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type fetchQueryInternalTestPlain1Fragment_name$fragmentType: FragmentType; export type fetchQueryInternalTestPlain1Fragment_name$data = {| - +plaintext: ?string, +data: ?{| +text: ?string, |}, + +plaintext: ?string, +$fragmentType: fetchQueryInternalTestPlain1Fragment_name$fragmentType, |}; export type fetchQueryInternalTestPlain1Fragment_name$key = { diff --git a/packages/relay-runtime/query/__tests__/__generated__/fetchQueryInternalTestPlainFragment_name.graphql.js b/packages/relay-runtime/query/__tests__/__generated__/fetchQueryInternalTestPlainFragment_name.graphql.js index 397d4c703d5d8..c6373ce43dbd0 100644 --- a/packages/relay-runtime/query/__tests__/__generated__/fetchQueryInternalTestPlainFragment_name.graphql.js +++ b/packages/relay-runtime/query/__tests__/__generated__/fetchQueryInternalTestPlainFragment_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type fetchQueryInternalTestPlainFragment_name$fragmentType: FragmentType; export type fetchQueryInternalTestPlainFragment_name$data = {| - +plaintext: ?string, +data: ?{| +text: ?string, |}, + +plaintext: ?string, +$fragmentType: fetchQueryInternalTestPlainFragment_name$fragmentType, |}; export type fetchQueryInternalTestPlainFragment_name$key = { diff --git a/packages/relay-runtime/query/__tests__/__generated__/fetchQueryTest1Query.graphql.js b/packages/relay-runtime/query/__tests__/__generated__/fetchQueryTest1Query.graphql.js index 725fb02fc678a..cc48a9929202c 100644 --- a/packages/relay-runtime/query/__tests__/__generated__/fetchQueryTest1Query.graphql.js +++ b/packages/relay-runtime/query/__tests__/__generated__/fetchQueryTest1Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<15a43467d95cfeb7cf8259964884ba59>> + * @generated SignedSource<<1e6e8c1d242f5269f2a9682f0892d20c>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type fetchQueryTest1Query$data = {| |}, |}; export type fetchQueryTest1Query = {| - variables: fetchQueryTest1Query$variables, response: fetchQueryTest1Query$data, + variables: fetchQueryTest1Query$variables, |}; */ diff --git a/packages/relay-runtime/query/__tests__/__generated__/fetchQueryTest2Query.graphql.js b/packages/relay-runtime/query/__tests__/__generated__/fetchQueryTest2Query.graphql.js index 8593396c4204c..852a10d696266 100644 --- a/packages/relay-runtime/query/__tests__/__generated__/fetchQueryTest2Query.graphql.js +++ b/packages/relay-runtime/query/__tests__/__generated__/fetchQueryTest2Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<53a79f68431aad1c47f412a4f3ebc8ee>> * @flow * @lightSyntaxTransform * @nogrep @@ -23,8 +23,8 @@ export type fetchQueryTest2Query$data = {| |}, |}; export type fetchQueryTest2Query = {| - variables: fetchQueryTest2Query$variables, response: fetchQueryTest2Query$data, + variables: fetchQueryTest2Query$variables, |}; */ diff --git a/packages/relay-runtime/query/__tests__/__generated__/fetchQueryTest3Query.graphql.js b/packages/relay-runtime/query/__tests__/__generated__/fetchQueryTest3Query.graphql.js index 8a670f614e287..b20b2f8ea24b6 100644 --- a/packages/relay-runtime/query/__tests__/__generated__/fetchQueryTest3Query.graphql.js +++ b/packages/relay-runtime/query/__tests__/__generated__/fetchQueryTest3Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<2e5bb034b0ddc94c8e008d057eeded4e>> * @flow * @lightSyntaxTransform * @nogrep @@ -23,8 +23,8 @@ export type fetchQueryTest3Query$data = {| |}, |}; export type fetchQueryTest3Query = {| - variables: fetchQueryTest3Query$variables, response: fetchQueryTest3Query$data, + variables: fetchQueryTest3Query$variables, |}; */ diff --git a/packages/relay-runtime/query/__tests__/__generated__/fetchQueryTest4Query.graphql.js b/packages/relay-runtime/query/__tests__/__generated__/fetchQueryTest4Query.graphql.js index 997e38852ced1..6a48801b85cc5 100644 --- a/packages/relay-runtime/query/__tests__/__generated__/fetchQueryTest4Query.graphql.js +++ b/packages/relay-runtime/query/__tests__/__generated__/fetchQueryTest4Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<9d2083906f925356081c79f6debaf43f>> + * @generated SignedSource<<7c02f5a61c27f1b2d1e5acf8c4cd807b>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type fetchQueryTest4Query$data = {| |}, |}; export type fetchQueryTest4Query = {| - variables: fetchQueryTest4Query$variables, response: fetchQueryTest4Query$data, + variables: fetchQueryTest4Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest10Fragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest10Fragment.graphql.js index 7721eac3f311e..27cb1c7c5bb26 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest10Fragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest10Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<24804dfa0e12d904bd8973dda298f16b>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,8 +19,8 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type DataCheckerTest10Fragment$fragmentType: FragmentType; export type DataCheckerTest10Fragment$data = {| - +id: string, +firstName: ?string, + +id: string, +profilePicture: ?{| +uri: ?string, |}, diff --git a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest10Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest10Query.graphql.js index 3d0b4cd08840f..0bc24bd3a2f7e 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest10Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest10Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<11872a7ef2ef95248bbfb6843763e068>> * @flow * @lightSyntaxTransform * @nogrep @@ -32,8 +32,8 @@ export type DataCheckerTest10Query$data = {| |}, |}; export type DataCheckerTest10Query = {| - variables: DataCheckerTest10Query$variables, response: DataCheckerTest10Query$data, + variables: DataCheckerTest10Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest13Fragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest13Fragment.graphql.js index 7d5349e913fb3..5ef04649433b2 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest13Fragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest13Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,8 +19,8 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type DataCheckerTest13Fragment$fragmentType: FragmentType; export type DataCheckerTest13Fragment$data = {| - +id: string, +firstName: ?string, + +id: string, +profilePicture: ?{| +uri: ?string, |}, diff --git a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest14Fragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest14Fragment.graphql.js index 189ac8e4f8997..85be055d8fd26 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest14Fragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest14Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,36 +19,36 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type DataCheckerTest14Fragment$fragmentType: FragmentType; export type DataCheckerTest14Fragment$data = {| - +id: string, - +firstName: ?string, - +client_actor_field: ?string, - +client_foo: ?{| - +client_name: ?string, - +profile_picture: ?{| - +uri: ?string, - |}, - |}, +best_friends: ?{| +edges: ?$ReadOnlyArray, |}, + +client_actor_field: ?string, + +client_foo: ?{| + +client_name: ?string, + +profile_picture: ?{| + +uri: ?string, + |}, + |}, + +firstName: ?string, + +id: string, +$fragmentType: DataCheckerTest14Fragment$fragmentType, |}; export type DataCheckerTest14Fragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest1Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest1Query.graphql.js index d6ea609b8638d..16f31ed523bce 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest1Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest1Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<6df0fa0283c1ef340ebe0d8c86bc2a77>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type DataCheckerTest1Query$data = {| |}, |}; export type DataCheckerTest1Query = {| - variables: DataCheckerTest1Query$variables, response: DataCheckerTest1Query$data, + variables: DataCheckerTest1Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest2Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest2Query.graphql.js index 094f2deb76d27..5a79d4c91bce3 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest2Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest2Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<989491758bfedace03d0fc2880b96047>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type DataCheckerTest2Query$data = {| |}, |}; export type DataCheckerTest2Query = {| - variables: DataCheckerTest2Query$variables, response: DataCheckerTest2Query$data, + variables: DataCheckerTest2Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest3Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest3Query.graphql.js index 3b324a98d4664..449d80739d85b 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest3Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest3Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<00f64573fd125df59159b9b1650455a4>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type DataCheckerTest3Query$data = {| |}, |}; export type DataCheckerTest3Query = {| - variables: DataCheckerTest3Query$variables, response: DataCheckerTest3Query$data, + variables: DataCheckerTest3Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest4Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest4Query.graphql.js index 90724c6183cc2..092ed9f02c400 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest4Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest4Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type DataCheckerTest4Query$data = {| |}, |}; export type DataCheckerTest4Query = {| - variables: DataCheckerTest4Query$variables, response: DataCheckerTest4Query$data, + variables: DataCheckerTest4Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest5MarkdownUserNameRenderer_name.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest5MarkdownUserNameRenderer_name.graphql.js index 6ce4f9f2ec33f..4ab6384e5aebc 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest5MarkdownUserNameRenderer_name.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest5MarkdownUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type DataCheckerTest5MarkdownUserNameRenderer_name$fragmentType: FragmentType; export type DataCheckerTest5MarkdownUserNameRenderer_name$data = {| - +markdown: ?string, +data: ?{| +markup: ?string, |}, + +markdown: ?string, +$fragmentType: DataCheckerTest5MarkdownUserNameRenderer_name$fragmentType, |}; export type DataCheckerTest5MarkdownUserNameRenderer_name$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest5PlainUserNameRenderer_name.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest5PlainUserNameRenderer_name.graphql.js index 01156e74e79f4..4968b464ed268 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest5PlainUserNameRenderer_name.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest5PlainUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<5ba50a358b2942848f8050b162aab983>> + * @generated SignedSource<<0aab4e4a6189f237cccce61883044df4>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type DataCheckerTest5PlainUserNameRenderer_name$fragmentType: FragmentType; export type DataCheckerTest5PlainUserNameRenderer_name$data = {| - +plaintext: ?string, +data: ?{| +text: ?string, |}, + +plaintext: ?string, +$fragmentType: DataCheckerTest5PlainUserNameRenderer_name$fragmentType, |}; export type DataCheckerTest5PlainUserNameRenderer_name$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest5Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest5Query.graphql.js index 59253f51cf627..b02f33a45c0f8 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest5Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest5Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<34ce3776dc993be3954b0fbb0cc812fe>> + * @generated SignedSource<<162326977109f51cc8f85a34c7a6d3c3>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type DataCheckerTest5Query$data = {| |}, |}; export type DataCheckerTest5Query = {| - variables: DataCheckerTest5Query$variables, response: DataCheckerTest5Query$data, + variables: DataCheckerTest5Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest6Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest6Query.graphql.js index 550d5d0995a8d..fd97635fc192f 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest6Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest6Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<54bf94441a8c0d4df4b636e8122dd3ac>> + * @generated SignedSource<<7da5975d505089dbbc8a65e25cf12f78>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type DataCheckerTest6Query$data = {| |}, |}; export type DataCheckerTest6Query = {| - variables: DataCheckerTest6Query$variables, response: DataCheckerTest6Query$data, + variables: DataCheckerTest6Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest7Fragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest7Fragment.graphql.js index bc6e8d5445d56..44f90a5c5309b 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest7Fragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest7Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<494f1ed771ca982c3f6a393ac8be2999>> + * @generated SignedSource<<25fdb0c7c5e8b922316d8c7e5afe8335>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type DataCheckerTest7Fragment$fragmentType: FragmentType; export type DataCheckerTest7Fragment$data = {| - +id: string, +actors: ?$ReadOnlyArray, + +id: string, +$fragmentType: DataCheckerTest7Fragment$fragmentType, |}; export type DataCheckerTest7Fragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest7Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest7Query.graphql.js index bbea070471dd3..4d2d123d3d76f 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest7Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest7Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<84785603b753e3051bad857279147169>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type DataCheckerTest7Query$data = {| |}, |}; export type DataCheckerTest7Query = {| - variables: DataCheckerTest7Query$variables, response: DataCheckerTest7Query$data, + variables: DataCheckerTest7Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest8Fragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest8Fragment.graphql.js index 95e6878d90d01..3a5dcc3a6f573 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest8Fragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest8Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,8 +19,8 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type DataCheckerTest8Fragment$fragmentType: FragmentType; export type DataCheckerTest8Fragment$data = {| - +id: string, +firstName: ?string, + +id: string, +profilePicture: ?{| +uri: ?string, |}, diff --git a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest8Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest8Query.graphql.js index dddb477e5ff6b..b0b0cd45d81e3 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest8Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest8Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<0e1bd25d79bcfdb09a5485f5287ec4fd>> + * @generated SignedSource<<796febb6bba71223b8f9398fc1ba9ff4>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type DataCheckerTest8Query$data = {| |}, |}; export type DataCheckerTest8Query = {| - variables: DataCheckerTest8Query$variables, response: DataCheckerTest8Query$data, + variables: DataCheckerTest8Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest9Fragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest9Fragment.graphql.js index 8e37d42c1bedf..4c2c15e773f7c 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest9Fragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest9Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<34b569d889b0b0e58098292c29969efa>> + * @generated SignedSource<<7eb4ad7b4fd2296f84128c0b34ce7018>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,8 +19,8 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type DataCheckerTest9Fragment$fragmentType: FragmentType; export type DataCheckerTest9Fragment$data = {| - +id: string, +firstName: ?string, + +id: string, +profilePicture: ?{| +uri: ?string, |}, diff --git a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest9Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest9Query.graphql.js index 499fb1c60b72b..182764abc5d25 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest9Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTest9Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<0595bfe0a86fa26e40beb0002abf3453>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type DataCheckerTest9Query$data = {| |}, |}; export type DataCheckerTest9Query = {| - variables: DataCheckerTest9Query$variables, response: DataCheckerTest9Query$data, + variables: DataCheckerTest9Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTestFlightQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTestFlightQuery.graphql.js index f1617111ac41a..8903966a1c332 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTestFlightQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTestFlightQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<01ebae56816517c5b4e0a52b52e20c2f>> + * @generated SignedSource<<1cd50c326406f186f83fdfd089b34d24>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,8 +19,8 @@ /*:: import type { ConcreteRequest, Query } from 'relay-runtime'; export type DataCheckerTestFlightQuery$variables = {| - id: string, count: number, + id: string, |}; export type DataCheckerTestFlightQuery$data = {| +node: ?{| @@ -28,8 +28,8 @@ export type DataCheckerTestFlightQuery$data = {| |}, |}; export type DataCheckerTestFlightQuery = {| - variables: DataCheckerTestFlightQuery$variables, response: DataCheckerTestFlightQuery$data, + variables: DataCheckerTestFlightQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTestFragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTestFragment.graphql.js index 77a828f175a9b..de2821c386d8c 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTestFragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTestFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<46b3740c57127df069b370c48b625f87>> + * @generated SignedSource<<1d8f54c970cd35052ccbe3719787b464>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,17 +19,17 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type DataCheckerTestFragment$fragmentType: FragmentType; export type DataCheckerTestFragment$data = {| - +id: string, +firstName: ?string, +friends: ?{| +edges: ?$ReadOnlyArray, |}, + +id: string, +profilePicture: ?{| +uri: ?string, |}, diff --git a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTestInnerQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTestInnerQuery.graphql.js index cffad5d7c2f31..7fd59cbc9b4fa 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTestInnerQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTestInnerQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<2f6411692fa9c54d50cf80ce224778a2>> + * @generated SignedSource<<80b23aa9d881e875df3002b82966ac81>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type DataCheckerTestInnerQuery$data = {| |}, |}; export type DataCheckerTestInnerQuery = {| - variables: DataCheckerTestInnerQuery$variables, response: DataCheckerTestInnerQuery$data, + variables: DataCheckerTestInnerQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTestMarkdownUserNameRenderer_nameFragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTestMarkdownUserNameRenderer_nameFragment.graphql.js index 313389a86b701..4316f13e97b48 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTestMarkdownUserNameRenderer_nameFragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTestMarkdownUserNameRenderer_nameFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<43625def5a9d84ff3e2ea344b936ae0a>> + * @generated SignedSource<<78cac1551b452d2bf1a5cb0df558bd27>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type DataCheckerTestMarkdownUserNameRenderer_nameFragment$fragmentType: FragmentType; export type DataCheckerTestMarkdownUserNameRenderer_nameFragment$data = {| - +markdown: ?string, +data: ?{| +markup: ?string, |}, + +markdown: ?string, +$fragmentType: DataCheckerTestMarkdownUserNameRenderer_nameFragment$fragmentType, |}; export type DataCheckerTestMarkdownUserNameRenderer_nameFragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTestPlainUserNameRenderer_nameFragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTestPlainUserNameRenderer_nameFragment.graphql.js index f72766ebfa497..d879dab906710 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTestPlainUserNameRenderer_nameFragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTestPlainUserNameRenderer_nameFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<88906d23401ea8eff6e98e2a83a46fd4>> + * @generated SignedSource<<6eb00a1e4fb5711071abb36ab9d5d1d2>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type DataCheckerTestPlainUserNameRenderer_nameFragment$fragmentType: FragmentType; export type DataCheckerTestPlainUserNameRenderer_nameFragment$data = {| - +plaintext: ?string, +data: ?{| +text: ?string, |}, + +plaintext: ?string, +$fragmentType: DataCheckerTestPlainUserNameRenderer_nameFragment$fragmentType, |}; export type DataCheckerTestPlainUserNameRenderer_nameFragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTestQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTestQuery.graphql.js index 83cc78cdc6b04..66c3ed539dd80 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTestQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<5bb7d93d1d2541d55cd2b33a03a86cb7>> * @flow * @lightSyntaxTransform * @nogrep @@ -22,7 +22,6 @@ export type DataCheckerTestQuery$variables = {| |}; export type DataCheckerTestQuery$data = {| +node: ?{| - +id: string, +__typename: string, +actors?: ?$ReadOnlyArray, |}, + +id: string, +profilePicture?: ?{| +uri: ?string, |}, |}, |}; export type DataCheckerTestQuery = {| - variables: DataCheckerTestQuery$variables, response: DataCheckerTestQuery$data, + variables: DataCheckerTestQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayConcreteVariablesTest1Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayConcreteVariablesTest1Query.graphql.js index 813179b3fd4a9..6ea3a62a030e1 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayConcreteVariablesTest1Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayConcreteVariablesTest1Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<57949cc6d62910f2c3cd7bf9d4a5aca0>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type RelayConcreteVariablesTest1Query$data = {| |}, |}; export type RelayConcreteVariablesTest1Query = {| - variables: RelayConcreteVariablesTest1Query$variables, response: RelayConcreteVariablesTest1Query$data, + variables: RelayConcreteVariablesTest1Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayConcreteVariablesTest2Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayConcreteVariablesTest2Query.graphql.js index ba645b47dd82e..f4306ec4f6c43 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayConcreteVariablesTest2Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayConcreteVariablesTest2Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<4effea13b605f7dc27c3551d4ed7935c>> + * @generated SignedSource<<034f101fc0328a713a17811a35b4bdbd>> * @flow * @lightSyntaxTransform * @nogrep @@ -17,8 +17,8 @@ /*:: import type { ConcreteRequest, Query } from 'relay-runtime'; export type RelayConcreteVariablesTest2Query$variables = {| - id?: ?string, count?: ?number, + id?: ?string, order?: ?$ReadOnlyArray, |}; export type RelayConcreteVariablesTest2Query$data = {| @@ -33,8 +33,8 @@ export type RelayConcreteVariablesTest2Query$data = {| |}, |}; export type RelayConcreteVariablesTest2Query = {| - variables: RelayConcreteVariablesTest2Query$variables, response: RelayConcreteVariablesTest2Query$data, + variables: RelayConcreteVariablesTest2Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseHandlerTestNullLinkedQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseHandlerTestNullLinkedQuery.graphql.js index fcd105f4eadb0..a0531fb66883d 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseHandlerTestNullLinkedQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseHandlerTestNullLinkedQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<4132b09ce99995df3700e80f7c120eb4>> * @flow * @lightSyntaxTransform * @nogrep @@ -23,8 +23,8 @@ export type RelayExperimentalGraphResponseHandlerTestNullLinkedQuery$data = {| |}, |}; export type RelayExperimentalGraphResponseHandlerTestNullLinkedQuery = {| - variables: RelayExperimentalGraphResponseHandlerTestNullLinkedQuery$variables, response: RelayExperimentalGraphResponseHandlerTestNullLinkedQuery$data, + variables: RelayExperimentalGraphResponseHandlerTestNullLinkedQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseHandlerTestPluralLinkedQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseHandlerTestPluralLinkedQuery.graphql.js index 1516c5cc1a693..28f72b4fcf795 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseHandlerTestPluralLinkedQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseHandlerTestPluralLinkedQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<25247998e25436c796681fd9b1ad7fd2>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type RelayExperimentalGraphResponseHandlerTestPluralLinkedQuery$data = {| |}, |}; export type RelayExperimentalGraphResponseHandlerTestPluralLinkedQuery = {| - variables: RelayExperimentalGraphResponseHandlerTestPluralLinkedQuery$variables, response: RelayExperimentalGraphResponseHandlerTestPluralLinkedQuery$data, + variables: RelayExperimentalGraphResponseHandlerTestPluralLinkedQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseHandlerTestPluralScalarQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseHandlerTestPluralScalarQuery.graphql.js index 6f6cd9fc9cefd..6983695d771f7 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseHandlerTestPluralScalarQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseHandlerTestPluralScalarQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<7699f7f5ca64d94030805662d8f0f915>> + * @generated SignedSource<<2427066783923a5d8fd0b1d84efac427>> * @flow * @lightSyntaxTransform * @nogrep @@ -23,8 +23,8 @@ export type RelayExperimentalGraphResponseHandlerTestPluralScalarQuery$data = {| |}, |}; export type RelayExperimentalGraphResponseHandlerTestPluralScalarQuery = {| - variables: RelayExperimentalGraphResponseHandlerTestPluralScalarQuery$variables, response: RelayExperimentalGraphResponseHandlerTestPluralScalarQuery$data, + variables: RelayExperimentalGraphResponseHandlerTestPluralScalarQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseHandlerTestQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseHandlerTestQuery.graphql.js index 6efc870cefdb7..8fd47e52dd823 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseHandlerTestQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseHandlerTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -23,8 +23,8 @@ export type RelayExperimentalGraphResponseHandlerTestQuery$data = {| |}, |}; export type RelayExperimentalGraphResponseHandlerTestQuery = {| - variables: RelayExperimentalGraphResponseHandlerTestQuery$variables, response: RelayExperimentalGraphResponseHandlerTestQuery$data, + variables: RelayExperimentalGraphResponseHandlerTestQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestConditionQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestConditionQuery.graphql.js index 7a87ef053b8b9..7564a96af4f90 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestConditionQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestConditionQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<8eb179bd0cb1b88cecdbe455ada4d003>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type RelayExperimentalGraphResponseTransformTest_condition$fragmentType = any; export type RelayExperimentalGraphResponseTransformTestConditionQuery$variables = {| - id: string, enableDefer: boolean, + id: string, |}; export type RelayExperimentalGraphResponseTransformTestConditionQuery$data = {| +node: ?{| @@ -27,8 +27,8 @@ export type RelayExperimentalGraphResponseTransformTestConditionQuery$data = {| |}, |}; export type RelayExperimentalGraphResponseTransformTestConditionQuery = {| - variables: RelayExperimentalGraphResponseTransformTestConditionQuery$variables, response: RelayExperimentalGraphResponseTransformTestConditionQuery$data, + variables: RelayExperimentalGraphResponseTransformTestConditionQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestDupesQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestDupesQuery.graphql.js index 9976471563ae6..fbd6a1bff3dbc 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestDupesQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestDupesQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<62898db05c5848c285e21b38f781245d>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -18,17 +18,17 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; export type RelayExperimentalGraphResponseTransformTestDupesQuery$variables = {||}; export type RelayExperimentalGraphResponseTransformTestDupesQuery$data = {| - +me: ?{| + +fetch__User: ?{| + +doesViewerLike: ?boolean, +name: ?string, |}, - +fetch__User: ?{| + +me: ?{| +name: ?string, - +doesViewerLike: ?boolean, |}, |}; export type RelayExperimentalGraphResponseTransformTestDupesQuery = {| - variables: RelayExperimentalGraphResponseTransformTestDupesQuery$variables, response: RelayExperimentalGraphResponseTransformTestDupesQuery$data, + variables: RelayExperimentalGraphResponseTransformTestDupesQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestEmptyChunkQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestEmptyChunkQuery.graphql.js index 0d581726e86da..857c10cb90435 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestEmptyChunkQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestEmptyChunkQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<7235de84c71829b3911d98ec720424b7>> * @flow * @lightSyntaxTransform * @nogrep @@ -18,16 +18,16 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; export type RelayExperimentalGraphResponseTransformTestEmptyChunkQuery$variables = {||}; export type RelayExperimentalGraphResponseTransformTestEmptyChunkQuery$data = {| - +me: ?{| + +fetch__User: ?{| +name: ?string, |}, - +fetch__User: ?{| + +me: ?{| +name: ?string, |}, |}; export type RelayExperimentalGraphResponseTransformTestEmptyChunkQuery = {| - variables: RelayExperimentalGraphResponseTransformTestEmptyChunkQuery$variables, response: RelayExperimentalGraphResponseTransformTestEmptyChunkQuery$data, + variables: RelayExperimentalGraphResponseTransformTestEmptyChunkQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestFragmentSpreadNoInlineQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestFragmentSpreadNoInlineQuery.graphql.js index 6b809dc54bbf8..38a049637ee93 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestFragmentSpreadNoInlineQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestFragmentSpreadNoInlineQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<05882c8e572240e121f0bd50a3028637>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayExperimentalGraphResponseTransformTestFragmentSpreadNoInlineQue |}, |}; export type RelayExperimentalGraphResponseTransformTestFragmentSpreadNoInlineQuery = {| - variables: RelayExperimentalGraphResponseTransformTestFragmentSpreadNoInlineQuery$variables, response: RelayExperimentalGraphResponseTransformTestFragmentSpreadNoInlineQuery$data, + variables: RelayExperimentalGraphResponseTransformTestFragmentSpreadNoInlineQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestFragmentSpreadQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestFragmentSpreadQuery.graphql.js index 576ef6e75de7f..30e93bec1d536 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestFragmentSpreadQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestFragmentSpreadQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<8c7f08eaf79053a7c0959ec2a80d4ee7>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayExperimentalGraphResponseTransformTestFragmentSpreadQuery$data |}, |}; export type RelayExperimentalGraphResponseTransformTestFragmentSpreadQuery = {| - variables: RelayExperimentalGraphResponseTransformTestFragmentSpreadQuery$variables, response: RelayExperimentalGraphResponseTransformTestFragmentSpreadQuery$data, + variables: RelayExperimentalGraphResponseTransformTestFragmentSpreadQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestHandleFieldsQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestHandleFieldsQuery.graphql.js index 38cb8bc068c69..fe3f08c08e9de 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestHandleFieldsQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestHandleFieldsQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<78934c4b6d5bc526ed8178e80778b954>> * @flow * @lightSyntaxTransform * @nogrep @@ -21,7 +21,6 @@ export type RelayExperimentalGraphResponseTransformTestHandleFieldsQuery$variabl |}; export type RelayExperimentalGraphResponseTransformTestHandleFieldsQuery$data = {| +node: ?{| - +id: string, +__typename: string, +friends?: ?{| +edges: ?$ReadOnlyArray, |}, + +id: string, |}, |}; export type RelayExperimentalGraphResponseTransformTestHandleFieldsQuery = {| - variables: RelayExperimentalGraphResponseTransformTestHandleFieldsQuery$variables, response: RelayExperimentalGraphResponseTransformTestHandleFieldsQuery$data, + variables: RelayExperimentalGraphResponseTransformTestHandleFieldsQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestInlineFragmentAbstractTypeQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestInlineFragmentAbstractTypeQuery.graphql.js index b62d072a332fd..748aa3c421e48 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestInlineFragmentAbstractTypeQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestInlineFragmentAbstractTypeQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<4ec0e6a0ab17c90f20346c51c9f0254b>> + * @generated SignedSource<<069b4b37bcb8bd3aed00a79876951555>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,15 +19,15 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; export type RelayExperimentalGraphResponseTransformTestInlineFragmentAbstractTypeQuery$variables = {||}; export type RelayExperimentalGraphResponseTransformTestInlineFragmentAbstractTypeQuery$data = {| +node: ?{| - +name?: ?string, +author?: ?{| +__typename: string, |}, + +name?: ?string, |}, |}; export type RelayExperimentalGraphResponseTransformTestInlineFragmentAbstractTypeQuery = {| - variables: RelayExperimentalGraphResponseTransformTestInlineFragmentAbstractTypeQuery$variables, response: RelayExperimentalGraphResponseTransformTestInlineFragmentAbstractTypeQuery$data, + variables: RelayExperimentalGraphResponseTransformTestInlineFragmentAbstractTypeQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestInlineFragmentQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestInlineFragmentQuery.graphql.js index 5012067b9553b..8127f93901098 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestInlineFragmentQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestInlineFragmentQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<7bb1c432fcd5935561aade0ea27a08f7>> + * @generated SignedSource<<51be2b951fd741e813ec72658e475bbf>> * @flow * @lightSyntaxTransform * @nogrep @@ -23,8 +23,8 @@ export type RelayExperimentalGraphResponseTransformTestInlineFragmentQuery$data |}, |}; export type RelayExperimentalGraphResponseTransformTestInlineFragmentQuery = {| - variables: RelayExperimentalGraphResponseTransformTestInlineFragmentQuery$variables, response: RelayExperimentalGraphResponseTransformTestInlineFragmentQuery$data, + variables: RelayExperimentalGraphResponseTransformTestInlineFragmentQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestNestedQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestNestedQuery.graphql.js index 1266e319a8240..16f439912e676 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestNestedQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestNestedQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<4b8ce1598a9093a7b7643c6942627899>> + * @generated SignedSource<<336e8e3a8c220d50bc2e790deabc6fa2>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayExperimentalGraphResponseTransformTestNestedQuery$data = {| |}, |}; export type RelayExperimentalGraphResponseTransformTestNestedQuery = {| - variables: RelayExperimentalGraphResponseTransformTestNestedQuery$variables, response: RelayExperimentalGraphResponseTransformTestNestedQuery$data, + variables: RelayExperimentalGraphResponseTransformTestNestedQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestNullLinkedQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestNullLinkedQuery.graphql.js index c1d3d1abbedf1..926a5893bf09a 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestNullLinkedQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestNullLinkedQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<2cd9a0f80e4c92c0c352db4190011d98>> + * @generated SignedSource<<3b264c2887b724d814a2cfb1efe88f1f>> * @flow * @lightSyntaxTransform * @nogrep @@ -23,8 +23,8 @@ export type RelayExperimentalGraphResponseTransformTestNullLinkedQuery$data = {| |}, |}; export type RelayExperimentalGraphResponseTransformTestNullLinkedQuery = {| - variables: RelayExperimentalGraphResponseTransformTestNullLinkedQuery$variables, response: RelayExperimentalGraphResponseTransformTestNullLinkedQuery$data, + variables: RelayExperimentalGraphResponseTransformTestNullLinkedQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestPluralLinkedQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestPluralLinkedQuery.graphql.js index 527a06a9ba696..1e1d34638e2f4 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestPluralLinkedQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestPluralLinkedQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<338357fad0255fe7008e0d02f0eb354f>> + * @generated SignedSource<<28e2f5f6e16a1b3eaaa247549fa3a443>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type RelayExperimentalGraphResponseTransformTestPluralLinkedQuery$data = |}, |}; export type RelayExperimentalGraphResponseTransformTestPluralLinkedQuery = {| - variables: RelayExperimentalGraphResponseTransformTestPluralLinkedQuery$variables, response: RelayExperimentalGraphResponseTransformTestPluralLinkedQuery$data, + variables: RelayExperimentalGraphResponseTransformTestPluralLinkedQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestPluralScalarQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestPluralScalarQuery.graphql.js index 81834927e63c1..54b6d47a70b7b 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestPluralScalarQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestPluralScalarQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<98673c7043730e4b03f5368e92866db7>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -23,8 +23,8 @@ export type RelayExperimentalGraphResponseTransformTestPluralScalarQuery$data = |}, |}; export type RelayExperimentalGraphResponseTransformTestPluralScalarQuery = {| - variables: RelayExperimentalGraphResponseTransformTestPluralScalarQuery$variables, response: RelayExperimentalGraphResponseTransformTestPluralScalarQuery$data, + variables: RelayExperimentalGraphResponseTransformTestPluralScalarQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestQuery.graphql.js index 0d5cd86810162..d1c8d67772f39 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayExperimentalGraphResponseTransformTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<73fddb2dd7affc36b16a7b5b28329c14>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -23,8 +23,8 @@ export type RelayExperimentalGraphResponseTransformTestQuery$data = {| |}, |}; export type RelayExperimentalGraphResponseTransformTestQuery = {| - variables: RelayExperimentalGraphResponseTransformTestQuery$variables, response: RelayExperimentalGraphResponseTransformTestQuery$data, + variables: RelayExperimentalGraphResponseTransformTestQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentApplyMutationTest1Mutation.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentApplyMutationTest1Mutation.graphql.js index 4417f741e945b..142f706f65de2 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentApplyMutationTest1Mutation.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentApplyMutationTest1Mutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<31bb5c2db229957073ae17f4355f5af6>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,8 +19,8 @@ import type { ConcreteRequest, Mutation } from 'relay-runtime'; type RelayModernEnvironmentApplyMutationTestFragment$fragmentType = any; export type CommentCreateInput = {| clientMutationId?: ?string, - feedbackId?: ?string, feedback?: ?CommentfeedbackFeedback, + feedbackId?: ?string, |}; export type CommentfeedbackFeedback = {| comment?: ?FeedbackcommentComment, @@ -39,8 +39,8 @@ export type RelayModernEnvironmentApplyMutationTest1Mutation$data = {| |}, |}; export type RelayModernEnvironmentApplyMutationTest1Mutation = {| - variables: RelayModernEnvironmentApplyMutationTest1Mutation$variables, response: RelayModernEnvironmentApplyMutationTest1Mutation$data, + variables: RelayModernEnvironmentApplyMutationTest1Mutation$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentApplyMutationTest1Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentApplyMutationTest1Query.graphql.js index 18ba9fffbddd7..9cef7eeccdfb9 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentApplyMutationTest1Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentApplyMutationTest1Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<8f822e72a9bf2ccb70484e62365dde0f>> + * @generated SignedSource<<76730ffe94a9225a8529a42bc1c8d191>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type RelayModernEnvironmentApplyMutationTest1Query$data = {| |}, |}; export type RelayModernEnvironmentApplyMutationTest1Query = {| - variables: RelayModernEnvironmentApplyMutationTest1Query$variables, response: RelayModernEnvironmentApplyMutationTest1Query$data, + variables: RelayModernEnvironmentApplyMutationTest1Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentApplyMutationTestFragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentApplyMutationTestFragment.graphql.js index 5ff44172b1a6b..90a6e3813ab82 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentApplyMutationTestFragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentApplyMutationTestFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<82636d0cf3e14f24c0f8b41765c8dcd9>> + * @generated SignedSource<<62488b3f466bcaabb2cc51411a28648c>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentApplyMutationTestFragment$fragmentType: FragmentType; export type RelayModernEnvironmentApplyMutationTestFragment$data = {| - +id: string, +body: ?{| +text: ?string, |}, + +id: string, +$fragmentType: RelayModernEnvironmentApplyMutationTestFragment$fragmentType, |}; export type RelayModernEnvironmentApplyMutationTestFragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentApplyMutationTestMutation.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentApplyMutationTestMutation.graphql.js index cd315b2ea6407..ad33fbd294875 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentApplyMutationTestMutation.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentApplyMutationTestMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<8192bd12305e2b5d8866b4d31c8c84aa>> + * @generated SignedSource<<333c9b1fa93ea99abbc44882e8c9926c>> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Mutation } from 'relay-runtime'; export type CommentCreateInput = {| clientMutationId?: ?string, - feedbackId?: ?string, feedback?: ?CommentfeedbackFeedback, + feedbackId?: ?string, |}; export type CommentfeedbackFeedback = {| comment?: ?FeedbackcommentComment, @@ -33,16 +33,16 @@ export type RelayModernEnvironmentApplyMutationTestMutation$variables = {| export type RelayModernEnvironmentApplyMutationTestMutation$data = {| +commentCreate: ?{| +comment: ?{| - +id: string, +body: ?{| +text: ?string, |}, + +id: string, |}, |}, |}; export type RelayModernEnvironmentApplyMutationTestMutation = {| - variables: RelayModernEnvironmentApplyMutationTestMutation$variables, response: RelayModernEnvironmentApplyMutationTestMutation$data, + variables: RelayModernEnvironmentApplyMutationTestMutation$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentApplyUpdateTestParentQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentApplyUpdateTestParentQuery.graphql.js index e12585fb7945b..367740fc39c59 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentApplyUpdateTestParentQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentApplyUpdateTestParentQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<49c61eebb4ed9fe51745a3de83083227>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayModernEnvironmentApplyUpdateTestParentQuery$data = {| |}, |}; export type RelayModernEnvironmentApplyUpdateTestParentQuery = {| - variables: RelayModernEnvironmentApplyUpdateTestParentQuery$variables, response: RelayModernEnvironmentApplyUpdateTestParentQuery$data, + variables: RelayModernEnvironmentApplyUpdateTestParentQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCheckTestParentQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCheckTestParentQuery.graphql.js index fa9faaf86eaf3..7c5ae911991ba 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCheckTestParentQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCheckTestParentQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -29,8 +29,8 @@ export type RelayModernEnvironmentCheckTestParentQuery$data = {| |}, |}; export type RelayModernEnvironmentCheckTestParentQuery = {| - variables: RelayModernEnvironmentCheckTestParentQuery$variables, response: RelayModernEnvironmentCheckTestParentQuery$data, + variables: RelayModernEnvironmentCheckTestParentQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCheckTestQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCheckTestQuery.graphql.js index e831342451c06..8d2280429e9e1 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCheckTestQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCheckTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<8898850afa9e84cd0c875a7672473b57>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -32,8 +32,8 @@ export type RelayModernEnvironmentCheckTestQuery$data = {| |}, |}; export type RelayModernEnvironmentCheckTestQuery = {| - variables: RelayModernEnvironmentCheckTestQuery$variables, response: RelayModernEnvironmentCheckTestQuery$data, + variables: RelayModernEnvironmentCheckTestQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCheckWithGlobalInvalidationTest1ParentQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCheckWithGlobalInvalidationTest1ParentQuery.graphql.js index ad13571605e78..15f4f622e4da9 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCheckWithGlobalInvalidationTest1ParentQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCheckWithGlobalInvalidationTest1ParentQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<7cca5d47af1a5c5dcc4d6d4590738ac4>> + * @generated SignedSource<<71644433e7011a41b2d397b95811c038>> * @flow * @lightSyntaxTransform * @nogrep @@ -29,8 +29,8 @@ export type RelayModernEnvironmentCheckWithGlobalInvalidationTest1ParentQuery$da |}, |}; export type RelayModernEnvironmentCheckWithGlobalInvalidationTest1ParentQuery = {| - variables: RelayModernEnvironmentCheckWithGlobalInvalidationTest1ParentQuery$variables, response: RelayModernEnvironmentCheckWithGlobalInvalidationTest1ParentQuery$data, + variables: RelayModernEnvironmentCheckWithGlobalInvalidationTest1ParentQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCheckWithGlobalInvalidationTest2ParentQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCheckWithGlobalInvalidationTest2ParentQuery.graphql.js index 8de5cae384f0d..79fb8b55e438a 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCheckWithGlobalInvalidationTest2ParentQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCheckWithGlobalInvalidationTest2ParentQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<24e78bb39ca0cd7656cde0bcef95bcc0>> + * @generated SignedSource<<25f4e31234fac32e0c994e44edd4c2b4>> * @flow * @lightSyntaxTransform * @nogrep @@ -28,8 +28,8 @@ export type RelayModernEnvironmentCheckWithGlobalInvalidationTest2ParentQuery$da |}, |}; export type RelayModernEnvironmentCheckWithGlobalInvalidationTest2ParentQuery = {| - variables: RelayModernEnvironmentCheckWithGlobalInvalidationTest2ParentQuery$variables, response: RelayModernEnvironmentCheckWithGlobalInvalidationTest2ParentQuery$data, + variables: RelayModernEnvironmentCheckWithGlobalInvalidationTest2ParentQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCheckWithLocalInvalidationTest1ParentQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCheckWithLocalInvalidationTest1ParentQuery.graphql.js index 556a9976e97a0..ac2cf385efa3d 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCheckWithLocalInvalidationTest1ParentQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCheckWithLocalInvalidationTest1ParentQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<7fa2e505339b9ae88b2e984f3ef63c27>> + * @generated SignedSource<<4acb2f02dca3f218aa1417ace3ffda3c>> * @flow * @lightSyntaxTransform * @nogrep @@ -29,8 +29,8 @@ export type RelayModernEnvironmentCheckWithLocalInvalidationTest1ParentQuery$dat |}, |}; export type RelayModernEnvironmentCheckWithLocalInvalidationTest1ParentQuery = {| - variables: RelayModernEnvironmentCheckWithLocalInvalidationTest1ParentQuery$variables, response: RelayModernEnvironmentCheckWithLocalInvalidationTest1ParentQuery$data, + variables: RelayModernEnvironmentCheckWithLocalInvalidationTest1ParentQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCheckWithLocalInvalidationTest2ParentQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCheckWithLocalInvalidationTest2ParentQuery.graphql.js index 55ecd3e8f2096..5d883d6dcaf67 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCheckWithLocalInvalidationTest2ParentQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCheckWithLocalInvalidationTest2ParentQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<7f1e069e36cf18e421c1bd70e9a49170>> + * @generated SignedSource<<69661fc1d27e1904a1b31940199ed005>> * @flow * @lightSyntaxTransform * @nogrep @@ -28,8 +28,8 @@ export type RelayModernEnvironmentCheckWithLocalInvalidationTest2ParentQuery$dat |}, |}; export type RelayModernEnvironmentCheckWithLocalInvalidationTest2ParentQuery = {| - variables: RelayModernEnvironmentCheckWithLocalInvalidationTest2ParentQuery$variables, response: RelayModernEnvironmentCheckWithLocalInvalidationTest2ParentQuery$data, + variables: RelayModernEnvironmentCheckWithLocalInvalidationTest2ParentQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCommitPayloadTest2ActorQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCommitPayloadTest2ActorQuery.graphql.js index da0040cd8044b..8ae3b2a5674af 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCommitPayloadTest2ActorQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCommitPayloadTest2ActorQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<35706a61092bcbb7bfb2c0ccef17cf44>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,17 +19,17 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; export type RelayModernEnvironmentCommitPayloadTest2ActorQuery$variables = {||}; export type RelayModernEnvironmentCommitPayloadTest2ActorQuery$data = {| +me: ?{| - +name: ?string, +birthdate: ?{| +day: ?number, +month: ?number, +year: ?number, |}, + +name: ?string, |}, |}; export type RelayModernEnvironmentCommitPayloadTest2ActorQuery = {| - variables: RelayModernEnvironmentCommitPayloadTest2ActorQuery$variables, response: RelayModernEnvironmentCommitPayloadTest2ActorQuery$data, + variables: RelayModernEnvironmentCommitPayloadTest2ActorQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCommitPayloadTest3ActorQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCommitPayloadTest3ActorQuery.graphql.js index f11a6af6bacc3..921d4905dc469 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCommitPayloadTest3ActorQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCommitPayloadTest3ActorQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<6439c23395a1590d4cc1225508a76d72>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,17 +19,17 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; export type RelayModernEnvironmentCommitPayloadTest3ActorQuery$variables = {||}; export type RelayModernEnvironmentCommitPayloadTest3ActorQuery$data = {| +me: ?{| - +name: ?string, +birthdate: ?{| +day: ?number, +month: ?number, +year: ?number, |}, + +name: ?string, |}, |}; export type RelayModernEnvironmentCommitPayloadTest3ActorQuery = {| - variables: RelayModernEnvironmentCommitPayloadTest3ActorQuery$variables, response: RelayModernEnvironmentCommitPayloadTest3ActorQuery$data, + variables: RelayModernEnvironmentCommitPayloadTest3ActorQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCommitPayloadTest4ActorQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCommitPayloadTest4ActorQuery.graphql.js index 8802fc2451217..269259980b233 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCommitPayloadTest4ActorQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCommitPayloadTest4ActorQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<7a812b90800d86cf37f746ccf9deba30>> + * @generated SignedSource<<557f5b1e08b9bc641868c9a1b5d4086a>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type RelayModernEnvironmentCommitPayloadTest4ActorQuery$data = {| |}, |}; export type RelayModernEnvironmentCommitPayloadTest4ActorQuery = {| - variables: RelayModernEnvironmentCommitPayloadTest4ActorQuery$variables, response: RelayModernEnvironmentCommitPayloadTest4ActorQuery$data, + variables: RelayModernEnvironmentCommitPayloadTest4ActorQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCommitPayloadTest6ActorQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCommitPayloadTest6ActorQuery.graphql.js index d39111eb933f6..7f9c78ef96170 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCommitPayloadTest6ActorQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCommitPayloadTest6ActorQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<2626f3469a50bde8b7d96394f2510733>> + * @generated SignedSource<<65e8d8f9f7a85d7f7f1dfada84e483e6>> * @flow * @lightSyntaxTransform * @nogrep @@ -33,8 +33,8 @@ export type RelayModernEnvironmentCommitPayloadTest6ActorQuery$data = {| |}, |}; export type RelayModernEnvironmentCommitPayloadTest6ActorQuery = {| - variables: RelayModernEnvironmentCommitPayloadTest6ActorQuery$variables, response: RelayModernEnvironmentCommitPayloadTest6ActorQuery$data, + variables: RelayModernEnvironmentCommitPayloadTest6ActorQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCommitPayloadTest6MarkdownUserNameRenderer_name.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCommitPayloadTest6MarkdownUserNameRenderer_name.graphql.js index 55c42a6a89be5..2383cd45c87ce 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCommitPayloadTest6MarkdownUserNameRenderer_name.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCommitPayloadTest6MarkdownUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<812c3317da58566787c8dd8078565482>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,8 +19,8 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentCommitPayloadTest6MarkdownUserNameRenderer_name$fragmentType: FragmentType; export type RelayModernEnvironmentCommitPayloadTest6MarkdownUserNameRenderer_name$data = {| - +markdown: ?string, +__typename: "MarkdownUserNameRenderer", + +markdown: ?string, +$fragmentType: RelayModernEnvironmentCommitPayloadTest6MarkdownUserNameRenderer_name$fragmentType, |}; export type RelayModernEnvironmentCommitPayloadTest6MarkdownUserNameRenderer_name$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCommitPayloadTestActorQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCommitPayloadTestActorQuery.graphql.js index b35d388bae001..89fe8d87dd42e 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCommitPayloadTestActorQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCommitPayloadTestActorQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<839c1588a900c2eff1864dc51292c014>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -23,8 +23,8 @@ export type RelayModernEnvironmentCommitPayloadTestActorQuery$data = {| |}, |}; export type RelayModernEnvironmentCommitPayloadTestActorQuery = {| - variables: RelayModernEnvironmentCommitPayloadTestActorQuery$variables, response: RelayModernEnvironmentCommitPayloadTestActorQuery$data, + variables: RelayModernEnvironmentCommitPayloadTestActorQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCommitUpdateTestParentQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCommitUpdateTestParentQuery.graphql.js index b30d077d107c1..05a79c490688d 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCommitUpdateTestParentQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentCommitUpdateTestParentQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<35e3f7bd0cbee5e0ef4dd6d1dcd02c00>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayModernEnvironmentCommitUpdateTestParentQuery$data = {| |}, |}; export type RelayModernEnvironmentCommitUpdateTestParentQuery = {| - variables: RelayModernEnvironmentCommitUpdateTestParentQuery$variables, response: RelayModernEnvironmentCommitUpdateTestParentQuery$data, + variables: RelayModernEnvironmentCommitUpdateTestParentQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConditionalSelectionsTestConditionalQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConditionalSelectionsTestConditionalQuery.graphql.js index eb61e87f2d705..45e60f9a5b3fa 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConditionalSelectionsTestConditionalQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConditionalSelectionsTestConditionalQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<65608697facd2e077491c7dd642da4d7>> + * @generated SignedSource<<8a9082dc0ac9597092aab241f4f465c1>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayModernEnvironmentConditionalSelectionsTestConditionalQuery$data +$fragmentSpreads: RelayModernEnvironmentConditionalSelectionsTestQueryConditionalFragment$fragmentType, |}; export type RelayModernEnvironmentConditionalSelectionsTestConditionalQuery = {| - variables: RelayModernEnvironmentConditionalSelectionsTestConditionalQuery$variables, response: RelayModernEnvironmentConditionalSelectionsTestConditionalQuery$data, + variables: RelayModernEnvironmentConditionalSelectionsTestConditionalQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConditionalSelectionsTestQueryConditionalFragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConditionalSelectionsTestQueryConditionalFragment.graphql.js index 01ed16c7c218c..b8c4c3f869d74 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConditionalSelectionsTestQueryConditionalFragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConditionalSelectionsTestQueryConditionalFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<8e4ed3a285173c5b34f15e5807dab8a8>> + * @generated SignedSource<<4d468675c808c98701022cdaf815ebb6>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,14 +19,14 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentConditionalSelectionsTestQueryConditionalFragment$fragmentType: FragmentType; export type RelayModernEnvironmentConditionalSelectionsTestQueryConditionalFragment$data = {| + +me?: ?{| + +name: ?string, + |}, +viewer?: ?{| +actor: ?{| +name: ?string, |}, |}, - +me?: ?{| - +name: ?string, - |}, +$fragmentType: RelayModernEnvironmentConditionalSelectionsTestQueryConditionalFragment$fragmentType, |}; export type RelayModernEnvironmentConditionalSelectionsTestQueryConditionalFragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConditionalSelectionsTestQueryUnconditionalFragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConditionalSelectionsTestQueryUnconditionalFragment.graphql.js index 078065d50e682..19f8ff84d1fb4 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConditionalSelectionsTestQueryUnconditionalFragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConditionalSelectionsTestQueryUnconditionalFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<1c621e65d25103aa0b406ae63cfa97fb>> + * @generated SignedSource<<78c8f6a93902260bca819c0fda221c67>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,14 +19,14 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentConditionalSelectionsTestQueryUnconditionalFragment$fragmentType: FragmentType; export type RelayModernEnvironmentConditionalSelectionsTestQueryUnconditionalFragment$data = {| + +me: ?{| + +name: ?string, + |}, +viewer: ?{| +actor: ?{| +name: ?string, |}, |}, - +me: ?{| - +name: ?string, - |}, +$fragmentType: RelayModernEnvironmentConditionalSelectionsTestQueryUnconditionalFragment$fragmentType, |}; export type RelayModernEnvironmentConditionalSelectionsTestQueryUnconditionalFragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConditionalSelectionsTestUnconditionalQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConditionalSelectionsTestUnconditionalQuery.graphql.js index e4ee47f6dc9e6..67bca0529eb13 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConditionalSelectionsTestUnconditionalQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConditionalSelectionsTestUnconditionalQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -22,8 +22,8 @@ export type RelayModernEnvironmentConditionalSelectionsTestUnconditionalQuery$da +$fragmentSpreads: RelayModernEnvironmentConditionalSelectionsTestQueryUnconditionalFragment$fragmentType, |}; export type RelayModernEnvironmentConditionalSelectionsTestUnconditionalQuery = {| - variables: RelayModernEnvironmentConditionalSelectionsTestUnconditionalQuery$variables, response: RelayModernEnvironmentConditionalSelectionsTestUnconditionalQuery$data, + variables: RelayModernEnvironmentConditionalSelectionsTestUnconditionalQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConnectionAndRequiredTestFeedbackFragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConnectionAndRequiredTestFeedbackFragment.graphql.js index ad68685e4213a..8b60bd3aae1da 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConnectionAndRequiredTestFeedbackFragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConnectionAndRequiredTestFeedbackFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<952232db1f5a77ee4f29da6cad4d2d7e>> + * @generated SignedSource<<5ae81c9063eaa8a5135b10093553cf94>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,7 +19,6 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentConnectionAndRequiredTestFeedbackFragment$fragmentType: FragmentType; export type RelayModernEnvironmentConnectionAndRequiredTestFeedbackFragment$data = ?{| - +id: string, +comments: {| +edges: ?$ReadOnlyArray, |}, + +id: string, +$fragmentType: RelayModernEnvironmentConnectionAndRequiredTestFeedbackFragment$fragmentType, |}; export type RelayModernEnvironmentConnectionAndRequiredTestFeedbackFragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConnectionAndRequiredTestFeedbackQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConnectionAndRequiredTestFeedbackQuery.graphql.js index 4bae79b1cee48..5bef2734eac68 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConnectionAndRequiredTestFeedbackQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConnectionAndRequiredTestFeedbackQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<9589cdcaac20857b6ad7802e9297b2ba>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayModernEnvironmentConnectionAndRequiredTestFeedbackQuery$data = |}, |}; export type RelayModernEnvironmentConnectionAndRequiredTestFeedbackQuery = {| - variables: RelayModernEnvironmentConnectionAndRequiredTestFeedbackQuery$variables, response: RelayModernEnvironmentConnectionAndRequiredTestFeedbackQuery$data, + variables: RelayModernEnvironmentConnectionAndRequiredTestFeedbackQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConnectionTestFeedbackFragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConnectionTestFeedbackFragment.graphql.js index d24317e65979e..bf883affcbf52 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConnectionTestFeedbackFragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConnectionTestFeedbackFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<23a81c12bae3fd148a218b0775e13878>> + * @generated SignedSource<<2ee7685ae5f207bc7d7ed28bf0b82adb>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,7 +19,6 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentConnectionTestFeedbackFragment$fragmentType: FragmentType; export type RelayModernEnvironmentConnectionTestFeedbackFragment$data = {| - +id: string, +comments: ?{| +edges: ?$ReadOnlyArray, |}, + +id: string, +$fragmentType: RelayModernEnvironmentConnectionTestFeedbackFragment$fragmentType, |}; export type RelayModernEnvironmentConnectionTestFeedbackFragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConnectionTestFeedbackQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConnectionTestFeedbackQuery.graphql.js index 1930e3476b0c1..7af8be7cdacd4 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConnectionTestFeedbackQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConnectionTestFeedbackQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayModernEnvironmentConnectionTestFeedbackQuery$data = {| |}, |}; export type RelayModernEnvironmentConnectionTestFeedbackQuery = {| - variables: RelayModernEnvironmentConnectionTestFeedbackQuery$variables, response: RelayModernEnvironmentConnectionTestFeedbackQuery$data, + variables: RelayModernEnvironmentConnectionTestFeedbackQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConnectionTestPaginationQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConnectionTestPaginationQuery.graphql.js index 00ebcacecf900..31ba632ad71d5 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConnectionTestPaginationQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentConnectionTestPaginationQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<6e9c9e3c2f1264c5f5e3b7fc12a9a87a>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -18,9 +18,9 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type RelayModernEnvironmentConnectionTestFeedbackFragment$fragmentType = any; export type RelayModernEnvironmentConnectionTestPaginationQuery$variables = {| - id: string, count: number, cursor: string, + id: string, |}; export type RelayModernEnvironmentConnectionTestPaginationQuery$data = {| +node: ?{| @@ -28,8 +28,8 @@ export type RelayModernEnvironmentConnectionTestPaginationQuery$data = {| |}, |}; export type RelayModernEnvironmentConnectionTestPaginationQuery = {| - variables: RelayModernEnvironmentConnectionTestPaginationQuery$variables, response: RelayModernEnvironmentConnectionTestPaginationQuery$data, + variables: RelayModernEnvironmentConnectionTestPaginationQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentDynamicConnectionKeyTestFeedbackFragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentDynamicConnectionKeyTestFeedbackFragment.graphql.js index 0af047013d776..eeece4e574433 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentDynamicConnectionKeyTestFeedbackFragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentDynamicConnectionKeyTestFeedbackFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<18cf5e5ea6fff5e13f9c41b0609eb9a0>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,7 +19,6 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentDynamicConnectionKeyTestFeedbackFragment$fragmentType: FragmentType; export type RelayModernEnvironmentDynamicConnectionKeyTestFeedbackFragment$data = {| - +id: string, +comments: ?{| +edges: ?$ReadOnlyArray, |}, + +id: string, +$fragmentType: RelayModernEnvironmentDynamicConnectionKeyTestFeedbackFragment$fragmentType, |}; export type RelayModernEnvironmentDynamicConnectionKeyTestFeedbackFragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentDynamicConnectionKeyTestFeedbackQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentDynamicConnectionKeyTestFeedbackQuery.graphql.js index b17788fbfaaa2..5f5655b592bd1 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentDynamicConnectionKeyTestFeedbackQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentDynamicConnectionKeyTestFeedbackQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<0e10d2cdcefdd03692a1c78177c0bddd>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type RelayModernEnvironmentDynamicConnectionKeyTestFeedbackFragment$fragmentType = any; export type RelayModernEnvironmentDynamicConnectionKeyTestFeedbackQuery$variables = {| - id: string, commentsKey?: ?string, + id: string, |}; export type RelayModernEnvironmentDynamicConnectionKeyTestFeedbackQuery$data = {| +node: ?{| @@ -27,8 +27,8 @@ export type RelayModernEnvironmentDynamicConnectionKeyTestFeedbackQuery$data = { |}, |}; export type RelayModernEnvironmentDynamicConnectionKeyTestFeedbackQuery = {| - variables: RelayModernEnvironmentDynamicConnectionKeyTestFeedbackQuery$variables, response: RelayModernEnvironmentDynamicConnectionKeyTestFeedbackQuery$data, + variables: RelayModernEnvironmentDynamicConnectionKeyTestFeedbackQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentDynamicConnectionKeyTestPaginationQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentDynamicConnectionKeyTestPaginationQuery.graphql.js index 28055f4e26216..87f40c4efca3f 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentDynamicConnectionKeyTestPaginationQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentDynamicConnectionKeyTestPaginationQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<19385543da476ab60b14739fb488b673>> + * @generated SignedSource<<349a985444f68f9a171d82d49a12858d>> * @flow * @lightSyntaxTransform * @nogrep @@ -18,10 +18,10 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type RelayModernEnvironmentDynamicConnectionKeyTestFeedbackFragment$fragmentType = any; export type RelayModernEnvironmentDynamicConnectionKeyTestPaginationQuery$variables = {| - id: string, commentsKey?: ?string, count: number, cursor: string, + id: string, |}; export type RelayModernEnvironmentDynamicConnectionKeyTestPaginationQuery$data = {| +node: ?{| @@ -29,8 +29,8 @@ export type RelayModernEnvironmentDynamicConnectionKeyTestPaginationQuery$data = |}, |}; export type RelayModernEnvironmentDynamicConnectionKeyTestPaginationQuery = {| - variables: RelayModernEnvironmentDynamicConnectionKeyTestPaginationQuery$variables, response: RelayModernEnvironmentDynamicConnectionKeyTestPaginationQuery$data, + variables: RelayModernEnvironmentDynamicConnectionKeyTestPaginationQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationTestCommentFragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationTestCommentFragment.graphql.js index e0df017ffb3e1..ed11842f4bd96 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationTestCommentFragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationTestCommentFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<64f9c518fdcebcfd4606bf0f3a77ca3b>> + * @generated SignedSource<<21793b75c68156e4e00b15f1c0e16fa5>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentExecuteMutationTestCommentFragment$fragmentType: FragmentType; export type RelayModernEnvironmentExecuteMutationTestCommentFragment$data = {| - +id: string, +body: ?{| +text: ?string, |}, + +id: string, +$fragmentType: RelayModernEnvironmentExecuteMutationTestCommentFragment$fragmentType, |}; export type RelayModernEnvironmentExecuteMutationTestCommentFragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationTestCommentQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationTestCommentQuery.graphql.js index 79a205c3ea611..cfdc79b5a9c08 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationTestCommentQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationTestCommentQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<3ad036581104fd74f043d59c62424c2e>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type RelayModernEnvironmentExecuteMutationTestCommentQuery$data = {| |}, |}; export type RelayModernEnvironmentExecuteMutationTestCommentQuery = {| - variables: RelayModernEnvironmentExecuteMutationTestCommentQuery$variables, response: RelayModernEnvironmentExecuteMutationTestCommentQuery$data, + variables: RelayModernEnvironmentExecuteMutationTestCommentQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationTestCreateCommentMutation.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationTestCreateCommentMutation.graphql.js index f1fcea2a50f20..9a979396f794d 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationTestCreateCommentMutation.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationTestCreateCommentMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<29673cfb2d657e3b38419d18bb73a6ef>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Mutation } from 'relay-runtime'; export type CommentCreateInput = {| clientMutationId?: ?string, - feedbackId?: ?string, feedback?: ?CommentfeedbackFeedback, + feedbackId?: ?string, |}; export type CommentfeedbackFeedback = {| comment?: ?FeedbackcommentComment, @@ -33,16 +33,16 @@ export type RelayModernEnvironmentExecuteMutationTestCreateCommentMutation$varia export type RelayModernEnvironmentExecuteMutationTestCreateCommentMutation$data = {| +commentCreate: ?{| +comment: ?{| - +id: string, +body: ?{| +text: ?string, |}, + +id: string, |}, |}, |}; export type RelayModernEnvironmentExecuteMutationTestCreateCommentMutation = {| - variables: RelayModernEnvironmentExecuteMutationTestCreateCommentMutation$variables, response: RelayModernEnvironmentExecuteMutationTestCreateCommentMutation$data, + variables: RelayModernEnvironmentExecuteMutationTestCreateCommentMutation$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationTestCreateCommentWithSpreadMutation.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationTestCreateCommentWithSpreadMutation.graphql.js index 1d1d0f21d97d0..d2de7b2aa20b5 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationTestCreateCommentWithSpreadMutation.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationTestCreateCommentWithSpreadMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<57b0239f696160f1a1d16f6394919f5a>> + * @generated SignedSource<<1194f1cf0cad5becd6c06708fe35443a>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,8 +19,8 @@ import type { ConcreteRequest, Mutation } from 'relay-runtime'; type RelayModernEnvironmentExecuteMutationTestCommentFragment$fragmentType = any; export type CommentCreateInput = {| clientMutationId?: ?string, - feedbackId?: ?string, feedback?: ?CommentfeedbackFeedback, + feedbackId?: ?string, |}; export type CommentfeedbackFeedback = {| comment?: ?FeedbackcommentComment, @@ -39,8 +39,8 @@ export type RelayModernEnvironmentExecuteMutationTestCreateCommentWithSpreadMuta |}, |}; export type RelayModernEnvironmentExecuteMutationTestCreateCommentWithSpreadMutation = {| - variables: RelayModernEnvironmentExecuteMutationTestCreateCommentWithSpreadMutation$variables, response: RelayModernEnvironmentExecuteMutationTestCreateCommentWithSpreadMutation$data, + variables: RelayModernEnvironmentExecuteMutationTestCreateCommentWithSpreadMutation$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendComment2Mutation.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendComment2Mutation.graphql.js index 3b46dea4a5c3a..d663ff86a289d 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendComment2Mutation.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendComment2Mutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<42be5b547c4db67ab0945fdeaf0b660b>> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Mutation } from 'relay-runtime'; export type CommentCreateInput = {| clientMutationId?: ?string, - feedbackId?: ?string, feedback?: ?CommentfeedbackFeedback, + feedbackId?: ?string, |}; export type CommentfeedbackFeedback = {| comment?: ?FeedbackcommentComment, @@ -42,8 +42,8 @@ export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppe |}, |}; export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendComment2Mutation = {| - variables: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendComment2Mutation$variables, response: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendComment2Mutation$data, + variables: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendComment2Mutation$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendCommentMutation.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendCommentMutation.graphql.js index fa7931da955d7..ac73e271ca8a4 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendCommentMutation.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendCommentMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<2b1b31e4e10016c4f57579f2b6c15c0e>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Mutation } from 'relay-runtime'; export type CommentCreateInput = {| clientMutationId?: ?string, - feedbackId?: ?string, feedback?: ?CommentfeedbackFeedback, + feedbackId?: ?string, |}; export type CommentfeedbackFeedback = {| comment?: ?FeedbackcommentComment, @@ -40,8 +40,8 @@ export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppe |}, |}; export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendCommentMutation = {| - variables: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendCommentMutation$variables, response: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendCommentMutation$data, + variables: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendCommentMutation$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendCommentWithLiteralEdgeMutation.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendCommentWithLiteralEdgeMutation.graphql.js index 1a7e7de2b485f..83fedc65ec6c6 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendCommentWithLiteralEdgeMutation.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendCommentWithLiteralEdgeMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Mutation } from 'relay-runtime'; export type CommentCreateInput = {| clientMutationId?: ?string, - feedbackId?: ?string, feedback?: ?CommentfeedbackFeedback, + feedbackId?: ?string, |}; export type CommentfeedbackFeedback = {| comment?: ?FeedbackcommentComment, @@ -39,8 +39,8 @@ export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppe |}, |}; export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendCommentWithLiteralEdgeMutation = {| - variables: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendCommentWithLiteralEdgeMutation$variables, response: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendCommentWithLiteralEdgeMutation$data, + variables: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendCommentWithLiteralEdgeMutation$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendComments3Mutation.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendComments3Mutation.graphql.js index 4bb5e674c6192..269bc400af0ce 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendComments3Mutation.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendComments3Mutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Mutation } from 'relay-runtime'; export type CommentsCreateInput = {| clientMutationId?: ?string, - feedbackId?: ?string, feedback?: ?$ReadOnlyArray, + feedbackId?: ?string, |}; export type CommentfeedbackFeedback = {| comment?: ?FeedbackcommentComment, @@ -42,8 +42,8 @@ export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppe |}, |}; export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendComments3Mutation = {| - variables: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendComments3Mutation$variables, response: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendComments3Mutation$data, + variables: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendComments3Mutation$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendCommentsMutation.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendCommentsMutation.graphql.js index 2f6a9278d694f..b43e5b602a9b7 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendCommentsMutation.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendCommentsMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<287d72748a4c57e95d479da50dceb763>> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Mutation } from 'relay-runtime'; export type CommentsCreateInput = {| clientMutationId?: ?string, - feedbackId?: ?string, feedback?: ?$ReadOnlyArray, + feedbackId?: ?string, |}; export type CommentfeedbackFeedback = {| comment?: ?FeedbackcommentComment, @@ -40,8 +40,8 @@ export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppe |}, |}; export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendCommentsMutation = {| - variables: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendCommentsMutation$variables, response: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendCommentsMutation$data, + variables: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestAppendCommentsMutation$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestComment1Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestComment1Query.graphql.js index 230ab9e29ea70..6211a82e5caff 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestComment1Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestComment1Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<32ae65b98a69039ebe0d68912a78127b>> * @flow * @lightSyntaxTransform * @nogrep @@ -21,15 +21,15 @@ export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestComm |}; export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestComment1Query$data = {| +node: ?{| - +id: string, +body: ?{| +text: ?string, |}, + +id: string, |}, |}; export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestComment1Query = {| - variables: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestComment1Query$variables, response: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestComment1Query$data, + variables: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestComment1Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestCommentQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestCommentQuery.graphql.js index fef356e195187..267e937fb62f1 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestCommentQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestCommentQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<7421cfe9eef94fbebb1b62552a112e59>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -21,15 +21,15 @@ export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestComm |}; export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestCommentQuery$data = {| +node: ?{| - +id: string, +body: ?{| +text: ?string, |}, + +id: string, |}, |}; export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestCommentQuery = {| - variables: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestCommentQuery$variables, response: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestCommentQuery$data, + variables: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestCommentQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDeleteComment1Mutation.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDeleteComment1Mutation.graphql.js index 8723fb13a9701..90a62d06bbfe1 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDeleteComment1Mutation.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDeleteComment1Mutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<06ab1b1998a20bbf4d8917940cb0aa14>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -29,8 +29,8 @@ export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDele |}, |}; export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDeleteComment1Mutation = {| - variables: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDeleteComment1Mutation$variables, response: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDeleteComment1Mutation$data, + variables: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDeleteComment1Mutation$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDeleteCommentMutation.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDeleteCommentMutation.graphql.js index a9f7065dd47ac..54ff1ece5a43b 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDeleteCommentMutation.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDeleteCommentMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<79683a91317e16dc6643f05e7b05ca4d>> + * @generated SignedSource<<78acc1214aa0d294b91a181e6f4a0679>> * @flow * @lightSyntaxTransform * @nogrep @@ -30,8 +30,8 @@ export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDele |}, |}; export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDeleteCommentMutation = {| - variables: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDeleteCommentMutation$variables, response: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDeleteCommentMutation$data, + variables: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDeleteCommentMutation$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDeleteCommentsEdgeMutation.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDeleteCommentsEdgeMutation.graphql.js index 75462ba5cefd5..f5f3a931da226 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDeleteCommentsEdgeMutation.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDeleteCommentsEdgeMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<8bf60ce256563cc2603854bf9f7ba77f>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -30,8 +30,8 @@ export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDele |}, |}; export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDeleteCommentsEdgeMutation = {| - variables: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDeleteCommentsEdgeMutation$variables, response: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDeleteCommentsEdgeMutation$data, + variables: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDeleteCommentsEdgeMutation$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDeleteCommentsMutation.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDeleteCommentsMutation.graphql.js index 91ee4bb2dbe07..0001199e92ea4 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDeleteCommentsMutation.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDeleteCommentsMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<3bb264fbb76fe20d374ed37714722048>> + * @generated SignedSource<<229bc498f9e5be1fddbd4739031127ff>> * @flow * @lightSyntaxTransform * @nogrep @@ -29,8 +29,8 @@ export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDele |}, |}; export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDeleteCommentsMutation = {| - variables: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDeleteCommentsMutation$variables, response: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDeleteCommentsMutation$data, + variables: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestDeleteCommentsMutation$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestFeedback2Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestFeedback2Query.graphql.js index 7ceac2e1dc0f2..55415e437d520 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestFeedback2Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestFeedback2Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<4c52f681403017a307827ba5e2eaad65>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -34,8 +34,8 @@ export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestFeed |}, |}; export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestFeedback2Query = {| - variables: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestFeedback2Query$variables, response: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestFeedback2Query$data, + variables: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestFeedback2Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestFeedback3Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestFeedback3Query.graphql.js index 650fd653275ef..f10783e7b35e7 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestFeedback3Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestFeedback3Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<6340c5f4612919117096f98e6f66c381>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -33,8 +33,8 @@ export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestFeed |}, |}; export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestFeedback3Query = {| - variables: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestFeedback3Query$variables, response: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestFeedback3Query$data, + variables: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestFeedback3Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrependComment3Mutation.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrependComment3Mutation.graphql.js index 1b50dbce109a6..ee28389347425 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrependComment3Mutation.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrependComment3Mutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<2f254fafeff0021fb685a71ef07f63f5>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Mutation } from 'relay-runtime'; export type CommentCreateInput = {| clientMutationId?: ?string, - feedbackId?: ?string, feedback?: ?CommentfeedbackFeedback, + feedbackId?: ?string, |}; export type CommentfeedbackFeedback = {| comment?: ?FeedbackcommentComment, @@ -40,8 +40,8 @@ export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrep |}, |}; export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrependComment3Mutation = {| - variables: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrependComment3Mutation$variables, response: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrependComment3Mutation$data, + variables: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrependComment3Mutation$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrependCommentMutation.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrependCommentMutation.graphql.js index 2db84f4643282..a3e390740719c 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrependCommentMutation.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrependCommentMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Mutation } from 'relay-runtime'; export type CommentCreateInput = {| clientMutationId?: ?string, - feedbackId?: ?string, feedback?: ?CommentfeedbackFeedback, + feedbackId?: ?string, |}; export type CommentfeedbackFeedback = {| comment?: ?FeedbackcommentComment, @@ -42,8 +42,8 @@ export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrep |}, |}; export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrependCommentMutation = {| - variables: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrependCommentMutation$variables, response: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrependCommentMutation$data, + variables: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrependCommentMutation$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrependComments2Mutation.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrependComments2Mutation.graphql.js index 4e64cd054e6dc..e3e0b251f9116 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrependComments2Mutation.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrependComments2Mutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<7e6e03c07de7c0b17ea8555b281fb663>> + * @generated SignedSource<<3f7890ce464690e747dcb7b0f9720f3c>> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Mutation } from 'relay-runtime'; export type CommentsCreateInput = {| clientMutationId?: ?string, - feedbackId?: ?string, feedback?: ?$ReadOnlyArray, + feedbackId?: ?string, |}; export type CommentfeedbackFeedback = {| comment?: ?FeedbackcommentComment, @@ -42,8 +42,8 @@ export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrep |}, |}; export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrependComments2Mutation = {| - variables: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrependComments2Mutation$variables, response: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrependComments2Mutation$data, + variables: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrependComments2Mutation$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrependCommentsMutation.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrependCommentsMutation.graphql.js index 83c4d3b98a1ba..7ffb403ad151b 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrependCommentsMutation.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrependCommentsMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<639202cbc6e70a8f7706dab969ee7bc5>> + * @generated SignedSource<<8c19d8c92db75a9631e63299364aa52c>> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Mutation } from 'relay-runtime'; export type CommentsCreateInput = {| clientMutationId?: ?string, - feedbackId?: ?string, feedback?: ?$ReadOnlyArray, + feedbackId?: ?string, |}; export type CommentfeedbackFeedback = {| comment?: ?FeedbackcommentComment, @@ -40,8 +40,8 @@ export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrep |}, |}; export type RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrependCommentsMutation = {| - variables: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrependCommentsMutation$variables, response: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrependCommentsMutation$data, + variables: RelayModernEnvironmentExecuteMutationWithDeclarativeMutationTestPrependCommentsMutation$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithFlightTest_FlightQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithFlightTest_FlightQuery.graphql.js index dff01de698253..966781e136e32 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithFlightTest_FlightQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithFlightTest_FlightQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<735e2f60b5083bbb7f31fa662103f59d>> + * @generated SignedSource<<73d67234525019417f253828551143ed>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,8 +19,8 @@ /*:: import type { ConcreteRequest, Query } from 'relay-runtime'; export type RelayModernEnvironmentExecuteMutationWithFlightTest_FlightQuery$variables = {| - id: string, count: number, + id: string, |}; export type RelayModernEnvironmentExecuteMutationWithFlightTest_FlightQuery$data = {| +node: ?{| @@ -28,8 +28,8 @@ export type RelayModernEnvironmentExecuteMutationWithFlightTest_FlightQuery$data |}, |}; export type RelayModernEnvironmentExecuteMutationWithFlightTest_FlightQuery = {| - variables: RelayModernEnvironmentExecuteMutationWithFlightTest_FlightQuery$variables, response: RelayModernEnvironmentExecuteMutationWithFlightTest_FlightQuery$data, + variables: RelayModernEnvironmentExecuteMutationWithFlightTest_FlightQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithFlightTest_InnerQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithFlightTest_InnerQuery.graphql.js index 91288146dce74..419d8b05e0b72 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithFlightTest_InnerQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithFlightTest_InnerQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<32a8dbeaf21a7057f245a64ec6bb1f60>> + * @generated SignedSource<<04b692f51c54fcff264e06c25e5a0066>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type RelayModernEnvironmentExecuteMutationWithFlightTest_InnerQuery$data |}, |}; export type RelayModernEnvironmentExecuteMutationWithFlightTest_InnerQuery = {| - variables: RelayModernEnvironmentExecuteMutationWithFlightTest_InnerQuery$variables, response: RelayModernEnvironmentExecuteMutationWithFlightTest_InnerQuery$data, + variables: RelayModernEnvironmentExecuteMutationWithFlightTest_InnerQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithFlightTest_UpdateStoryMutation.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithFlightTest_UpdateStoryMutation.graphql.js index f98389443e4fc..9d964a4b9f5a3 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithFlightTest_UpdateStoryMutation.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithFlightTest_UpdateStoryMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<1ea2dfdccf059b0c76f777a90b0b3277>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,31 +19,31 @@ /*:: import type { ConcreteRequest, Mutation } from 'relay-runtime'; export type StoryUpdateInput = {| - clientMutationId?: ?string, body?: ?InputText, + clientMutationId?: ?string, |}; export type InputText = {| - text?: ?string, ranges?: ?$ReadOnlyArray, + text?: ?string, |}; export type RelayModernEnvironmentExecuteMutationWithFlightTest_UpdateStoryMutation$variables = {| - input: StoryUpdateInput, count: number, + input: StoryUpdateInput, |}; export type RelayModernEnvironmentExecuteMutationWithFlightTest_UpdateStoryMutation$data = {| +storyUpdate: ?{| +story: ?{| - +id: string, +body: ?{| +text: ?string, |}, +flightComponent: ?any, + +id: string, |}, |}, |}; export type RelayModernEnvironmentExecuteMutationWithFlightTest_UpdateStoryMutation = {| - variables: RelayModernEnvironmentExecuteMutationWithFlightTest_UpdateStoryMutation$variables, response: RelayModernEnvironmentExecuteMutationWithFlightTest_UpdateStoryMutation$data, + variables: RelayModernEnvironmentExecuteMutationWithFlightTest_UpdateStoryMutation$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithGlobalInvalidationTestCommentFragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithGlobalInvalidationTestCommentFragment.graphql.js index 468bedc24ecc9..1a5fa4d577a78 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithGlobalInvalidationTestCommentFragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithGlobalInvalidationTestCommentFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<64c91a2f875e4be5c4edac2093232a6a>> + * @generated SignedSource<<082d127967eae51937fffcc18f59cca4>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentExecuteMutationWithGlobalInvalidationTestCommentFragment$fragmentType: FragmentType; export type RelayModernEnvironmentExecuteMutationWithGlobalInvalidationTestCommentFragment$data = {| - +id: string, +body: ?{| +text: ?string, |}, + +id: string, +$fragmentType: RelayModernEnvironmentExecuteMutationWithGlobalInvalidationTestCommentFragment$fragmentType, |}; export type RelayModernEnvironmentExecuteMutationWithGlobalInvalidationTestCommentFragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithGlobalInvalidationTestCommentQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithGlobalInvalidationTestCommentQuery.graphql.js index 65a0f8eaf5ea1..57a6c424db3fe 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithGlobalInvalidationTestCommentQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithGlobalInvalidationTestCommentQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<2746dbc65ff25422393f0587f05d604c>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type RelayModernEnvironmentExecuteMutationWithGlobalInvalidationTestComme |}, |}; export type RelayModernEnvironmentExecuteMutationWithGlobalInvalidationTestCommentQuery = {| - variables: RelayModernEnvironmentExecuteMutationWithGlobalInvalidationTestCommentQuery$variables, response: RelayModernEnvironmentExecuteMutationWithGlobalInvalidationTestCommentQuery$data, + variables: RelayModernEnvironmentExecuteMutationWithGlobalInvalidationTestCommentQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithGlobalInvalidationTestCreateCommentMutation.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithGlobalInvalidationTestCreateCommentMutation.graphql.js index da424f563c236..cd272761ed5cb 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithGlobalInvalidationTestCreateCommentMutation.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithGlobalInvalidationTestCreateCommentMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<8af2834509919675818e4ba04dc6e212>> + * @generated SignedSource<<6cfff3c401aa5ea8a555b833526cd2ed>> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Mutation } from 'relay-runtime'; export type CommentCreateInput = {| clientMutationId?: ?string, - feedbackId?: ?string, feedback?: ?CommentfeedbackFeedback, + feedbackId?: ?string, |}; export type CommentfeedbackFeedback = {| comment?: ?FeedbackcommentComment, @@ -33,16 +33,16 @@ export type RelayModernEnvironmentExecuteMutationWithGlobalInvalidationTestCreat export type RelayModernEnvironmentExecuteMutationWithGlobalInvalidationTestCreateCommentMutation$data = {| +commentCreate: ?{| +comment: ?{| - +id: string, +body: ?{| +text: ?string, |}, + +id: string, |}, |}, |}; export type RelayModernEnvironmentExecuteMutationWithGlobalInvalidationTestCreateCommentMutation = {| - variables: RelayModernEnvironmentExecuteMutationWithGlobalInvalidationTestCreateCommentMutation$variables, response: RelayModernEnvironmentExecuteMutationWithGlobalInvalidationTestCreateCommentMutation$data, + variables: RelayModernEnvironmentExecuteMutationWithGlobalInvalidationTestCreateCommentMutation$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithLocalInvalidationTestCommentFragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithLocalInvalidationTestCommentFragment.graphql.js index 7ae2133efacba..bade2c4a58a11 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithLocalInvalidationTestCommentFragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithLocalInvalidationTestCommentFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<4b470b014a22a1a5c6faa04c2609e7b6>> + * @generated SignedSource<<760999fe9024b7bd0443c5b9989d175b>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentExecuteMutationWithLocalInvalidationTestCommentFragment$fragmentType: FragmentType; export type RelayModernEnvironmentExecuteMutationWithLocalInvalidationTestCommentFragment$data = {| - +id: string, +body: ?{| +text: ?string, |}, + +id: string, +$fragmentType: RelayModernEnvironmentExecuteMutationWithLocalInvalidationTestCommentFragment$fragmentType, |}; export type RelayModernEnvironmentExecuteMutationWithLocalInvalidationTestCommentFragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithLocalInvalidationTestCommentQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithLocalInvalidationTestCommentQuery.graphql.js index bc597293127b0..1bf228401a5c3 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithLocalInvalidationTestCommentQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithLocalInvalidationTestCommentQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<5799f58b78b69c9e4d2dbedf5f6e8562>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type RelayModernEnvironmentExecuteMutationWithLocalInvalidationTestCommen |}, |}; export type RelayModernEnvironmentExecuteMutationWithLocalInvalidationTestCommentQuery = {| - variables: RelayModernEnvironmentExecuteMutationWithLocalInvalidationTestCommentQuery$variables, response: RelayModernEnvironmentExecuteMutationWithLocalInvalidationTestCommentQuery$data, + variables: RelayModernEnvironmentExecuteMutationWithLocalInvalidationTestCommentQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithLocalInvalidationTestCreateCommentMutation.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithLocalInvalidationTestCreateCommentMutation.graphql.js index 2b8b25168b4c3..e31ce92d7dc61 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithLocalInvalidationTestCreateCommentMutation.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithLocalInvalidationTestCreateCommentMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<2aca91ef74271f971730b61aa959f947>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Mutation } from 'relay-runtime'; export type CommentCreateInput = {| clientMutationId?: ?string, - feedbackId?: ?string, feedback?: ?CommentfeedbackFeedback, + feedbackId?: ?string, |}; export type CommentfeedbackFeedback = {| comment?: ?FeedbackcommentComment, @@ -33,16 +33,16 @@ export type RelayModernEnvironmentExecuteMutationWithLocalInvalidationTestCreate export type RelayModernEnvironmentExecuteMutationWithLocalInvalidationTestCreateCommentMutation$data = {| +commentCreate: ?{| +comment: ?{| - +id: string, +body: ?{| +text: ?string, |}, + +id: string, |}, |}, |}; export type RelayModernEnvironmentExecuteMutationWithLocalInvalidationTestCreateCommentMutation = {| - variables: RelayModernEnvironmentExecuteMutationWithLocalInvalidationTestCreateCommentMutation$variables, response: RelayModernEnvironmentExecuteMutationWithLocalInvalidationTestCreateCommentMutation$data, + variables: RelayModernEnvironmentExecuteMutationWithLocalInvalidationTestCreateCommentMutation$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithMatchTestCommentFragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithMatchTestCommentFragment.graphql.js index 4bb5ac3eee84f..0314496b4635a 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithMatchTestCommentFragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithMatchTestCommentFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<8386b5d6b9a42a625d24cd86c543c375>> + * @generated SignedSource<<36739a2e03132d8d35c96cc452dea6ff>> * @flow * @lightSyntaxTransform * @nogrep @@ -23,7 +23,6 @@ type RelayModernEnvironmentExecuteMutationWithMatchTestPlainUserNameRenderer_nam import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentExecuteMutationWithMatchTestCommentFragment$fragmentType: FragmentType; export type RelayModernEnvironmentExecuteMutationWithMatchTestCommentFragment$data = {| - +id: string, +actor: ?{| +name: ?string, +nameRenderer: ?{| @@ -32,6 +31,7 @@ export type RelayModernEnvironmentExecuteMutationWithMatchTestCommentFragment$da +$fragmentSpreads: RelayModernEnvironmentExecuteMutationWithMatchTestPlainUserNameRenderer_name$fragmentType & RelayModernEnvironmentExecuteMutationWithMatchTestMarkdownUserNameRenderer_name$fragmentType, |}, |}, + +id: string, +$fragmentType: RelayModernEnvironmentExecuteMutationWithMatchTestCommentFragment$fragmentType, |}; export type RelayModernEnvironmentExecuteMutationWithMatchTestCommentFragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithMatchTestCommentQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithMatchTestCommentQuery.graphql.js index 42ebdcd18f050..6caaf40bb3f62 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithMatchTestCommentQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithMatchTestCommentQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<7c2c5771f0fa078aeb8a22f6f64d9d72>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type RelayModernEnvironmentExecuteMutationWithMatchTestCommentQuery$data |}, |}; export type RelayModernEnvironmentExecuteMutationWithMatchTestCommentQuery = {| - variables: RelayModernEnvironmentExecuteMutationWithMatchTestCommentQuery$variables, response: RelayModernEnvironmentExecuteMutationWithMatchTestCommentQuery$data, + variables: RelayModernEnvironmentExecuteMutationWithMatchTestCommentQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithMatchTestCreateCommentMutation.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithMatchTestCreateCommentMutation.graphql.js index 4eac651596485..5e53d84bb1d82 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithMatchTestCreateCommentMutation.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithMatchTestCreateCommentMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<31030e45d3fce4ff215890310856c5bf>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -22,8 +22,8 @@ type RelayModernEnvironmentExecuteMutationWithMatchTestMarkdownUserNameRenderer_ type RelayModernEnvironmentExecuteMutationWithMatchTestPlainUserNameRenderer_name$fragmentType = any; export type CommentCreateInput = {| clientMutationId?: ?string, - feedbackId?: ?string, feedback?: ?CommentfeedbackFeedback, + feedbackId?: ?string, |}; export type CommentfeedbackFeedback = {| comment?: ?FeedbackcommentComment, @@ -49,8 +49,8 @@ export type RelayModernEnvironmentExecuteMutationWithMatchTestCreateCommentMutat |}, |}; export type RelayModernEnvironmentExecuteMutationWithMatchTestCreateCommentMutation = {| - variables: RelayModernEnvironmentExecuteMutationWithMatchTestCreateCommentMutation$variables, response: RelayModernEnvironmentExecuteMutationWithMatchTestCreateCommentMutation$data, + variables: RelayModernEnvironmentExecuteMutationWithMatchTestCreateCommentMutation$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithMatchTestMarkdownUserNameRenderer_name.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithMatchTestMarkdownUserNameRenderer_name.graphql.js index 8437249bb2671..6a80993898853 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithMatchTestMarkdownUserNameRenderer_name.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithMatchTestMarkdownUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<00facf83692883f004e26b9d8977479f>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,11 +19,11 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentExecuteMutationWithMatchTestMarkdownUserNameRenderer_name$fragmentType: FragmentType; export type RelayModernEnvironmentExecuteMutationWithMatchTestMarkdownUserNameRenderer_name$data = {| - +markdown: ?string, + +__typename: "MarkdownUserNameRenderer", +data: ?{| +markup: ?string, |}, - +__typename: "MarkdownUserNameRenderer", + +markdown: ?string, +$fragmentType: RelayModernEnvironmentExecuteMutationWithMatchTestMarkdownUserNameRenderer_name$fragmentType, |}; export type RelayModernEnvironmentExecuteMutationWithMatchTestMarkdownUserNameRenderer_name$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithMatchTestPlainUserNameRenderer_name.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithMatchTestPlainUserNameRenderer_name.graphql.js index d8523c6a573de..f0e1f8137bb57 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithMatchTestPlainUserNameRenderer_name.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteMutationWithMatchTestPlainUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<921bcb736ff4707e2e4f5a109852cfb8>> + * @generated SignedSource<<75e5defea7723edca1f8fe1fa7bc931b>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentExecuteMutationWithMatchTestPlainUserNameRenderer_name$fragmentType: FragmentType; export type RelayModernEnvironmentExecuteMutationWithMatchTestPlainUserNameRenderer_name$data = {| - +plaintext: ?string, +data: ?{| +text: ?string, |}, + +plaintext: ?string, +$fragmentType: RelayModernEnvironmentExecuteMutationWithMatchTestPlainUserNameRenderer_name$fragmentType, |}; export type RelayModernEnvironmentExecuteMutationWithMatchTestPlainUserNameRenderer_name$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionTestCommentCreateSubscription.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionTestCommentCreateSubscription.graphql.js index e54d3cf6f38a0..329c16ee3cc93 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionTestCommentCreateSubscription.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionTestCommentCreateSubscription.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<28702547ceaf32addb02ca3a9805c2f9>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,16 +27,16 @@ export type RelayModernEnvironmentExecuteSubscriptionTestCommentCreateSubscripti export type RelayModernEnvironmentExecuteSubscriptionTestCommentCreateSubscription$data = {| +commentCreateSubscribe: ?{| +comment: ?{| - +id: string, +body: ?{| +text: ?string, |}, + +id: string, |}, |}, |}; export type RelayModernEnvironmentExecuteSubscriptionTestCommentCreateSubscription = {| - variables: RelayModernEnvironmentExecuteSubscriptionTestCommentCreateSubscription$variables, response: RelayModernEnvironmentExecuteSubscriptionTestCommentCreateSubscription$data, + variables: RelayModernEnvironmentExecuteSubscriptionTestCommentCreateSubscription$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionTestCommentFragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionTestCommentFragment.graphql.js index f55fc3e4db0bc..d44d78765abc5 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionTestCommentFragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionTestCommentFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<2e0b70cfcde8ff2569c93bd45f908bae>> + * @generated SignedSource<<3b600eeeb386eab1722e6e63380e8f13>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentExecuteSubscriptionTestCommentFragment$fragmentType: FragmentType; export type RelayModernEnvironmentExecuteSubscriptionTestCommentFragment$data = {| - +id: string, +body: ?{| +text: ?string, |}, + +id: string, +$fragmentType: RelayModernEnvironmentExecuteSubscriptionTestCommentFragment$fragmentType, |}; export type RelayModernEnvironmentExecuteSubscriptionTestCommentFragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionTestCommentQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionTestCommentQuery.graphql.js index f163876f8ca0a..702e3de1c45c9 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionTestCommentQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionTestCommentQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<7e992508425749bbf0d4358a2ed51053>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type RelayModernEnvironmentExecuteSubscriptionTestCommentQuery$data = {| |}, |}; export type RelayModernEnvironmentExecuteSubscriptionTestCommentQuery = {| - variables: RelayModernEnvironmentExecuteSubscriptionTestCommentQuery$variables, response: RelayModernEnvironmentExecuteSubscriptionTestCommentQuery$data, + variables: RelayModernEnvironmentExecuteSubscriptionTestCommentQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithDeferTestCommentCreateSubscription.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithDeferTestCommentCreateSubscription.graphql.js index 4e3d2a90959be..d478007301537 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithDeferTestCommentCreateSubscription.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithDeferTestCommentCreateSubscription.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<15ff57c5792d5c6bf4ec42a97f217d74>> + * @generated SignedSource<<2a58b48f4be13b72f25fdd65aaf1a844>> * @flow * @lightSyntaxTransform * @nogrep @@ -34,8 +34,8 @@ export type RelayModernEnvironmentExecuteSubscriptionWithDeferTestCommentCreateS |}, |}; export type RelayModernEnvironmentExecuteSubscriptionWithDeferTestCommentCreateSubscription = {| - variables: RelayModernEnvironmentExecuteSubscriptionWithDeferTestCommentCreateSubscription$variables, response: RelayModernEnvironmentExecuteSubscriptionWithDeferTestCommentCreateSubscription$data, + variables: RelayModernEnvironmentExecuteSubscriptionWithDeferTestCommentCreateSubscription$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithDeferTestCommentFragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithDeferTestCommentFragment.graphql.js index 6e6984cd34b01..ff6d77a5b66c5 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithDeferTestCommentFragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithDeferTestCommentFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<6b3e2a7543843e819cc31f01dad5b9ea>> + * @generated SignedSource<<2be2da3604c1ba5fb3a165d30088ce54>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentExecuteSubscriptionWithDeferTestCommentFragment$fragmentType: FragmentType; export type RelayModernEnvironmentExecuteSubscriptionWithDeferTestCommentFragment$data = {| - +id: string, +actor: ?{| +name: ?string, |}, + +id: string, +$fragmentType: RelayModernEnvironmentExecuteSubscriptionWithDeferTestCommentFragment$fragmentType, |}; export type RelayModernEnvironmentExecuteSubscriptionWithDeferTestCommentFragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithDeferTestCommentQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithDeferTestCommentQuery.graphql.js index 6e512e00017a7..888bd4d05f5af 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithDeferTestCommentQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithDeferTestCommentQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<9721857c4fced8038868b8f56753d97b>> + * @generated SignedSource<<76a090cddaa5b293c562cd0134e132c6>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type RelayModernEnvironmentExecuteSubscriptionWithDeferTestCommentQuery$d |}, |}; export type RelayModernEnvironmentExecuteSubscriptionWithDeferTestCommentQuery = {| - variables: RelayModernEnvironmentExecuteSubscriptionWithDeferTestCommentQuery$variables, response: RelayModernEnvironmentExecuteSubscriptionWithDeferTestCommentQuery$data, + variables: RelayModernEnvironmentExecuteSubscriptionWithDeferTestCommentQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithMatchTestCommentCreateSubscription.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithMatchTestCommentCreateSubscription.graphql.js index 703b7d48783ac..5e03453bf6ba0 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithMatchTestCommentCreateSubscription.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithMatchTestCommentCreateSubscription.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<3ffa8777b723fc2484658836d40a375b>> + * @generated SignedSource<<8d6820f46ea63084edf5242e281da6cc>> * @flow * @lightSyntaxTransform * @nogrep @@ -43,8 +43,8 @@ export type RelayModernEnvironmentExecuteSubscriptionWithMatchTestCommentCreateS |}, |}; export type RelayModernEnvironmentExecuteSubscriptionWithMatchTestCommentCreateSubscription = {| - variables: RelayModernEnvironmentExecuteSubscriptionWithMatchTestCommentCreateSubscription$variables, response: RelayModernEnvironmentExecuteSubscriptionWithMatchTestCommentCreateSubscription$data, + variables: RelayModernEnvironmentExecuteSubscriptionWithMatchTestCommentCreateSubscription$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithMatchTestCommentFragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithMatchTestCommentFragment.graphql.js index 7a4d73049dc7f..b48c9890fa245 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithMatchTestCommentFragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithMatchTestCommentFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<2ad9a7c223c41baee30956c2def9faba>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -23,7 +23,6 @@ type RelayModernEnvironmentExecuteSubscriptionWithMatchTestPlainUserNameRenderer import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentExecuteSubscriptionWithMatchTestCommentFragment$fragmentType: FragmentType; export type RelayModernEnvironmentExecuteSubscriptionWithMatchTestCommentFragment$data = {| - +id: string, +actor: ?{| +name: ?string, +nameRenderer: ?{| @@ -32,6 +31,7 @@ export type RelayModernEnvironmentExecuteSubscriptionWithMatchTestCommentFragmen +$fragmentSpreads: RelayModernEnvironmentExecuteSubscriptionWithMatchTestPlainUserNameRenderer_name$fragmentType & RelayModernEnvironmentExecuteSubscriptionWithMatchTestMarkdownUserNameRenderer_name$fragmentType, |}, |}, + +id: string, +$fragmentType: RelayModernEnvironmentExecuteSubscriptionWithMatchTestCommentFragment$fragmentType, |}; export type RelayModernEnvironmentExecuteSubscriptionWithMatchTestCommentFragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithMatchTestCommentQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithMatchTestCommentQuery.graphql.js index e3cc5a244f5c7..b25b40f3193bc 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithMatchTestCommentQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithMatchTestCommentQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<7d9eb3ff171cdae55d3223bfc05ebb02>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type RelayModernEnvironmentExecuteSubscriptionWithMatchTestCommentQuery$d |}, |}; export type RelayModernEnvironmentExecuteSubscriptionWithMatchTestCommentQuery = {| - variables: RelayModernEnvironmentExecuteSubscriptionWithMatchTestCommentQuery$variables, response: RelayModernEnvironmentExecuteSubscriptionWithMatchTestCommentQuery$data, + variables: RelayModernEnvironmentExecuteSubscriptionWithMatchTestCommentQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithMatchTestMarkdownUserNameRenderer_name.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithMatchTestMarkdownUserNameRenderer_name.graphql.js index d9ab712ee860c..3a7f811b7f3fa 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithMatchTestMarkdownUserNameRenderer_name.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithMatchTestMarkdownUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<7b0a270b6618c75a4a2ebcbcd99b056b>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,11 +19,11 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentExecuteSubscriptionWithMatchTestMarkdownUserNameRenderer_name$fragmentType: FragmentType; export type RelayModernEnvironmentExecuteSubscriptionWithMatchTestMarkdownUserNameRenderer_name$data = {| - +markdown: ?string, + +__typename: "MarkdownUserNameRenderer", +data: ?{| +markup: ?string, |}, - +__typename: "MarkdownUserNameRenderer", + +markdown: ?string, +$fragmentType: RelayModernEnvironmentExecuteSubscriptionWithMatchTestMarkdownUserNameRenderer_name$fragmentType, |}; export type RelayModernEnvironmentExecuteSubscriptionWithMatchTestMarkdownUserNameRenderer_name$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithMatchTestPlainUserNameRenderer_name.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithMatchTestPlainUserNameRenderer_name.graphql.js index 3c92d9d618f37..f53d3814f9b2d 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithMatchTestPlainUserNameRenderer_name.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithMatchTestPlainUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<2ac718653f6f5cacc1a378ed3e8ebd2f>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentExecuteSubscriptionWithMatchTestPlainUserNameRenderer_name$fragmentType: FragmentType; export type RelayModernEnvironmentExecuteSubscriptionWithMatchTestPlainUserNameRenderer_name$data = {| - +plaintext: ?string, +data: ?{| +text: ?string, |}, + +plaintext: ?string, +$fragmentType: RelayModernEnvironmentExecuteSubscriptionWithMatchTestPlainUserNameRenderer_name$fragmentType, |}; export type RelayModernEnvironmentExecuteSubscriptionWithMatchTestPlainUserNameRenderer_name$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithStreamTestCommentCreateSubscription.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithStreamTestCommentCreateSubscription.graphql.js index ced8a2c1738f5..2caa30b42ca70 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithStreamTestCommentCreateSubscription.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithStreamTestCommentCreateSubscription.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<6d14f1e479c0fb23bd70abe45661b3c4>> * @flow * @lightSyntaxTransform * @nogrep @@ -33,8 +33,8 @@ export type RelayModernEnvironmentExecuteSubscriptionWithStreamTestCommentCreate |}, |}; export type RelayModernEnvironmentExecuteSubscriptionWithStreamTestCommentCreateSubscription = {| - variables: RelayModernEnvironmentExecuteSubscriptionWithStreamTestCommentCreateSubscription$variables, response: RelayModernEnvironmentExecuteSubscriptionWithStreamTestCommentCreateSubscription$data, + variables: RelayModernEnvironmentExecuteSubscriptionWithStreamTestCommentCreateSubscription$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithStreamTestFeedbackFragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithStreamTestFeedbackFragment.graphql.js index 2cca4a3013cbf..4dcedf8b2f24e 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithStreamTestFeedbackFragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithStreamTestFeedbackFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<607e11dafc9e1f88d1d797657208475b>> + * @generated SignedSource<<7d70448b127faa7876e05a85bacb55af>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentExecuteSubscriptionWithStreamTestFeedbackFragment$fragmentType: FragmentType; export type RelayModernEnvironmentExecuteSubscriptionWithStreamTestFeedbackFragment$data = {| - +id: string, +actors: ?$ReadOnlyArray, + +id: string, +$fragmentType: RelayModernEnvironmentExecuteSubscriptionWithStreamTestFeedbackFragment$fragmentType, |}; export type RelayModernEnvironmentExecuteSubscriptionWithStreamTestFeedbackFragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithStreamTestFeedbackQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithStreamTestFeedbackQuery.graphql.js index 12ab6f60878dd..01c7af9cb0186 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithStreamTestFeedbackQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteSubscriptionWithStreamTestFeedbackQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<3254fe79b85223e88506fc576518029b>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type RelayModernEnvironmentExecuteSubscriptionWithStreamTestFeedbackQuery |}, |}; export type RelayModernEnvironmentExecuteSubscriptionWithStreamTestFeedbackQuery = {| - variables: RelayModernEnvironmentExecuteSubscriptionWithStreamTestFeedbackQuery$variables, response: RelayModernEnvironmentExecuteSubscriptionWithStreamTestFeedbackQuery$data, + variables: RelayModernEnvironmentExecuteSubscriptionWithStreamTestFeedbackQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithDeferAndModuleTestQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithDeferAndModuleTestQuery.graphql.js index 7b55e901c3872..cc5ecc783959d 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithDeferAndModuleTestQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithDeferAndModuleTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<622563eadb0ae1a6bd4f073cfa7ce4bb>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -30,8 +30,8 @@ export type RelayModernEnvironmentExecuteWithDeferAndModuleTestQuery$data = {| |}, |}; export type RelayModernEnvironmentExecuteWithDeferAndModuleTestQuery = {| - variables: RelayModernEnvironmentExecuteWithDeferAndModuleTestQuery$variables, response: RelayModernEnvironmentExecuteWithDeferAndModuleTestQuery$data, + variables: RelayModernEnvironmentExecuteWithDeferAndModuleTestQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithDeferTestUserQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithDeferTestUserQuery.graphql.js index f8b7e292d2903..b8d933e111adc 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithDeferTestUserQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithDeferTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayModernEnvironmentExecuteWithDeferTestUserQuery$data = {| |}, |}; export type RelayModernEnvironmentExecuteWithDeferTestUserQuery = {| - variables: RelayModernEnvironmentExecuteWithDeferTestUserQuery$variables, response: RelayModernEnvironmentExecuteWithDeferTestUserQuery$data, + variables: RelayModernEnvironmentExecuteWithDeferTestUserQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithDeferWithinModuleTestUserQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithDeferWithinModuleTestUserQuery.graphql.js index 15f2b8abc99ad..4248f5a233e1f 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithDeferWithinModuleTestUserQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithDeferWithinModuleTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<9f486c20d2ef19ffc5a3c7ca9d3035d4>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -39,8 +39,8 @@ export type RelayModernEnvironmentExecuteWithDeferWithinModuleTestUserQuery$data |}, |}; export type RelayModernEnvironmentExecuteWithDeferWithinModuleTestUserQuery = {| - variables: RelayModernEnvironmentExecuteWithDeferWithinModuleTestUserQuery$variables, response: RelayModernEnvironmentExecuteWithDeferWithinModuleTestUserQuery$data, + variables: RelayModernEnvironmentExecuteWithDeferWithinModuleTestUserQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithDeferredStreamedConnectionTestFeedFragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithDeferredStreamedConnectionTestFeedFragment.graphql.js index 619c0cbc97cc8..fdd42963a525b 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithDeferredStreamedConnectionTestFeedFragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithDeferredStreamedConnectionTestFeedFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<8343d156478f64b2969c59a501cbe349>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,14 +24,14 @@ export type RelayModernEnvironmentExecuteWithDeferredStreamedConnectionTestFeedF +cursor: ?string, +node: ?{| +__typename: string, - +id: string, +feedback: ?{| - +id: string, +actors: ?$ReadOnlyArray, + +id: string, |}, + +id: string, |}, |}>, +pageInfo: ?{| diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithDeferredStreamedConnectionTestFeedQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithDeferredStreamedConnectionTestFeedQuery.graphql.js index d07ab75f47049..513918d13c313 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithDeferredStreamedConnectionTestFeedQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithDeferredStreamedConnectionTestFeedQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type RelayModernEnvironmentExecuteWithDeferredStreamedConnectionTestFeedFragment$fragmentType = any; export type RelayModernEnvironmentExecuteWithDeferredStreamedConnectionTestFeedQuery$variables = {| - enableStream: boolean, after?: ?string, + enableStream: boolean, |}; export type RelayModernEnvironmentExecuteWithDeferredStreamedConnectionTestFeedQuery$data = {| +viewer: ?{| @@ -28,8 +28,8 @@ export type RelayModernEnvironmentExecuteWithDeferredStreamedConnectionTestFeedQ |}, |}; export type RelayModernEnvironmentExecuteWithDeferredStreamedConnectionTestFeedQuery = {| - variables: RelayModernEnvironmentExecuteWithDeferredStreamedConnectionTestFeedQuery$variables, response: RelayModernEnvironmentExecuteWithDeferredStreamedConnectionTestFeedQuery$data, + variables: RelayModernEnvironmentExecuteWithDeferredStreamedConnectionTestFeedQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithFlightAndClientFragmentTestFlightQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithFlightAndClientFragmentTestFlightQuery.graphql.js index beaf07cd9819f..d6be1f01e3ed2 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithFlightAndClientFragmentTestFlightQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithFlightAndClientFragmentTestFlightQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<5bfc81c1b89b71b5b82af46ba8cef4ac>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,8 +19,8 @@ /*:: import type { ConcreteRequest, Query } from 'relay-runtime'; export type RelayModernEnvironmentExecuteWithFlightAndClientFragmentTestFlightQuery$variables = {| - id: string, count: number, + id: string, |}; export type RelayModernEnvironmentExecuteWithFlightAndClientFragmentTestFlightQuery$data = {| +node: ?{| @@ -28,8 +28,8 @@ export type RelayModernEnvironmentExecuteWithFlightAndClientFragmentTestFlightQu |}, |}; export type RelayModernEnvironmentExecuteWithFlightAndClientFragmentTestFlightQuery = {| - variables: RelayModernEnvironmentExecuteWithFlightAndClientFragmentTestFlightQuery$variables, response: RelayModernEnvironmentExecuteWithFlightAndClientFragmentTestFlightQuery$data, + variables: RelayModernEnvironmentExecuteWithFlightAndClientFragmentTestFlightQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithFlightAndClientFragmentTestInnerQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithFlightAndClientFragmentTestInnerQuery.graphql.js index 16d8b21d9d956..5644d5841ca16 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithFlightAndClientFragmentTestInnerQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithFlightAndClientFragmentTestInnerQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<6f4da1c0202fbd97586deb6db9bc02e1>> * @flow * @lightSyntaxTransform * @nogrep @@ -28,8 +28,8 @@ export type RelayModernEnvironmentExecuteWithFlightAndClientFragmentTestInnerQue |}, |}; export type RelayModernEnvironmentExecuteWithFlightAndClientFragmentTestInnerQuery = {| - variables: RelayModernEnvironmentExecuteWithFlightAndClientFragmentTestInnerQuery$variables, response: RelayModernEnvironmentExecuteWithFlightAndClientFragmentTestInnerQuery$data, + variables: RelayModernEnvironmentExecuteWithFlightAndClientFragmentTestInnerQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithFlightAndClientFragmentTest_clientFragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithFlightAndClientFragmentTest_clientFragment.graphql.js index 8d5e8dde2794d..42e16755a5cb8 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithFlightAndClientFragmentTest_clientFragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithFlightAndClientFragmentTest_clientFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<74ce799b456022b3ec6be2d3ba4407cf>> + * @generated SignedSource<<695f09eb0180fec9c7834b8a10b64373>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentExecuteWithFlightAndClientFragmentTest_clientFragment$fragmentType: FragmentType; export type RelayModernEnvironmentExecuteWithFlightAndClientFragmentTest_clientFragment$data = {| - +name: ?string, +body: ?{| +text: ?string, |}, + +name: ?string, +$fragmentType: RelayModernEnvironmentExecuteWithFlightAndClientFragmentTest_clientFragment$fragmentType, |}; export type RelayModernEnvironmentExecuteWithFlightAndClientFragmentTest_clientFragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithFlightTestFlightQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithFlightTestFlightQuery.graphql.js index 7562dad07ae79..d2f935c8c3252 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithFlightTestFlightQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithFlightTestFlightQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<2e98bf905d734894dd7d891f7b870842>> + * @generated SignedSource<<241434c19c63072062cf8c6ab2c5fc18>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,8 +19,8 @@ /*:: import type { ConcreteRequest, Query } from 'relay-runtime'; export type RelayModernEnvironmentExecuteWithFlightTestFlightQuery$variables = {| - id: string, count: number, + id: string, |}; export type RelayModernEnvironmentExecuteWithFlightTestFlightQuery$data = {| +node: ?{| @@ -28,8 +28,8 @@ export type RelayModernEnvironmentExecuteWithFlightTestFlightQuery$data = {| |}, |}; export type RelayModernEnvironmentExecuteWithFlightTestFlightQuery = {| - variables: RelayModernEnvironmentExecuteWithFlightTestFlightQuery$variables, response: RelayModernEnvironmentExecuteWithFlightTestFlightQuery$data, + variables: RelayModernEnvironmentExecuteWithFlightTestFlightQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithFlightTestInnerQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithFlightTestInnerQuery.graphql.js index 2e6fa5ca001f9..fb7de564b64dd 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithFlightTestInnerQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithFlightTestInnerQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<70b16c14407e2bac9ce10917ee4cf640>> + * @generated SignedSource<<50fa03c4d2588cbf1daf9252174b2450>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type RelayModernEnvironmentExecuteWithFlightTestInnerQuery$data = {| |}, |}; export type RelayModernEnvironmentExecuteWithFlightTestInnerQuery = {| - variables: RelayModernEnvironmentExecuteWithFlightTestInnerQuery$variables, response: RelayModernEnvironmentExecuteWithFlightTestInnerQuery$data, + variables: RelayModernEnvironmentExecuteWithFlightTestInnerQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithHandlerAndUpdaterTestActorQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithHandlerAndUpdaterTestActorQuery.graphql.js index 78dcab5d6a6a4..fd7b7a8139b8e 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithHandlerAndUpdaterTestActorQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithHandlerAndUpdaterTestActorQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<4ead2312c0a6f6d5001557a016627ea0>> * @flow * @lightSyntaxTransform * @nogrep @@ -23,8 +23,8 @@ export type RelayModernEnvironmentExecuteWithHandlerAndUpdaterTestActorQuery$dat |}, |}; export type RelayModernEnvironmentExecuteWithHandlerAndUpdaterTestActorQuery = {| - variables: RelayModernEnvironmentExecuteWithHandlerAndUpdaterTestActorQuery$variables, response: RelayModernEnvironmentExecuteWithHandlerAndUpdaterTestActorQuery$data, + variables: RelayModernEnvironmentExecuteWithHandlerAndUpdaterTestActorQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithMatchAdditionalArgumentsTestMarkdownUserNameRenderer_name.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithMatchAdditionalArgumentsTestMarkdownUserNameRenderer_name.graphql.js index 49a074af11010..257027439753a 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithMatchAdditionalArgumentsTestMarkdownUserNameRenderer_name.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithMatchAdditionalArgumentsTestMarkdownUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<90868c0f46513e1a5d0a1e304309f8b1>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,11 +19,11 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentExecuteWithMatchAdditionalArgumentsTestMarkdownUserNameRenderer_name$fragmentType: FragmentType; export type RelayModernEnvironmentExecuteWithMatchAdditionalArgumentsTestMarkdownUserNameRenderer_name$data = {| - +markdown: ?string, + +__typename: "MarkdownUserNameRenderer", +data: ?{| +markup: ?string, |}, - +__typename: "MarkdownUserNameRenderer", + +markdown: ?string, +$fragmentType: RelayModernEnvironmentExecuteWithMatchAdditionalArgumentsTestMarkdownUserNameRenderer_name$fragmentType, |}; export type RelayModernEnvironmentExecuteWithMatchAdditionalArgumentsTestMarkdownUserNameRenderer_name$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithMatchAdditionalArgumentsTestPlainUserNameRenderer_name.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithMatchAdditionalArgumentsTestPlainUserNameRenderer_name.graphql.js index 8a5e33ef69f13..25066811e6328 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithMatchAdditionalArgumentsTestPlainUserNameRenderer_name.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithMatchAdditionalArgumentsTestPlainUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<41345c4f495d3bc351e02ec59f958ac5>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentExecuteWithMatchAdditionalArgumentsTestPlainUserNameRenderer_name$fragmentType: FragmentType; export type RelayModernEnvironmentExecuteWithMatchAdditionalArgumentsTestPlainUserNameRenderer_name$data = {| - +plaintext: ?string, +data: ?{| +text: ?string, |}, + +plaintext: ?string, +$fragmentType: RelayModernEnvironmentExecuteWithMatchAdditionalArgumentsTestPlainUserNameRenderer_name$fragmentType, |}; export type RelayModernEnvironmentExecuteWithMatchAdditionalArgumentsTestPlainUserNameRenderer_name$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithMatchAdditionalArgumentsTestUserQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithMatchAdditionalArgumentsTestUserQuery.graphql.js index 0e5197441c579..aba5c6fecc331 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithMatchAdditionalArgumentsTestUserQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithMatchAdditionalArgumentsTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<3dce2a8eed320150d504157441db54a9>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -33,8 +33,8 @@ export type RelayModernEnvironmentExecuteWithMatchAdditionalArgumentsTestUserQue |}, |}; export type RelayModernEnvironmentExecuteWithMatchAdditionalArgumentsTestUserQuery = {| - variables: RelayModernEnvironmentExecuteWithMatchAdditionalArgumentsTestUserQuery$variables, response: RelayModernEnvironmentExecuteWithMatchAdditionalArgumentsTestUserQuery$data, + variables: RelayModernEnvironmentExecuteWithMatchAdditionalArgumentsTestUserQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithMatchTestMarkdownUserNameRenderer_name.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithMatchTestMarkdownUserNameRenderer_name.graphql.js index da882b2d85a2b..73ff3829b737c 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithMatchTestMarkdownUserNameRenderer_name.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithMatchTestMarkdownUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,11 +19,11 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentExecuteWithMatchTestMarkdownUserNameRenderer_name$fragmentType: FragmentType; export type RelayModernEnvironmentExecuteWithMatchTestMarkdownUserNameRenderer_name$data = {| - +markdown: ?string, + +__typename: "MarkdownUserNameRenderer", +data: ?{| +markup: ?string, |}, - +__typename: "MarkdownUserNameRenderer", + +markdown: ?string, +$fragmentType: RelayModernEnvironmentExecuteWithMatchTestMarkdownUserNameRenderer_name$fragmentType, |}; export type RelayModernEnvironmentExecuteWithMatchTestMarkdownUserNameRenderer_name$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithMatchTestPlainUserNameRenderer_name.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithMatchTestPlainUserNameRenderer_name.graphql.js index d2e0285ea4630..bd2d0114d9a93 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithMatchTestPlainUserNameRenderer_name.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithMatchTestPlainUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<507fd4f5c87b75ffe62e990960de5868>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentExecuteWithMatchTestPlainUserNameRenderer_name$fragmentType: FragmentType; export type RelayModernEnvironmentExecuteWithMatchTestPlainUserNameRenderer_name$data = {| - +plaintext: ?string, +data: ?{| +text: ?string, |}, + +plaintext: ?string, +$fragmentType: RelayModernEnvironmentExecuteWithMatchTestPlainUserNameRenderer_name$fragmentType, |}; export type RelayModernEnvironmentExecuteWithMatchTestPlainUserNameRenderer_name$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithMatchTestUserQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithMatchTestUserQuery.graphql.js index 49214a04e8260..bbf301b61ea96 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithMatchTestUserQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithMatchTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<9541dffa643ca1db06a887e7b58c1a70>> + * @generated SignedSource<<05b3c1ff43e0bb288b9485bcbbb92d2c>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,14 +26,14 @@ export type RelayModernEnvironmentExecuteWithMatchTestUserQuery$variables = {| export type RelayModernEnvironmentExecuteWithMatchTestUserQuery$data = {| +node: ?{| +nameRenderer?: ?({| - +__typename: "PlainUserNameRenderer", +__fragmentPropName: ?string, +__module_component: ?string, + +__typename: "PlainUserNameRenderer", +$fragmentSpreads: RelayModernEnvironmentExecuteWithMatchTestPlainUserNameRenderer_name$fragmentType, |} | {| - +__typename: "MarkdownUserNameRenderer", +__fragmentPropName: ?string, +__module_component: ?string, + +__typename: "MarkdownUserNameRenderer", +$fragmentSpreads: RelayModernEnvironmentExecuteWithMatchTestMarkdownUserNameRenderer_name$fragmentType, |} | {| // This will never be '%other', but we need some @@ -43,8 +43,8 @@ export type RelayModernEnvironmentExecuteWithMatchTestUserQuery$data = {| |}, |}; export type RelayModernEnvironmentExecuteWithMatchTestUserQuery = {| - variables: RelayModernEnvironmentExecuteWithMatchTestUserQuery$variables, response: RelayModernEnvironmentExecuteWithMatchTestUserQuery$data, + variables: RelayModernEnvironmentExecuteWithMatchTestUserQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithModuleOnConcreteFieldTestFeedbackQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithModuleOnConcreteFieldTestFeedbackQuery.graphql.js index 39390f05f4878..c0357b40d7706 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithModuleOnConcreteFieldTestFeedbackQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithModuleOnConcreteFieldTestFeedbackQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<5a90270a06ee37f7e257e9126f502b83>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -32,8 +32,8 @@ export type RelayModernEnvironmentExecuteWithModuleOnConcreteFieldTestFeedbackQu |}, |}; export type RelayModernEnvironmentExecuteWithModuleOnConcreteFieldTestFeedbackQuery = {| - variables: RelayModernEnvironmentExecuteWithModuleOnConcreteFieldTestFeedbackQuery$variables, response: RelayModernEnvironmentExecuteWithModuleOnConcreteFieldTestFeedbackQuery$data, + variables: RelayModernEnvironmentExecuteWithModuleOnConcreteFieldTestFeedbackQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithModuleTestMarkdownUserNameRenderer_name.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithModuleTestMarkdownUserNameRenderer_name.graphql.js index 356cc2a080b1f..ac673f867eb4e 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithModuleTestMarkdownUserNameRenderer_name.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithModuleTestMarkdownUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<53d08b97dfd0ceb2359c6179c0b927f3>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,11 +19,11 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentExecuteWithModuleTestMarkdownUserNameRenderer_name$fragmentType: FragmentType; export type RelayModernEnvironmentExecuteWithModuleTestMarkdownUserNameRenderer_name$data = {| - +markdown: ?string, + +__typename: "MarkdownUserNameRenderer", +data: ?{| +markup: ?string, |}, - +__typename: "MarkdownUserNameRenderer", + +markdown: ?string, +$fragmentType: RelayModernEnvironmentExecuteWithModuleTestMarkdownUserNameRenderer_name$fragmentType, |}; export type RelayModernEnvironmentExecuteWithModuleTestMarkdownUserNameRenderer_name$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithModuleTestPlainUserNameRenderer_name.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithModuleTestPlainUserNameRenderer_name.graphql.js index 1386af627e2aa..07247ac7d02f7 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithModuleTestPlainUserNameRenderer_name.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithModuleTestPlainUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<901ce84be81f638b734d46a934436214>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentExecuteWithModuleTestPlainUserNameRenderer_name$fragmentType: FragmentType; export type RelayModernEnvironmentExecuteWithModuleTestPlainUserNameRenderer_name$data = {| - +plaintext: ?string, +data: ?{| +text: ?string, |}, + +plaintext: ?string, +$fragmentType: RelayModernEnvironmentExecuteWithModuleTestPlainUserNameRenderer_name$fragmentType, |}; export type RelayModernEnvironmentExecuteWithModuleTestPlainUserNameRenderer_name$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithModuleTestUserQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithModuleTestUserQuery.graphql.js index 8660e4d719a3c..375e37beab14d 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithModuleTestUserQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithModuleTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<21e4cbb7d4b9f40fdad2a8236af3aa47>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -33,8 +33,8 @@ export type RelayModernEnvironmentExecuteWithModuleTestUserQuery$data = {| |}, |}; export type RelayModernEnvironmentExecuteWithModuleTestUserQuery = {| - variables: RelayModernEnvironmentExecuteWithModuleTestUserQuery$variables, response: RelayModernEnvironmentExecuteWithModuleTestUserQuery$data, + variables: RelayModernEnvironmentExecuteWithModuleTestUserQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithModuleWithKeyTestMarkdownUserNameRenderer_name.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithModuleWithKeyTestMarkdownUserNameRenderer_name.graphql.js index 8cc7d488ac0bf..2fe81f32538ac 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithModuleWithKeyTestMarkdownUserNameRenderer_name.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithModuleWithKeyTestMarkdownUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<97ae7c77351d3d069bb7f3200ec6e4b2>> + * @generated SignedSource<<4f88c1b1ced7d60f495f27c2249385d7>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,11 +19,11 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentExecuteWithModuleWithKeyTestMarkdownUserNameRenderer_name$fragmentType: FragmentType; export type RelayModernEnvironmentExecuteWithModuleWithKeyTestMarkdownUserNameRenderer_name$data = {| - +markdown: ?string, + +__typename: "MarkdownUserNameRenderer", +data: ?{| +markup: ?string, |}, - +__typename: "MarkdownUserNameRenderer", + +markdown: ?string, +$fragmentType: RelayModernEnvironmentExecuteWithModuleWithKeyTestMarkdownUserNameRenderer_name$fragmentType, |}; export type RelayModernEnvironmentExecuteWithModuleWithKeyTestMarkdownUserNameRenderer_name$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithModuleWithKeyTestPlainUserNameRenderer_name.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithModuleWithKeyTestPlainUserNameRenderer_name.graphql.js index 77bc7af05ae0d..fd2e4caad2297 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithModuleWithKeyTestPlainUserNameRenderer_name.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithModuleWithKeyTestPlainUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<4f4fea2132f9bc0ae9c6e5de78de09cf>> + * @generated SignedSource<<0984db863562582f5e635ef038a4478d>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentExecuteWithModuleWithKeyTestPlainUserNameRenderer_name$fragmentType: FragmentType; export type RelayModernEnvironmentExecuteWithModuleWithKeyTestPlainUserNameRenderer_name$data = {| - +plaintext: ?string, +data: ?{| +text: ?string, |}, + +plaintext: ?string, +$fragmentType: RelayModernEnvironmentExecuteWithModuleWithKeyTestPlainUserNameRenderer_name$fragmentType, |}; export type RelayModernEnvironmentExecuteWithModuleWithKeyTestPlainUserNameRenderer_name$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithModuleWithKeyTestUserQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithModuleWithKeyTestUserQuery.graphql.js index c6f5f41198c34..8ea7aeac26f14 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithModuleWithKeyTestUserQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithModuleWithKeyTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<7b56b0f8828510fb1f3a8b37af60e28a>> * @flow * @lightSyntaxTransform * @nogrep @@ -33,8 +33,8 @@ export type RelayModernEnvironmentExecuteWithModuleWithKeyTestUserQuery$data = { |}, |}; export type RelayModernEnvironmentExecuteWithModuleWithKeyTestUserQuery = {| - variables: RelayModernEnvironmentExecuteWithModuleWithKeyTestUserQuery$variables, response: RelayModernEnvironmentExecuteWithModuleWithKeyTestUserQuery$data, + variables: RelayModernEnvironmentExecuteWithModuleWithKeyTestUserQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithNestedMatchTestMarkdownUserNameRenderer_name.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithNestedMatchTestMarkdownUserNameRenderer_name.graphql.js index e6cbbd71a7856..e07550bae47db 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithNestedMatchTestMarkdownUserNameRenderer_name.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithNestedMatchTestMarkdownUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<2bc9996c979aef6509a054acec99f325>> + * @generated SignedSource<<89ffeae58c939e66ec893dd91c8e9d72>> * @flow * @lightSyntaxTransform * @nogrep @@ -22,10 +22,11 @@ type RelayModernEnvironmentExecuteWithNestedMatchTestPlainUserNameRenderer_name$ import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentExecuteWithNestedMatchTestMarkdownUserNameRenderer_name$fragmentType: FragmentType; export type RelayModernEnvironmentExecuteWithNestedMatchTestMarkdownUserNameRenderer_name$data = {| - +markdown: ?string, + +__typename: "MarkdownUserNameRenderer", +data: ?{| +markup: ?string, |}, + +markdown: ?string, +user: ?{| +innerRenderer: ?{| +__fragmentPropName?: ?string, @@ -33,7 +34,6 @@ export type RelayModernEnvironmentExecuteWithNestedMatchTestMarkdownUserNameRend +$fragmentSpreads: RelayModernEnvironmentExecuteWithNestedMatchTestPlainUserNameRenderer_name$fragmentType, |}, |}, - +__typename: "MarkdownUserNameRenderer", +$fragmentType: RelayModernEnvironmentExecuteWithNestedMatchTestMarkdownUserNameRenderer_name$fragmentType, |}; export type RelayModernEnvironmentExecuteWithNestedMatchTestMarkdownUserNameRenderer_name$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithNestedMatchTestPlainUserNameRenderer_name.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithNestedMatchTestPlainUserNameRenderer_name.graphql.js index 49fee9e807a80..c2cc5970c89d9 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithNestedMatchTestPlainUserNameRenderer_name.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithNestedMatchTestPlainUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<7c531f989d5f47092c340baedadee7fe>> + * @generated SignedSource<<2dfc1527130ce3dd67ef5bb59057aa80>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentExecuteWithNestedMatchTestPlainUserNameRenderer_name$fragmentType: FragmentType; export type RelayModernEnvironmentExecuteWithNestedMatchTestPlainUserNameRenderer_name$data = {| - +plaintext: ?string, +data: ?{| +text: ?string, |}, + +plaintext: ?string, +$fragmentType: RelayModernEnvironmentExecuteWithNestedMatchTestPlainUserNameRenderer_name$fragmentType, |}; export type RelayModernEnvironmentExecuteWithNestedMatchTestPlainUserNameRenderer_name$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithNestedMatchTestUserQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithNestedMatchTestUserQuery.graphql.js index 318a1ea3c6625..6e1ceb832dbfb 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithNestedMatchTestUserQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithNestedMatchTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<20992903f2cba51587d85fb8d5378656>> * @flow * @lightSyntaxTransform * @nogrep @@ -32,8 +32,8 @@ export type RelayModernEnvironmentExecuteWithNestedMatchTestUserQuery$data = {| |}, |}; export type RelayModernEnvironmentExecuteWithNestedMatchTestUserQuery = {| - variables: RelayModernEnvironmentExecuteWithNestedMatchTestUserQuery$variables, response: RelayModernEnvironmentExecuteWithNestedMatchTestUserQuery$data, + variables: RelayModernEnvironmentExecuteWithNestedMatchTestUserQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithNestedStreamTestFeedFragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithNestedStreamTestFeedFragment.graphql.js index fb1d9047a59f9..f7fe3ed5df8f0 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithNestedStreamTestFeedFragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithNestedStreamTestFeedFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<35c8cf526fb81dd691764e518845be31>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -23,12 +23,12 @@ export type RelayModernEnvironmentExecuteWithNestedStreamTestFeedFragment$data = +edges: ?$ReadOnlyArray, |}, + +id: string, |}, |}>, |}, diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithNestedStreamTestFeedQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithNestedStreamTestFeedQuery.graphql.js index eb5600e68f532..a0139a2bb68ae 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithNestedStreamTestFeedQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithNestedStreamTestFeedQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<6f7cff938992472f79ec17e614006604>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayModernEnvironmentExecuteWithNestedStreamTestFeedQuery$data = {| |}, |}; export type RelayModernEnvironmentExecuteWithNestedStreamTestFeedQuery = {| - variables: RelayModernEnvironmentExecuteWithNestedStreamTestFeedQuery$variables, response: RelayModernEnvironmentExecuteWithNestedStreamTestFeedQuery$data, + variables: RelayModernEnvironmentExecuteWithNestedStreamTestFeedQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithObservableNetworkTestQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithObservableNetworkTestQuery.graphql.js index 85c976ca8abf7..8e25f4c6475ee 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithObservableNetworkTestQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithObservableNetworkTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<8193632cd168ab73e29945d6539ca3d4>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -28,8 +28,8 @@ export type RelayModernEnvironmentExecuteWithObservableNetworkTestQuery$data = { |}, |}; export type RelayModernEnvironmentExecuteWithObservableNetworkTestQuery = {| - variables: RelayModernEnvironmentExecuteWithObservableNetworkTestQuery$variables, response: RelayModernEnvironmentExecuteWithObservableNetworkTestQuery$data, + variables: RelayModernEnvironmentExecuteWithObservableNetworkTestQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOptimisticResponseTestActor2Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOptimisticResponseTestActor2Query.graphql.js index 27dd42f5ce68e..d65daf30abd4d 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOptimisticResponseTestActor2Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOptimisticResponseTestActor2Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,13 +19,13 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; export type RelayModernEnvironmentExecuteWithOptimisticResponseTestActor2Query$variables = {||}; export type RelayModernEnvironmentExecuteWithOptimisticResponseTestActor2Query$data = {| +me: ?{| - +name: ?string, +lastName: ?string, + +name: ?string, |}, |}; export type RelayModernEnvironmentExecuteWithOptimisticResponseTestActor2Query = {| - variables: RelayModernEnvironmentExecuteWithOptimisticResponseTestActor2Query$variables, response: RelayModernEnvironmentExecuteWithOptimisticResponseTestActor2Query$data, + variables: RelayModernEnvironmentExecuteWithOptimisticResponseTestActor2Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOptimisticResponseTestActorQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOptimisticResponseTestActorQuery.graphql.js index a297f7aa067be..26ec1bb8ba969 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOptimisticResponseTestActorQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOptimisticResponseTestActorQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<53560285e68ed180a8655bb277be328c>> + * @generated SignedSource<<8c1f78a27bee75e0206ec2536b842ee8>> * @flow * @lightSyntaxTransform * @nogrep @@ -28,8 +28,8 @@ export type RelayModernEnvironmentExecuteWithOptimisticResponseTestActorQuery$da |}, |}; export type RelayModernEnvironmentExecuteWithOptimisticResponseTestActorQuery = {| - variables: RelayModernEnvironmentExecuteWithOptimisticResponseTestActorQuery$variables, response: RelayModernEnvironmentExecuteWithOptimisticResponseTestActorQuery$data, + variables: RelayModernEnvironmentExecuteWithOptimisticResponseTestActorQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOverlappingModuleTestActorQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOverlappingModuleTestActorQuery.graphql.js index 2fbfb77373e39..655e07bad753d 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOverlappingModuleTestActorQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOverlappingModuleTestActorQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<12683fe2d622be1dfc1d61d1131da847>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -32,8 +32,8 @@ export type RelayModernEnvironmentExecuteWithOverlappingModuleTestActorQuery$dat |}, |}; export type RelayModernEnvironmentExecuteWithOverlappingModuleTestActorQuery = {| - variables: RelayModernEnvironmentExecuteWithOverlappingModuleTestActorQuery$variables, response: RelayModernEnvironmentExecuteWithOverlappingModuleTestActorQuery$data, + variables: RelayModernEnvironmentExecuteWithOverlappingModuleTestActorQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOverlappingModuleTestMarkdownActorNameRenderer_name.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOverlappingModuleTestMarkdownActorNameRenderer_name.graphql.js index e1c4708efbfb5..5dbcdce9eaaa4 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOverlappingModuleTestMarkdownActorNameRenderer_name.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOverlappingModuleTestMarkdownActorNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<3344810a5f1d99336e7b40f737c39a8d>> + * @generated SignedSource<<82cf713b23f23fe1c58fe9a41b1dd40c>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,11 +19,11 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentExecuteWithOverlappingModuleTestMarkdownActorNameRenderer_name$fragmentType: FragmentType; export type RelayModernEnvironmentExecuteWithOverlappingModuleTestMarkdownActorNameRenderer_name$data = {| - +markdown: ?string, + +__typename: "MarkdownUserNameRenderer", +data: ?{| +markup: ?string, |}, - +__typename: "MarkdownUserNameRenderer", + +markdown: ?string, +$fragmentType: RelayModernEnvironmentExecuteWithOverlappingModuleTestMarkdownActorNameRenderer_name$fragmentType, |}; export type RelayModernEnvironmentExecuteWithOverlappingModuleTestMarkdownActorNameRenderer_name$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOverlappingModuleTestMarkdownUserNameRenderer_name.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOverlappingModuleTestMarkdownUserNameRenderer_name.graphql.js index 81e55f368a3b0..d5076055ac5e3 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOverlappingModuleTestMarkdownUserNameRenderer_name.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOverlappingModuleTestMarkdownUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<5c6eeb3570b76ec994b537a1f9694384>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,11 +19,11 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentExecuteWithOverlappingModuleTestMarkdownUserNameRenderer_name$fragmentType: FragmentType; export type RelayModernEnvironmentExecuteWithOverlappingModuleTestMarkdownUserNameRenderer_name$data = {| - +markdown: ?string, + +__typename: "MarkdownUserNameRenderer", +data: ?{| +markup: ?string, |}, - +__typename: "MarkdownUserNameRenderer", + +markdown: ?string, +$fragmentType: RelayModernEnvironmentExecuteWithOverlappingModuleTestMarkdownUserNameRenderer_name$fragmentType, |}; export type RelayModernEnvironmentExecuteWithOverlappingModuleTestMarkdownUserNameRenderer_name$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOverlappingModuleTestPlainUserNameRenderer_name.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOverlappingModuleTestPlainUserNameRenderer_name.graphql.js index 4c3796422302a..e6dc96a9f666a 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOverlappingModuleTestPlainUserNameRenderer_name.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOverlappingModuleTestPlainUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<4a67d19898e1ec0a61b08fc58a486944>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentExecuteWithOverlappingModuleTestPlainUserNameRenderer_name$fragmentType: FragmentType; export type RelayModernEnvironmentExecuteWithOverlappingModuleTestPlainUserNameRenderer_name$data = {| - +plaintext: ?string, +data: ?{| +text: ?string, |}, + +plaintext: ?string, +$fragmentType: RelayModernEnvironmentExecuteWithOverlappingModuleTestPlainUserNameRenderer_name$fragmentType, |}; export type RelayModernEnvironmentExecuteWithOverlappingModuleTestPlainUserNameRenderer_name$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOverlappingModuleTestQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOverlappingModuleTestQuery.graphql.js index 24428b4bc0171..c7f30b3061442 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOverlappingModuleTestQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOverlappingModuleTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<5f06e711ff9019321d4041d369cdfbd2>> + * @generated SignedSource<<396decd314283272b33025103bd49877>> * @flow * @lightSyntaxTransform * @nogrep @@ -33,8 +33,8 @@ export type RelayModernEnvironmentExecuteWithOverlappingModuleTestQuery$data = { |}, |}; export type RelayModernEnvironmentExecuteWithOverlappingModuleTestQuery = {| - variables: RelayModernEnvironmentExecuteWithOverlappingModuleTestQuery$variables, response: RelayModernEnvironmentExecuteWithOverlappingModuleTestQuery$data, + variables: RelayModernEnvironmentExecuteWithOverlappingModuleTestQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOverlappingStreamTestFeedbackFragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOverlappingStreamTestFeedbackFragment.graphql.js index 0bff1d6e2eeaa..24d663f041db0 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOverlappingStreamTestFeedbackFragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOverlappingStreamTestFeedbackFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -20,10 +20,10 @@ type RelayModernEnvironmentExecuteWithOverlappingStreamTestDeferFragment$fragmen import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentExecuteWithOverlappingStreamTestFeedbackFragment$fragmentType: FragmentType; export type RelayModernEnvironmentExecuteWithOverlappingStreamTestFeedbackFragment$data = {| - +id: string, +actors: ?$ReadOnlyArray, + +id: string, +$fragmentSpreads: RelayModernEnvironmentExecuteWithOverlappingStreamTestDeferFragment$fragmentType, +$fragmentType: RelayModernEnvironmentExecuteWithOverlappingStreamTestFeedbackFragment$fragmentType, |}; diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOverlappingStreamTestFeedbackQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOverlappingStreamTestFeedbackQuery.graphql.js index e3054f907843a..61e69d1480918 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOverlappingStreamTestFeedbackQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithOverlappingStreamTestFeedbackQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<1d41347b2c0613a6e8d2225cd4f6385e>> + * @generated SignedSource<<0e2d11f39115bd8621efbc8726a5f1a4>> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type RelayModernEnvironmentExecuteWithOverlappingStreamTestFeedbackFragment$fragmentType = any; export type RelayModernEnvironmentExecuteWithOverlappingStreamTestFeedbackQuery$variables = {| - id: string, enableStream: boolean, + id: string, |}; export type RelayModernEnvironmentExecuteWithOverlappingStreamTestFeedbackQuery$data = {| +node: ?{| @@ -27,8 +27,8 @@ export type RelayModernEnvironmentExecuteWithOverlappingStreamTestFeedbackQuery$ |}, |}; export type RelayModernEnvironmentExecuteWithOverlappingStreamTestFeedbackQuery = {| - variables: RelayModernEnvironmentExecuteWithOverlappingStreamTestFeedbackQuery$variables, response: RelayModernEnvironmentExecuteWithOverlappingStreamTestFeedbackQuery$data, + variables: RelayModernEnvironmentExecuteWithOverlappingStreamTestFeedbackQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithPluralMatchTestMarkdownUserNameRenderer_name.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithPluralMatchTestMarkdownUserNameRenderer_name.graphql.js index 57eadfb8bda04..3cb261ef27a65 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithPluralMatchTestMarkdownUserNameRenderer_name.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithPluralMatchTestMarkdownUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<05d0783f1754905f3f47f13782bcb37e>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,11 +19,11 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentExecuteWithPluralMatchTestMarkdownUserNameRenderer_name$fragmentType: FragmentType; export type RelayModernEnvironmentExecuteWithPluralMatchTestMarkdownUserNameRenderer_name$data = {| - +markdown: ?string, + +__typename: "MarkdownUserNameRenderer", +data: ?{| +markup: ?string, |}, - +__typename: "MarkdownUserNameRenderer", + +markdown: ?string, +$fragmentType: RelayModernEnvironmentExecuteWithPluralMatchTestMarkdownUserNameRenderer_name$fragmentType, |}; export type RelayModernEnvironmentExecuteWithPluralMatchTestMarkdownUserNameRenderer_name$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithPluralMatchTestPlainUserNameRenderer_name.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithPluralMatchTestPlainUserNameRenderer_name.graphql.js index 15e8979e8e008..c0bc67e3bd945 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithPluralMatchTestPlainUserNameRenderer_name.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithPluralMatchTestPlainUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<211e0df43052f1a27743c01db81c54ef>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentExecuteWithPluralMatchTestPlainUserNameRenderer_name$fragmentType: FragmentType; export type RelayModernEnvironmentExecuteWithPluralMatchTestPlainUserNameRenderer_name$data = {| - +plaintext: ?string, +data: ?{| +text: ?string, |}, + +plaintext: ?string, +$fragmentType: RelayModernEnvironmentExecuteWithPluralMatchTestPlainUserNameRenderer_name$fragmentType, |}; export type RelayModernEnvironmentExecuteWithPluralMatchTestPlainUserNameRenderer_name$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithPluralMatchTestUserQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithPluralMatchTestUserQuery.graphql.js index fe18d0c2da6c4..490c46d840ab4 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithPluralMatchTestUserQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithPluralMatchTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<3939749abdac9dc4006daf46ec756a3e>> * @flow * @lightSyntaxTransform * @nogrep @@ -33,8 +33,8 @@ export type RelayModernEnvironmentExecuteWithPluralMatchTestUserQuery$data = {| |}, |}; export type RelayModernEnvironmentExecuteWithPluralMatchTestUserQuery = {| - variables: RelayModernEnvironmentExecuteWithPluralMatchTestUserQuery$variables, response: RelayModernEnvironmentExecuteWithPluralMatchTestUserQuery$data, + variables: RelayModernEnvironmentExecuteWithPluralMatchTestUserQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithPromiseNetworkTestActorQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithPromiseNetworkTestActorQuery.graphql.js index cc5ccfea923af..2bb4522faf584 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithPromiseNetworkTestActorQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithPromiseNetworkTestActorQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<2bc5a0f591894b3c67d0f4e95461629b>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -28,8 +28,8 @@ export type RelayModernEnvironmentExecuteWithPromiseNetworkTestActorQuery$data = |}, |}; export type RelayModernEnvironmentExecuteWithPromiseNetworkTestActorQuery = {| - variables: RelayModernEnvironmentExecuteWithPromiseNetworkTestActorQuery$variables, response: RelayModernEnvironmentExecuteWithPromiseNetworkTestActorQuery$data, + variables: RelayModernEnvironmentExecuteWithPromiseNetworkTestActorQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithProvidedVariableTest_UserArgManyFragmentsQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithProvidedVariableTest_UserArgManyFragmentsQuery.graphql.js index d31eedb059b4e..553e6b00420f6 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithProvidedVariableTest_UserArgManyFragmentsQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithProvidedVariableTest_UserArgManyFragmentsQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -28,16 +28,16 @@ export type RelayModernEnvironmentExecuteWithProvidedVariableTest_UserArgManyFra |}, |}; export type RelayModernEnvironmentExecuteWithProvidedVariableTest_UserArgManyFragmentsQuery = {| - variables: RelayModernEnvironmentExecuteWithProvidedVariableTest_UserArgManyFragmentsQuery$variables, response: RelayModernEnvironmentExecuteWithProvidedVariableTest_UserArgManyFragmentsQuery$data, + variables: RelayModernEnvironmentExecuteWithProvidedVariableTest_UserArgManyFragmentsQuery$variables, |}; type ProvidedVariablesType = {| - +__relay_internal__pv__RelayProvider_returnsTrue: {| - +get: () => boolean, - |}, +__relay_internal__pv__RelayProvider_pictureScale: {| +get: () => number, |}, + +__relay_internal__pv__RelayProvider_returnsTrue: {| + +get: () => boolean, + |}, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithProvidedVariableTest_UserArgSingleFragmentQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithProvidedVariableTest_UserArgSingleFragmentQuery.graphql.js index f38428aeff0fb..d1dca155d4231 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithProvidedVariableTest_UserArgSingleFragmentQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithProvidedVariableTest_UserArgSingleFragmentQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<025ffe7281b2378b9f99d524fad32e3e>> + * @generated SignedSource<<0d4a750e67a5087fbd6c09d773ab2d7c>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayModernEnvironmentExecuteWithProvidedVariableTest_UserArgSingleF |}, |}; export type RelayModernEnvironmentExecuteWithProvidedVariableTest_UserArgSingleFragmentQuery = {| - variables: RelayModernEnvironmentExecuteWithProvidedVariableTest_UserArgSingleFragmentQuery$variables, response: RelayModernEnvironmentExecuteWithProvidedVariableTest_UserArgSingleFragmentQuery$data, + variables: RelayModernEnvironmentExecuteWithProvidedVariableTest_UserArgSingleFragmentQuery$variables, |}; type ProvidedVariablesType = {| +__relay_internal__pv__RelayProvider_returnsTrue: {| diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithProvidedVariableTest_profile1.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithProvidedVariableTest_profile1.graphql.js index 5690115ec6510..f60f54165dcc9 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithProvidedVariableTest_profile1.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithProvidedVariableTest_profile1.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<4a177341bf99148758b7340ec9d00c51>> * @flow * @lightSyntaxTransform * @nogrep @@ -21,10 +21,10 @@ declare export opaque type RelayModernEnvironmentExecuteWithProvidedVariableTest export type RelayModernEnvironmentExecuteWithProvidedVariableTest_profile1$data = {| +id: string, +name?: ?string, - +username?: ?string, +profilePicture: ?{| +uri: ?string, |}, + +username?: ?string, +$fragmentType: RelayModernEnvironmentExecuteWithProvidedVariableTest_profile1$fragmentType, |}; export type RelayModernEnvironmentExecuteWithProvidedVariableTest_profile1$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithProvidedVariableTest_profile2.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithProvidedVariableTest_profile2.graphql.js index 8a33113a6f3bd..196becdcc196d 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithProvidedVariableTest_profile2.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithProvidedVariableTest_profile2.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<148764a0c9afd74806a985afb4559aef>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,8 +19,8 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentExecuteWithProvidedVariableTest_profile2$fragmentType: FragmentType; export type RelayModernEnvironmentExecuteWithProvidedVariableTest_profile2$data = {| - +name?: ?string, +alternate_name?: ?string, + +name?: ?string, +$fragmentType: RelayModernEnvironmentExecuteWithProvidedVariableTest_profile2$fragmentType, |}; export type RelayModernEnvironmentExecuteWithProvidedVariableTest_profile2$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithRelayClientComponentTestQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithRelayClientComponentTestQuery.graphql.js index 3fc0415fe0b18..5089f641a2265 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithRelayClientComponentTestQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithRelayClientComponentTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -28,8 +28,8 @@ export type RelayModernEnvironmentExecuteWithRelayClientComponentTestQuery$data |}, |}; export type RelayModernEnvironmentExecuteWithRelayClientComponentTestQuery = {| - variables: RelayModernEnvironmentExecuteWithRelayClientComponentTestQuery$variables, response: RelayModernEnvironmentExecuteWithRelayClientComponentTestQuery$data, + variables: RelayModernEnvironmentExecuteWithRelayClientComponentTestQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithRelayClientComponentTest_clientFragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithRelayClientComponentTest_clientFragment.graphql.js index 06b099737c475..1be739df8d2c5 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithRelayClientComponentTest_clientFragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithRelayClientComponentTest_clientFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<4b62404fe2d4feb5818ed89743c1db2c>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentExecuteWithRelayClientComponentTest_clientFragment$fragmentType: FragmentType; export type RelayModernEnvironmentExecuteWithRelayClientComponentTest_clientFragment$data = {| - +name: ?string, +body: ?{| +text: ?string, |}, + +name: ?string, +$fragmentType: RelayModernEnvironmentExecuteWithRelayClientComponentTest_clientFragment$fragmentType, |}; export type RelayModernEnvironmentExecuteWithRelayClientComponentTest_clientFragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithSiblingAndNestedModuleTestMarkdownUserNameRenderer_name.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithSiblingAndNestedModuleTestMarkdownUserNameRenderer_name.graphql.js index a96815066d844..b62342dd6bbdb 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithSiblingAndNestedModuleTestMarkdownUserNameRenderer_name.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithSiblingAndNestedModuleTestMarkdownUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<8026a955aceb0e656b39328f0d65eea0>> * @flow * @lightSyntaxTransform * @nogrep @@ -22,16 +22,16 @@ type RelayModernEnvironmentExecuteWithSiblingAndNestedModuleTestPlainUserNameRen import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentExecuteWithSiblingAndNestedModuleTestMarkdownUserNameRenderer_name$fragmentType: FragmentType; export type RelayModernEnvironmentExecuteWithSiblingAndNestedModuleTestMarkdownUserNameRenderer_name$data = {| + +__typename: "MarkdownUserNameRenderer", +markdown: ?string, +user: ?{| - +name: ?string, +innerRenderer: ?{| +__fragmentPropName?: ?string, +__module_component?: ?string, +$fragmentSpreads: RelayModernEnvironmentExecuteWithSiblingAndNestedModuleTestPlainUserNameRenderer_name$fragmentType, |}, + +name: ?string, |}, - +__typename: "MarkdownUserNameRenderer", +$fragmentType: RelayModernEnvironmentExecuteWithSiblingAndNestedModuleTestMarkdownUserNameRenderer_name$fragmentType, |}; export type RelayModernEnvironmentExecuteWithSiblingAndNestedModuleTestMarkdownUserNameRenderer_name$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithSiblingAndNestedModuleTestUserQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithSiblingAndNestedModuleTestUserQuery.graphql.js index bdd7082468059..226a4355fc713 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithSiblingAndNestedModuleTestUserQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithSiblingAndNestedModuleTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<88361e606682c5cbd045955e82223b67>> + * @generated SignedSource<<6be3f20589d934b8d6a7a63c54027867>> * @flow * @lightSyntaxTransform * @nogrep @@ -39,8 +39,8 @@ export type RelayModernEnvironmentExecuteWithSiblingAndNestedModuleTestUserQuery |}, |}; export type RelayModernEnvironmentExecuteWithSiblingAndNestedModuleTestUserQuery = {| - variables: RelayModernEnvironmentExecuteWithSiblingAndNestedModuleTestUserQuery$variables, response: RelayModernEnvironmentExecuteWithSiblingAndNestedModuleTestUserQuery$data, + variables: RelayModernEnvironmentExecuteWithSiblingAndNestedModuleTestUserQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithSourceTestActorQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithSourceTestActorQuery.graphql.js index 770c26d131cd5..61375549df600 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithSourceTestActorQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithSourceTestActorQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<18e854ecc10290eb94a47029285cccaa>> + * @generated SignedSource<<1d3dafe46ba2d73baf408ac3dde2743f>> * @flow * @lightSyntaxTransform * @nogrep @@ -28,8 +28,8 @@ export type RelayModernEnvironmentExecuteWithSourceTestActorQuery$data = {| |}, |}; export type RelayModernEnvironmentExecuteWithSourceTestActorQuery = {| - variables: RelayModernEnvironmentExecuteWithSourceTestActorQuery$variables, response: RelayModernEnvironmentExecuteWithSourceTestActorQuery$data, + variables: RelayModernEnvironmentExecuteWithSourceTestActorQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithStreamAndRequiredTestFeedbackFragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithStreamAndRequiredTestFeedbackFragment.graphql.js index 720bb9e967d05..412207004eb6b 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithStreamAndRequiredTestFeedbackFragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithStreamAndRequiredTestFeedbackFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<10a55f39e3fd9629a7f812a921bf5094>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentExecuteWithStreamAndRequiredTestFeedbackFragment$fragmentType: FragmentType; export type RelayModernEnvironmentExecuteWithStreamAndRequiredTestFeedbackFragment$data = ?{| - +id: string, +actors: $ReadOnlyArray, + +id: string, +$fragmentType: RelayModernEnvironmentExecuteWithStreamAndRequiredTestFeedbackFragment$fragmentType, |}; export type RelayModernEnvironmentExecuteWithStreamAndRequiredTestFeedbackFragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithStreamAndRequiredTestFeedbackQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithStreamAndRequiredTestFeedbackQuery.graphql.js index 35722dadbc58b..b00bfa9ea791e 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithStreamAndRequiredTestFeedbackQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithStreamAndRequiredTestFeedbackQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<7a2c7232933cab0e4c9279b15bbfe0c1>> + * @generated SignedSource<<9a4585334a9078b71dcfa002561e8709>> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type RelayModernEnvironmentExecuteWithStreamAndRequiredTestFeedbackFragment$fragmentType = any; export type RelayModernEnvironmentExecuteWithStreamAndRequiredTestFeedbackQuery$variables = {| - id: string, enableStream: boolean, + id: string, |}; export type RelayModernEnvironmentExecuteWithStreamAndRequiredTestFeedbackQuery$data = {| +node: ?{| @@ -27,8 +27,8 @@ export type RelayModernEnvironmentExecuteWithStreamAndRequiredTestFeedbackQuery$ |}, |}; export type RelayModernEnvironmentExecuteWithStreamAndRequiredTestFeedbackQuery = {| - variables: RelayModernEnvironmentExecuteWithStreamAndRequiredTestFeedbackQuery$variables, response: RelayModernEnvironmentExecuteWithStreamAndRequiredTestFeedbackQuery$data, + variables: RelayModernEnvironmentExecuteWithStreamAndRequiredTestFeedbackQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithStreamTestFeedbackFragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithStreamTestFeedbackFragment.graphql.js index a215caea4e721..4c473403826c0 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithStreamTestFeedbackFragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithStreamTestFeedbackFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<4f2ef2fe9ab47a35ace40e2adac78871>> + * @generated SignedSource<<22032f002831b475eae28fbf7e9280d7>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentExecuteWithStreamTestFeedbackFragment$fragmentType: FragmentType; export type RelayModernEnvironmentExecuteWithStreamTestFeedbackFragment$data = {| - +id: string, +actors: ?$ReadOnlyArray, + +id: string, +$fragmentType: RelayModernEnvironmentExecuteWithStreamTestFeedbackFragment$fragmentType, |}; export type RelayModernEnvironmentExecuteWithStreamTestFeedbackFragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithStreamTestFeedbackQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithStreamTestFeedbackQuery.graphql.js index 8330a3305b7d8..faaa12d7f7ad3 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithStreamTestFeedbackQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithStreamTestFeedbackQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<700ef796a963c14d35aebca813b221a1>> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type RelayModernEnvironmentExecuteWithStreamTestFeedbackFragment$fragmentType = any; export type RelayModernEnvironmentExecuteWithStreamTestFeedbackQuery$variables = {| - id: string, enableStream: boolean, + id: string, |}; export type RelayModernEnvironmentExecuteWithStreamTestFeedbackQuery$data = {| +node: ?{| @@ -27,8 +27,8 @@ export type RelayModernEnvironmentExecuteWithStreamTestFeedbackQuery$data = {| |}, |}; export type RelayModernEnvironmentExecuteWithStreamTestFeedbackQuery = {| - variables: RelayModernEnvironmentExecuteWithStreamTestFeedbackQuery$variables, response: RelayModernEnvironmentExecuteWithStreamTestFeedbackQuery$data, + variables: RelayModernEnvironmentExecuteWithStreamTestFeedbackQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithStreamWithHandlerTestFeedbackFragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithStreamWithHandlerTestFeedbackFragment.graphql.js index 3f4e6bf7d98eb..06a2f43afdbb4 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithStreamWithHandlerTestFeedbackFragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithStreamWithHandlerTestFeedbackFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentExecuteWithStreamWithHandlerTestFeedbackFragment$fragmentType: FragmentType; export type RelayModernEnvironmentExecuteWithStreamWithHandlerTestFeedbackFragment$data = {| - +id: string, +actors: ?$ReadOnlyArray, + +id: string, +$fragmentType: RelayModernEnvironmentExecuteWithStreamWithHandlerTestFeedbackFragment$fragmentType, |}; export type RelayModernEnvironmentExecuteWithStreamWithHandlerTestFeedbackFragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithStreamWithHandlerTestFeedbackQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithStreamWithHandlerTestFeedbackQuery.graphql.js index 5a0331477b3be..db4947d89d91c 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithStreamWithHandlerTestFeedbackQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithStreamWithHandlerTestFeedbackQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<2c5eb1044f4661a303f587b8bdbed6d7>> + * @generated SignedSource<<3eeb293f6b34f83754c39e96cb50d30f>> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type RelayModernEnvironmentExecuteWithStreamWithHandlerTestFeedbackFragment$fragmentType = any; export type RelayModernEnvironmentExecuteWithStreamWithHandlerTestFeedbackQuery$variables = {| - id: string, enableStream: boolean, + id: string, |}; export type RelayModernEnvironmentExecuteWithStreamWithHandlerTestFeedbackQuery$data = {| +node: ?{| @@ -27,8 +27,8 @@ export type RelayModernEnvironmentExecuteWithStreamWithHandlerTestFeedbackQuery$ |}, |}; export type RelayModernEnvironmentExecuteWithStreamWithHandlerTestFeedbackQuery = {| - variables: RelayModernEnvironmentExecuteWithStreamWithHandlerTestFeedbackQuery$variables, response: RelayModernEnvironmentExecuteWithStreamWithHandlerTestFeedbackQuery$data, + variables: RelayModernEnvironmentExecuteWithStreamWithHandlerTestFeedbackQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithStreamedConnectionTestFeedFragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithStreamedConnectionTestFeedFragment.graphql.js index 1b6054c0c8ac8..cf0ff509ada31 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithStreamedConnectionTestFeedFragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithStreamedConnectionTestFeedFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<239e8d80d6d880a59b851e5f35fa5d15>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -24,14 +24,14 @@ export type RelayModernEnvironmentExecuteWithStreamedConnectionTestFeedFragment$ +cursor: ?string, +node: ?{| +__typename: string, - +id: string, +feedback: ?{| - +id: string, +actors: ?$ReadOnlyArray, + +id: string, |}, + +id: string, |}, |}>, +pageInfo: ?{| diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithStreamedConnectionTestFeedQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithStreamedConnectionTestFeedQuery.graphql.js index e3b17b9bdb6cc..c583af45493a6 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithStreamedConnectionTestFeedQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithStreamedConnectionTestFeedQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<630ec1a5f59701fe16c111b92969dd86>> + * @generated SignedSource<<993356666953b585c9d353107a586471>> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type RelayModernEnvironmentExecuteWithStreamedConnectionTestFeedFragment$fragmentType = any; export type RelayModernEnvironmentExecuteWithStreamedConnectionTestFeedQuery$variables = {| - enableStream: boolean, after?: ?string, + enableStream: boolean, |}; export type RelayModernEnvironmentExecuteWithStreamedConnectionTestFeedQuery$data = {| +viewer: ?{| @@ -27,8 +27,8 @@ export type RelayModernEnvironmentExecuteWithStreamedConnectionTestFeedQuery$dat |}, |}; export type RelayModernEnvironmentExecuteWithStreamedConnectionTestFeedQuery = {| - variables: RelayModernEnvironmentExecuteWithStreamedConnectionTestFeedQuery$variables, response: RelayModernEnvironmentExecuteWithStreamedConnectionTestFeedQuery$data, + variables: RelayModernEnvironmentExecuteWithStreamedConnectionTestFeedQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithUndeclaredUnusedArgumentTestQueryWithUnusedFragmentArgumentDefinitionQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithUndeclaredUnusedArgumentTestQueryWithUnusedFragmentArgumentDefinitionQuery.graphql.js index 4774740b9e56f..ab5eb751640c9 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithUndeclaredUnusedArgumentTestQueryWithUnusedFragmentArgumentDefinitionQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithUndeclaredUnusedArgumentTestQueryWithUnusedFragmentArgumentDefinitionQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<80cf23989f21844519c833777db1154f>> + * @generated SignedSource<<8d8bdbe83b125abe966f46c933e3b8c5>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayModernEnvironmentExecuteWithUndeclaredUnusedArgumentTestQueryWi |}, |}; export type RelayModernEnvironmentExecuteWithUndeclaredUnusedArgumentTestQueryWithUnusedFragmentArgumentDefinitionQuery = {| - variables: RelayModernEnvironmentExecuteWithUndeclaredUnusedArgumentTestQueryWithUnusedFragmentArgumentDefinitionQuery$variables, response: RelayModernEnvironmentExecuteWithUndeclaredUnusedArgumentTestQueryWithUnusedFragmentArgumentDefinitionQuery$data, + variables: RelayModernEnvironmentExecuteWithUndeclaredUnusedArgumentTestQueryWithUnusedFragmentArgumentDefinitionQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentLookupTestParentQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentLookupTestParentQuery.graphql.js index 1ccc6a9387669..1968a4763b8c5 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentLookupTestParentQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentLookupTestParentQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<65146fc2703fdc75e5691b51595061d2>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayModernEnvironmentLookupTestParentQuery$data = {| |}, |}; export type RelayModernEnvironmentLookupTestParentQuery = {| - variables: RelayModernEnvironmentLookupTestParentQuery$variables, response: RelayModernEnvironmentLookupTestParentQuery$data, + variables: RelayModernEnvironmentLookupTestParentQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentLookupTestQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentLookupTestQuery.graphql.js index de592265ca053..fe1d7ede5a292 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentLookupTestQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentLookupTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<8c4cbab338f6b471cf7c70991009abd2>> * @flow * @lightSyntaxTransform * @nogrep @@ -29,7 +29,6 @@ export type RelayModernEnvironmentLookupTestQuery$data = {| +node: ?{| +__id: string, +__typename: string, - +id: string, +commentBody?: ?{| +__id: string, +__typename: string, @@ -39,11 +38,12 @@ export type RelayModernEnvironmentLookupTestQuery$data = {| +text: ?string, |}, |}, + +id: string, |}, |}; export type RelayModernEnvironmentLookupTestQuery = {| - variables: RelayModernEnvironmentLookupTestQuery$variables, response: RelayModernEnvironmentLookupTestQuery$data, + variables: RelayModernEnvironmentLookupTestQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentNoInlineTestDeferredStreamQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentNoInlineTestDeferredStreamQuery.graphql.js index 2a11a0fb2f46b..3621fc10127aa 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentNoInlineTestDeferredStreamQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentNoInlineTestDeferredStreamQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<12dcf376f90654307de211abf3cde528>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type RelayModernEnvironmentNoInlineTestDeferredStreamQuery$data = {| |}, |}; export type RelayModernEnvironmentNoInlineTestDeferredStreamQuery = {| - variables: RelayModernEnvironmentNoInlineTestDeferredStreamQuery$variables, response: RelayModernEnvironmentNoInlineTestDeferredStreamQuery$data, + variables: RelayModernEnvironmentNoInlineTestDeferredStreamQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentNoInlineTestModuleMarkdownUserNameRenderer_name.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentNoInlineTestModuleMarkdownUserNameRenderer_name.graphql.js index 263ea5c203c34..d537417355369 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentNoInlineTestModuleMarkdownUserNameRenderer_name.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentNoInlineTestModuleMarkdownUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<39f92753032d5970f379ad5ce9d7e690>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentNoInlineTestModuleMarkdownUserNameRenderer_name$fragmentType: FragmentType; export type RelayModernEnvironmentNoInlineTestModuleMarkdownUserNameRenderer_name$data = {| - +markdown?: ?string, +data?: ?{| +markup: ?string, |}, + +markdown?: ?string, +$fragmentType: RelayModernEnvironmentNoInlineTestModuleMarkdownUserNameRenderer_name$fragmentType, |}; export type RelayModernEnvironmentNoInlineTestModuleMarkdownUserNameRenderer_name$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentNoInlineTestModuleQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentNoInlineTestModuleQuery.graphql.js index 2f6cc08da4c33..7d284436dc8e8 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentNoInlineTestModuleQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentNoInlineTestModuleQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<597d9f6ba8c3bee5ddee4967f620a452>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -32,8 +32,8 @@ export type RelayModernEnvironmentNoInlineTestModuleQuery$data = {| |}, |}; export type RelayModernEnvironmentNoInlineTestModuleQuery = {| - variables: RelayModernEnvironmentNoInlineTestModuleQuery$variables, response: RelayModernEnvironmentNoInlineTestModuleQuery$data, + variables: RelayModernEnvironmentNoInlineTestModuleQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentNoInlineTestNestedQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentNoInlineTestNestedQuery.graphql.js index 1aca48a5e7c7c..43c78bb0829c0 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentNoInlineTestNestedQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentNoInlineTestNestedQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<44d58f321f5731d8cf8251d0ff06c9ea>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayModernEnvironmentNoInlineTestNestedQuery$data = {| +$fragmentSpreads: RelayModernEnvironmentNoInlineTest_nestedNoInlineParent$fragmentType, |}; export type RelayModernEnvironmentNoInlineTestNestedQuery = {| - variables: RelayModernEnvironmentNoInlineTestNestedQuery$variables, response: RelayModernEnvironmentNoInlineTestNestedQuery$data, + variables: RelayModernEnvironmentNoInlineTestNestedQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentNoInlineTestQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentNoInlineTestQuery.graphql.js index e36b433e0c040..c2b87378b0426 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentNoInlineTestQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentNoInlineTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<28f626307180bf5f889733c4e864bac1>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -17,10 +17,10 @@ /*:: import type { ConcreteRequest, Query } from 'relay-runtime'; type RelayModernEnvironmentNoInlineTest_noInline$fragmentType = any; -export type PhotoSize = "SMALL" | "LARGE" | "%future added value"; +export type PhotoSize = ("SMALL" | "LARGE" | "%future added value"); export type RelayModernEnvironmentNoInlineTestQuery$variables = {| - size?: ?$ReadOnlyArray, preset?: ?PhotoSize, + size?: ?$ReadOnlyArray, |}; export type RelayModernEnvironmentNoInlineTestQuery$data = {| +me: ?{| @@ -28,8 +28,8 @@ export type RelayModernEnvironmentNoInlineTestQuery$data = {| |}, |}; export type RelayModernEnvironmentNoInlineTestQuery = {| - variables: RelayModernEnvironmentNoInlineTestQuery$variables, response: RelayModernEnvironmentNoInlineTestQuery$data, + variables: RelayModernEnvironmentNoInlineTestQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentNoInlineTestStreamQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentNoInlineTestStreamQuery.graphql.js index 04c7bac1b445b..4de5cecb8c777 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentNoInlineTestStreamQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentNoInlineTestStreamQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayModernEnvironmentNoInlineTestStreamQuery$data = {| |}, |}; export type RelayModernEnvironmentNoInlineTestStreamQuery = {| - variables: RelayModernEnvironmentNoInlineTestStreamQuery$variables, response: RelayModernEnvironmentNoInlineTestStreamQuery$data, + variables: RelayModernEnvironmentNoInlineTestStreamQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentNoInlineTestWithArgsQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentNoInlineTestWithArgsQuery.graphql.js index 75bc0ce3b443d..8795b2ec1d797 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentNoInlineTestWithArgsQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentNoInlineTestWithArgsQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<86769cda0959faba2fd768060b68516a>> + * @generated SignedSource<<8b47739685a2be9b41b4cbc4a31459f0>> * @flow * @lightSyntaxTransform * @nogrep @@ -17,10 +17,10 @@ /*:: import type { ConcreteRequest, Query } from 'relay-runtime'; type RelayModernEnvironmentNoInlineTestWithArgs_noInline$fragmentType = any; -export type PhotoSize = "SMALL" | "LARGE" | "%future added value"; +export type PhotoSize = ("SMALL" | "LARGE" | "%future added value"); export type RelayModernEnvironmentNoInlineTestWithArgsQuery$variables = {| - size?: ?$ReadOnlyArray, preset?: ?PhotoSize, + size?: ?$ReadOnlyArray, |}; export type RelayModernEnvironmentNoInlineTestWithArgsQuery$data = {| +me: ?{| @@ -31,8 +31,8 @@ export type RelayModernEnvironmentNoInlineTestWithArgsQuery$data = {| |}, |}; export type RelayModernEnvironmentNoInlineTestWithArgsQuery = {| - variables: RelayModernEnvironmentNoInlineTestWithArgsQuery$variables, response: RelayModernEnvironmentNoInlineTestWithArgsQuery$data, + variables: RelayModernEnvironmentNoInlineTestWithArgsQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentNoInlineTest_nestedNoInlineParent.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentNoInlineTest_nestedNoInlineParent.graphql.js index 59a4cb849c6f4..bbacfb1a920d3 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentNoInlineTest_nestedNoInlineParent.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentNoInlineTest_nestedNoInlineParent.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<8daa3bc0e9b838cf0d5dcb6d3f783d74>> + * @generated SignedSource<<64ce330cb9402be98393d92820619a04>> * @flow * @lightSyntaxTransform * @nogrep @@ -20,13 +20,13 @@ type RelayModernEnvironmentNoInlineTest_nestedNoInline$fragmentType = any; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentNoInlineTest_nestedNoInlineParent$fragmentType: FragmentType; export type RelayModernEnvironmentNoInlineTest_nestedNoInlineParent$data = {| - +mark: ?{| + +joe: ?{| +$fragmentSpreads: RelayModernEnvironmentNoInlineTest_nestedNoInline$fragmentType, |}, - +zuck: ?{| + +mark: ?{| +$fragmentSpreads: RelayModernEnvironmentNoInlineTest_nestedNoInline$fragmentType, |}, - +joe: ?{| + +zuck: ?{| +$fragmentSpreads: RelayModernEnvironmentNoInlineTest_nestedNoInline$fragmentType, |}, +$fragmentType: RelayModernEnvironmentNoInlineTest_nestedNoInlineParent$fragmentType, diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatchedUpdatesTestDeferredQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatchedUpdatesTestDeferredQuery.graphql.js index d9dbcfc126962..9d3ea3a30cc46 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatchedUpdatesTestDeferredQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatchedUpdatesTestDeferredQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<5da187e66ba893ab87ab9266ae90d199>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatche |}, |}; export type RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatchedUpdatesTestDeferredQuery = {| - variables: RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatchedUpdatesTestDeferredQuery$variables, response: RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatchedUpdatesTestDeferredQuery$data, + variables: RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatchedUpdatesTestDeferredQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatchedUpdatesTestNestedModuleQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatchedUpdatesTestNestedModuleQuery.graphql.js index 3b224b46f202c..64e39156c513a 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatchedUpdatesTestNestedModuleQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatchedUpdatesTestNestedModuleQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<5d6950bff24fc04681b3a6c558ba3817>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -28,8 +28,8 @@ export type RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatche |}, |}; export type RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatchedUpdatesTestNestedModuleQuery = {| - variables: RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatchedUpdatesTestNestedModuleQuery$variables, response: RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatchedUpdatesTestNestedModuleQuery$data, + variables: RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatchedUpdatesTestNestedModuleQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatchedUpdatesTestNonDeferredQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatchedUpdatesTestNonDeferredQuery.graphql.js index 74bfffbe161fc..e49ed6a3d026f 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatchedUpdatesTestNonDeferredQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatchedUpdatesTestNonDeferredQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<18ff98935a4123f9a7c54083713ea630>> + * @generated SignedSource<<3915ed2fed38fa5c0977dbcbeedc2ea9>> * @flow * @lightSyntaxTransform * @nogrep @@ -22,15 +22,15 @@ type RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatchedUpdate export type RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatchedUpdatesTestNonDeferredQuery$variables = {||}; export type RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatchedUpdatesTestNonDeferredQuery$data = {| +me: ?{| - +name: ?string, +__fragmentPropName: ?string, +__module_component: ?string, + +name: ?string, +$fragmentSpreads: RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatchedUpdatesTestNonDeferred_module_user$fragmentType, |}, |}; export type RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatchedUpdatesTestNonDeferredQuery = {| - variables: RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatchedUpdatesTestNonDeferredQuery$variables, response: RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatchedUpdatesTestNonDeferredQuery$data, + variables: RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatchedUpdatesTestNonDeferredQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatchedUpdatesTest_observation_query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatchedUpdatesTest_observation_query.graphql.js index 4134af4858aa0..748f4b6ee51ba 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatchedUpdatesTest_observation_query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatchedUpdatesTest_observation_query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<5cc7fd6b597bd5299152997224fd4e2e>> + * @generated SignedSource<<9564a4df33d02b914e6097c73eb352d2>> * @flow * @lightSyntaxTransform * @nogrep @@ -20,8 +20,8 @@ import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatchedUpdatesTest_observation_query$fragmentType: FragmentType; export type RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatchedUpdatesTest_observation_query$data = {| +me: ?{| - +name: ?string, +lastName: ?string, + +name: ?string, |}, +$fragmentType: RelayModernEnvironmentPartiallyNormalizedDataObservabilityWithBatchedUpdatesTest_observation_query$fragmentType, |}; diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentQueryCacheExpirationTimeTestQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentQueryCacheExpirationTimeTestQuery.graphql.js index 04266d946ffcd..a2d6b31c136ab 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentQueryCacheExpirationTimeTestQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentQueryCacheExpirationTimeTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<95d74b8695d4837b5d94afcfd64acf2c>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayModernEnvironmentQueryCacheExpirationTimeTestQuery$data = {| |}, |}; export type RelayModernEnvironmentQueryCacheExpirationTimeTestQuery = {| - variables: RelayModernEnvironmentQueryCacheExpirationTimeTestQuery$variables, response: RelayModernEnvironmentQueryCacheExpirationTimeTestQuery$data, + variables: RelayModernEnvironmentQueryCacheExpirationTimeTestQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentRetainTestQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentRetainTestQuery.graphql.js index a046261e90d20..e4ceba7f0e05f 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentRetainTestQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentRetainTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<47d81cbc9b0172e8347cf7f5613d458e>> + * @generated SignedSource<<93411e7300a7f645b5085a5f049e269a>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayModernEnvironmentRetainTestQuery$data = {| |}, |}; export type RelayModernEnvironmentRetainTestQuery = {| - variables: RelayModernEnvironmentRetainTestQuery$variables, response: RelayModernEnvironmentRetainTestQuery$data, + variables: RelayModernEnvironmentRetainTestQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentSubscribeTestParentQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentSubscribeTestParentQuery.graphql.js index 43dcf3bd4474f..3731309ee8f95 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentSubscribeTestParentQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentSubscribeTestParentQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<02a56ded4c2f6fabe8911aa1b4ce5dc1>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayModernEnvironmentSubscribeTestParentQuery$data = {| |}, |}; export type RelayModernEnvironmentSubscribeTestParentQuery = {| - variables: RelayModernEnvironmentSubscribeTestParentQuery$variables, response: RelayModernEnvironmentSubscribeTestParentQuery$data, + variables: RelayModernEnvironmentSubscribeTestParentQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTest1Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTest1Query.graphql.js index ef37c828058c3..2775b8dfab439 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTest1Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTest1Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<56b3ba1b71adb5d2c25a3ef5332f3274>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayModernEnvironmentTypeRefinementTest1Query$data = {| |}, |}; export type RelayModernEnvironmentTypeRefinementTest1Query = {| - variables: RelayModernEnvironmentTypeRefinementTest1Query$variables, response: RelayModernEnvironmentTypeRefinementTest1Query$data, + variables: RelayModernEnvironmentTypeRefinementTest1Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTest2Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTest2Query.graphql.js index 6c68990a8c7a1..6e3d1b29e7339 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTest2Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTest2Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<6eda3c10fcbdf99dd52096968e021d0a>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayModernEnvironmentTypeRefinementTest2Query$data = {| |}, |}; export type RelayModernEnvironmentTypeRefinementTest2Query = {| - variables: RelayModernEnvironmentTypeRefinementTest2Query$variables, response: RelayModernEnvironmentTypeRefinementTest2Query$data, + variables: RelayModernEnvironmentTypeRefinementTest2Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTest3Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTest3Query.graphql.js index 2f03d92985e1a..4539cf5b23483 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTest3Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTest3Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayModernEnvironmentTypeRefinementTest3Query$data = {| |}, |}; export type RelayModernEnvironmentTypeRefinementTest3Query = {| - variables: RelayModernEnvironmentTypeRefinementTest3Query$variables, response: RelayModernEnvironmentTypeRefinementTest3Query$data, + variables: RelayModernEnvironmentTypeRefinementTest3Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTest4Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTest4Query.graphql.js index a57807a5cb2f9..8ea631bf07d16 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTest4Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTest4Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<82f58f84966872268308ea5e96b1f1b4>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayModernEnvironmentTypeRefinementTest4Query$data = {| |}, |}; export type RelayModernEnvironmentTypeRefinementTest4Query = {| - variables: RelayModernEnvironmentTypeRefinementTest4Query$variables, response: RelayModernEnvironmentTypeRefinementTest4Query$data, + variables: RelayModernEnvironmentTypeRefinementTest4Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTest5Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTest5Query.graphql.js index e8e776f308983..f28f37f337de9 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTest5Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTest5Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<2067baf4bb73ff2d78707c452219d253>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayModernEnvironmentTypeRefinementTest5Query$data = {| |}, |}; export type RelayModernEnvironmentTypeRefinementTest5Query = {| - variables: RelayModernEnvironmentTypeRefinementTest5Query$variables, response: RelayModernEnvironmentTypeRefinementTest5Query$data, + variables: RelayModernEnvironmentTypeRefinementTest5Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTest6Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTest6Query.graphql.js index f06e53f751375..776b9f2892d87 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTest6Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTest6Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<8dfc4f17b8f55d85428804dc1a2fae8a>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayModernEnvironmentTypeRefinementTest6Query$data = {| |}, |}; export type RelayModernEnvironmentTypeRefinementTest6Query = {| - variables: RelayModernEnvironmentTypeRefinementTest6Query$variables, response: RelayModernEnvironmentTypeRefinementTest6Query$data, + variables: RelayModernEnvironmentTypeRefinementTest6Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTestAbstractActorFragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTestAbstractActorFragment.graphql.js index 9fd3023cba3df..d4da56ba106d7 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTestAbstractActorFragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTestAbstractActorFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<2b06efb034556fba69414568124d097f>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -20,8 +20,8 @@ import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentTypeRefinementTestAbstractActorFragment$fragmentType: FragmentType; export type RelayModernEnvironmentTypeRefinementTestAbstractActorFragment$data = {| +id: string, - +name: ?string, +missing: ?string, + +name: ?string, +$fragmentType: RelayModernEnvironmentTypeRefinementTestAbstractActorFragment$fragmentType, |}; export type RelayModernEnvironmentTypeRefinementTestAbstractActorFragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTestAbstractInlineRefinementFragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTestAbstractInlineRefinementFragment.graphql.js index da010efbf1250..824ae7543c201 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTestAbstractInlineRefinementFragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTestAbstractInlineRefinementFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<35954d84d6410a98b6bf6013c8839e8d>> + * @generated SignedSource<<18744c7742f7d1dad222016768d0eb37>> * @flow * @lightSyntaxTransform * @nogrep @@ -20,8 +20,8 @@ import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentTypeRefinementTestAbstractInlineRefinementFragment$fragmentType: FragmentType; export type RelayModernEnvironmentTypeRefinementTestAbstractInlineRefinementFragment$data = {| +id?: string, - +name?: ?string, +missing?: ?string, + +name?: ?string, +$fragmentType: RelayModernEnvironmentTypeRefinementTestAbstractInlineRefinementFragment$fragmentType, |}; export type RelayModernEnvironmentTypeRefinementTestAbstractInlineRefinementFragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTestAbstractQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTestAbstractQuery.graphql.js index 01cf972634806..c3cd5bfb041f3 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTestAbstractQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTestAbstractQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<2dc807d289a4b4612f05cb4c0859d233>> + * @generated SignedSource<<9b50b526a73cace195231298cffbf0e7>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type RelayModernEnvironmentTypeRefinementTestAbstractQuery$data = {| |}, |}; export type RelayModernEnvironmentTypeRefinementTestAbstractQuery = {| - variables: RelayModernEnvironmentTypeRefinementTestAbstractQuery$variables, response: RelayModernEnvironmentTypeRefinementTestAbstractQuery$data, + variables: RelayModernEnvironmentTypeRefinementTestAbstractQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTestConcreteInlineRefinementFragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTestConcreteInlineRefinementFragment.graphql.js index 998d5010bd08a..fc9dcf79c9b3b 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTestConcreteInlineRefinementFragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTestConcreteInlineRefinementFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<2b5388798acada0df46a62bb5219616b>> + * @generated SignedSource<<55646320df8eae1564c34a2278714bdf>> * @flow * @lightSyntaxTransform * @nogrep @@ -20,8 +20,8 @@ import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentTypeRefinementTestConcreteInlineRefinementFragment$fragmentType: FragmentType; export type RelayModernEnvironmentTypeRefinementTestConcreteInlineRefinementFragment$data = {| +id?: string, - +name?: ?string, +missing?: ?string, + +name?: ?string, +$fragmentType: RelayModernEnvironmentTypeRefinementTestConcreteInlineRefinementFragment$fragmentType, |}; export type RelayModernEnvironmentTypeRefinementTestConcreteInlineRefinementFragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTestConcreteQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTestConcreteQuery.graphql.js index 702e2ed50dba9..6e98a739eaa9f 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTestConcreteQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTestConcreteQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<094e0ef76e609f0c3bf496d4fbe7b588>> + * @generated SignedSource<<02df9c7f00b16325827dcce32559c305>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type RelayModernEnvironmentTypeRefinementTestConcreteQuery$data = {| |}, |}; export type RelayModernEnvironmentTypeRefinementTestConcreteQuery = {| - variables: RelayModernEnvironmentTypeRefinementTestConcreteQuery$variables, response: RelayModernEnvironmentTypeRefinementTestConcreteQuery$data, + variables: RelayModernEnvironmentTypeRefinementTestConcreteQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTestConcreteUserFragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTestConcreteUserFragment.graphql.js index c52c36381932d..664d3ce92cd33 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTestConcreteUserFragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTestConcreteUserFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<72975faae71d06e03e6621998a7323b3>> + * @generated SignedSource<<2ca3c5923c500ff93e905ff68b5f9f84>> * @flow * @lightSyntaxTransform * @nogrep @@ -20,8 +20,8 @@ import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentTypeRefinementTestConcreteUserFragment$fragmentType: FragmentType; export type RelayModernEnvironmentTypeRefinementTestConcreteUserFragment$data = {| +id: string, - +name: ?string, +missing: ?string, + +name: ?string, +$fragmentType: RelayModernEnvironmentTypeRefinementTestConcreteUserFragment$fragmentType, |}; export type RelayModernEnvironmentTypeRefinementTestConcreteUserFragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTestParentQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTestParentQuery.graphql.js index 1ff2f29a4eaf2..f14b1c344dd09 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTestParentQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentTypeRefinementTestParentQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<1a5527b32787669d740e3e0566ef80a0>> + * @generated SignedSource<<10cd947d7fc850933c92b01e5782d780>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type RelayModernEnvironmentTypeRefinementTestParentQuery$data = {| |}, |}; export type RelayModernEnvironmentTypeRefinementTestParentQuery = {| - variables: RelayModernEnvironmentTypeRefinementTestParentQuery$variables, response: RelayModernEnvironmentTypeRefinementTestParentQuery$data, + variables: RelayModernEnvironmentTypeRefinementTestParentQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentViewerTestQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentViewerTestQuery.graphql.js index aca666e1eeb7a..d0305db8efc21 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentViewerTestQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentViewerTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<39c6f1d2f2b16c6143b49b94691cf32c>> + * @generated SignedSource<<3df5d62dfb0406183c95cc5e10c28702>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type RelayModernEnvironmentViewerTestQuery$data = {| |}, |}; export type RelayModernEnvironmentViewerTestQuery = {| - variables: RelayModernEnvironmentViewerTestQuery$variables, response: RelayModernEnvironmentViewerTestQuery$data, + variables: RelayModernEnvironmentViewerTestQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentViewerTest_SetLocationMutation.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentViewerTest_SetLocationMutation.graphql.js index 1d121e47905b6..b6af99d5b21ac 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentViewerTest_SetLocationMutation.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentViewerTest_SetLocationMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<116b71df7382fd2f1988f0994dfd6561>> * @flow * @lightSyntaxTransform * @nogrep @@ -17,8 +17,8 @@ /*:: import type { ConcreteRequest, Mutation } from 'relay-runtime'; export type LocationInput = {| - longitude?: ?number, latitude?: ?number, + longitude?: ?number, |}; export type RelayModernEnvironmentViewerTest_SetLocationMutation$variables = {| input: LocationInput, @@ -36,8 +36,8 @@ export type RelayModernEnvironmentViewerTest_SetLocationMutation$data = {| |}, |}; export type RelayModernEnvironmentViewerTest_SetLocationMutation = {| - variables: RelayModernEnvironmentViewerTest_SetLocationMutation$variables, response: RelayModernEnvironmentViewerTest_SetLocationMutation$data, + variables: RelayModernEnvironmentViewerTest_SetLocationMutation$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentWithOperationTrackerTest1Mutation.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentWithOperationTrackerTest1Mutation.graphql.js index c7d681df0b171..5cc706028dbed 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentWithOperationTrackerTest1Mutation.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentWithOperationTrackerTest1Mutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<5b2e9568da97133beea80a478a77b8f3>> + * @generated SignedSource<<8bb392bb67fc79e459a508c99f108081>> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Mutation } from 'relay-runtime'; export type CommentCreateInput = {| clientMutationId?: ?string, - feedbackId?: ?string, feedback?: ?CommentfeedbackFeedback, + feedbackId?: ?string, |}; export type CommentfeedbackFeedback = {| comment?: ?FeedbackcommentComment, @@ -39,16 +39,16 @@ export type RelayModernEnvironmentWithOperationTrackerTest1Mutation$data = {| |}, |}, +feedback: ?{| - +id: string, +body: ?{| +text: ?string, |}, + +id: string, |}, |}, |}; export type RelayModernEnvironmentWithOperationTrackerTest1Mutation = {| - variables: RelayModernEnvironmentWithOperationTrackerTest1Mutation$variables, response: RelayModernEnvironmentWithOperationTrackerTest1Mutation$data, + variables: RelayModernEnvironmentWithOperationTrackerTest1Mutation$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentWithOperationTrackerTest1Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentWithOperationTrackerTest1Query.graphql.js index f8a81bb61f1ea..76d46f601a58e 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentWithOperationTrackerTest1Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentWithOperationTrackerTest1Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<08d477ab88c659b4aab42c5c9ba5517b>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -21,7 +21,6 @@ export type RelayModernEnvironmentWithOperationTrackerTest1Query$variables = {| |}; export type RelayModernEnvironmentWithOperationTrackerTest1Query$data = {| +node: ?{| - +id?: string, +body?: ?{| +text: ?string, |}, @@ -35,11 +34,12 @@ export type RelayModernEnvironmentWithOperationTrackerTest1Query$data = {| |}, |}>, |}, + +id?: string, |}, |}; export type RelayModernEnvironmentWithOperationTrackerTest1Query = {| - variables: RelayModernEnvironmentWithOperationTrackerTest1Query$variables, response: RelayModernEnvironmentWithOperationTrackerTest1Query$data, + variables: RelayModernEnvironmentWithOperationTrackerTest1Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentWithOperationTrackerTest2Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentWithOperationTrackerTest2Query.graphql.js index 62a32e823cc92..8934f7aada6eb 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentWithOperationTrackerTest2Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentWithOperationTrackerTest2Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type RelayModernEnvironmentWithOperationTrackerTest2Query$data = {| |}, |}; export type RelayModernEnvironmentWithOperationTrackerTest2Query = {| - variables: RelayModernEnvironmentWithOperationTrackerTest2Query$variables, response: RelayModernEnvironmentWithOperationTrackerTest2Query$data, + variables: RelayModernEnvironmentWithOperationTrackerTest2Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentWithOperationTrackerTestFeedbackFragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentWithOperationTrackerTestFeedbackFragment.graphql.js index 54d2028e36782..20d0fa23179a9 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentWithOperationTrackerTestFeedbackFragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentWithOperationTrackerTestFeedbackFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<4af19709df3de64f86b58a65a274db27>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -24,10 +24,6 @@ type RelayModernEnvironmentWithOperationTrackerTestPlainUserNameRenderer_name$fr import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentWithOperationTrackerTestFeedbackFragment$fragmentType: FragmentType; export type RelayModernEnvironmentWithOperationTrackerTestFeedbackFragment$data = {| - +id: string, - +body: ?{| - +text: ?string, - |}, +author: ?{| +__typename: string, +nameRenderer: ?{| @@ -41,6 +37,10 @@ export type RelayModernEnvironmentWithOperationTrackerTestFeedbackFragment$data +$fragmentSpreads: RelayModernEnvironmentWithOperationTrackerTestPlainUserNameRenderer_name$fragmentType, |}, |}, + +body: ?{| + +text: ?string, + |}, + +id: string, +$fragmentType: RelayModernEnvironmentWithOperationTrackerTestFeedbackFragment$fragmentType, |}; export type RelayModernEnvironmentWithOperationTrackerTestFeedbackFragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentWithOperationTrackerTestMarkdownUserNameRenderer_name.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentWithOperationTrackerTestMarkdownUserNameRenderer_name.graphql.js index b703b7e913cda..016fd35218fab 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentWithOperationTrackerTestMarkdownUserNameRenderer_name.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentWithOperationTrackerTestMarkdownUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<496ee7c98b396369fb2f6d74c79ac15a>> + * @generated SignedSource<<6c83c51c9f2f718d3a32639aa73638e4>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentWithOperationTrackerTestMarkdownUserNameRenderer_name$fragmentType: FragmentType; export type RelayModernEnvironmentWithOperationTrackerTestMarkdownUserNameRenderer_name$data = {| - +markdown: ?string, +data: ?{| +markup: ?string, |}, + +markdown: ?string, +$fragmentType: RelayModernEnvironmentWithOperationTrackerTestMarkdownUserNameRenderer_name$fragmentType, |}; export type RelayModernEnvironmentWithOperationTrackerTestMarkdownUserNameRenderer_name$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentWithOperationTrackerTestMutation.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentWithOperationTrackerTestMutation.graphql.js index 2543360d0e2eb..901af1628cd40 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentWithOperationTrackerTestMutation.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentWithOperationTrackerTestMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<1e511b63a9d5ffef1d8e0031ab9c88df>> + * @generated SignedSource<<4afae9072c6399905a0817b970a1ca85>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,8 +19,8 @@ import type { ConcreteRequest, Mutation } from 'relay-runtime'; type RelayModernEnvironmentWithOperationTrackerTestFeedbackFragment$fragmentType = any; export type CommentCreateInput = {| clientMutationId?: ?string, - feedbackId?: ?string, feedback?: ?CommentfeedbackFeedback, + feedbackId?: ?string, |}; export type CommentfeedbackFeedback = {| comment?: ?FeedbackcommentComment, @@ -39,8 +39,8 @@ export type RelayModernEnvironmentWithOperationTrackerTestMutation$data = {| |}, |}; export type RelayModernEnvironmentWithOperationTrackerTestMutation = {| - variables: RelayModernEnvironmentWithOperationTrackerTestMutation$variables, response: RelayModernEnvironmentWithOperationTrackerTestMutation$data, + variables: RelayModernEnvironmentWithOperationTrackerTestMutation$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentWithOperationTrackerTestPlainUserNameRenderer_name.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentWithOperationTrackerTestPlainUserNameRenderer_name.graphql.js index 1a524683c3c84..0c2be8aec2d95 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentWithOperationTrackerTestPlainUserNameRenderer_name.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentWithOperationTrackerTestPlainUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<06c31d1a3e450774251d71305aa5262d>> + * @generated SignedSource<<46eded76c56319ea11db0d36be77a8c0>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernEnvironmentWithOperationTrackerTestPlainUserNameRenderer_name$fragmentType: FragmentType; export type RelayModernEnvironmentWithOperationTrackerTestPlainUserNameRenderer_name$data = {| - +plaintext: ?string, +data: ?{| +text: ?string, |}, + +plaintext: ?string, +$fragmentType: RelayModernEnvironmentWithOperationTrackerTestPlainUserNameRenderer_name$fragmentType, |}; export type RelayModernEnvironmentWithOperationTrackerTestPlainUserNameRenderer_name$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentWithOperationTrackerTestQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentWithOperationTrackerTestQuery.graphql.js index fc1bccf20f13e..d1e66b4a67b7d 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentWithOperationTrackerTestQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentWithOperationTrackerTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<2e2142ff78b3e2ff2f3f523ebee3f101>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayModernEnvironmentWithOperationTrackerTestQuery$data = {| |}, |}; export type RelayModernEnvironmentWithOperationTrackerTestQuery = {| - variables: RelayModernEnvironmentWithOperationTrackerTestQuery$variables, response: RelayModernEnvironmentWithOperationTrackerTestQuery$data, + variables: RelayModernEnvironmentWithOperationTrackerTestQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernFragmentSpecResolverRequiredFieldNoLoggerTestUserFragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernFragmentSpecResolverRequiredFieldNoLoggerTestUserFragment.graphql.js index 7582ea0b3d95a..06e9c9139815a 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernFragmentSpecResolverRequiredFieldNoLoggerTestUserFragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernFragmentSpecResolverRequiredFieldNoLoggerTestUserFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<5192c1e65084a0f463515703f46623bc>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,8 +19,8 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernFragmentSpecResolverRequiredFieldNoLoggerTestUserFragment$fragmentType: FragmentType; export type RelayModernFragmentSpecResolverRequiredFieldNoLoggerTestUserFragment$data = ?{| - +id: string, +alternate_name: string, + +id: string, +$fragmentType: RelayModernFragmentSpecResolverRequiredFieldNoLoggerTestUserFragment$fragmentType, |}; export type RelayModernFragmentSpecResolverRequiredFieldNoLoggerTestUserFragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernFragmentSpecResolverRequiredFieldNoLoggerTestUserQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernFragmentSpecResolverRequiredFieldNoLoggerTestUserQuery.graphql.js index 5cd93178b5bbd..48b0df009b116 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernFragmentSpecResolverRequiredFieldNoLoggerTestUserQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernFragmentSpecResolverRequiredFieldNoLoggerTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<1dec139789bbe16702935690ebba62d7>> + * @generated SignedSource<<07337edf5e67d9a89fdb2193ebe23225>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayModernFragmentSpecResolverRequiredFieldNoLoggerTestUserQuery$da |}, |}; export type RelayModernFragmentSpecResolverRequiredFieldNoLoggerTestUserQuery = {| - variables: RelayModernFragmentSpecResolverRequiredFieldNoLoggerTestUserQuery$variables, response: RelayModernFragmentSpecResolverRequiredFieldNoLoggerTestUserQuery$data, + variables: RelayModernFragmentSpecResolverRequiredFieldNoLoggerTestUserQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernFragmentSpecResolverRequiredFieldTestUserFragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernFragmentSpecResolverRequiredFieldTestUserFragment.graphql.js index 26083c2de5be1..995e742691861 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernFragmentSpecResolverRequiredFieldTestUserFragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernFragmentSpecResolverRequiredFieldTestUserFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<618cc5f194ce5630fec66bca90cff85f>> + * @generated SignedSource<<94e6a210e4724377bd53456143ad4801>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,9 +19,9 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernFragmentSpecResolverRequiredFieldTestUserFragment$fragmentType: FragmentType; export type RelayModernFragmentSpecResolverRequiredFieldTestUserFragment$data = ?{| + +alternate_name: string, +id: string, +name: string, - +alternate_name: string, +$fragmentType: RelayModernFragmentSpecResolverRequiredFieldTestUserFragment$fragmentType, |}; export type RelayModernFragmentSpecResolverRequiredFieldTestUserFragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernFragmentSpecResolverRequiredFieldTestUserQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernFragmentSpecResolverRequiredFieldTestUserQuery.graphql.js index 91209e4cd423a..77814b483d98e 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernFragmentSpecResolverRequiredFieldTestUserQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernFragmentSpecResolverRequiredFieldTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<8c8b8ce5fcb134b50359fe40b11783da>> + * @generated SignedSource<<576ce18bf48e9b9b364c77ccafde9a2e>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayModernFragmentSpecResolverRequiredFieldTestUserQuery$data = {| |}, |}; export type RelayModernFragmentSpecResolverRequiredFieldTestUserQuery = {| - variables: RelayModernFragmentSpecResolverRequiredFieldTestUserQuery$variables, response: RelayModernFragmentSpecResolverRequiredFieldTestUserQuery$data, + variables: RelayModernFragmentSpecResolverRequiredFieldTestUserQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernFragmentSpecResolverTestAffectingQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernFragmentSpecResolverTestAffectingQuery.graphql.js index f57fafb77222c..beac4bc8a448e 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernFragmentSpecResolverTestAffectingQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernFragmentSpecResolverTestAffectingQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,9 +19,9 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type RelayModernFragmentSpecResolverTestQueryUserFragment$fragmentType = any; type RelayModernFragmentSpecResolverTestQueryUsersFragment$fragmentType = any; export type RelayModernFragmentSpecResolverTestAffectingQuery$variables = {| + fetchSize: boolean, id: string, size?: ?$ReadOnlyArray, - fetchSize: boolean, |}; export type RelayModernFragmentSpecResolverTestAffectingQuery$data = {| +node: ?{| @@ -29,8 +29,8 @@ export type RelayModernFragmentSpecResolverTestAffectingQuery$data = {| |}, |}; export type RelayModernFragmentSpecResolverTestAffectingQuery = {| - variables: RelayModernFragmentSpecResolverTestAffectingQuery$variables, response: RelayModernFragmentSpecResolverTestAffectingQuery$data, + variables: RelayModernFragmentSpecResolverTestAffectingQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernFragmentSpecResolverTestQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernFragmentSpecResolverTestQuery.graphql.js index 7063a40bbe7a2..56e63b0171194 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernFragmentSpecResolverTestQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernFragmentSpecResolverTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<73816cff036b0b1149b9db01caf4079d>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,9 +19,9 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type RelayModernFragmentSpecResolverTestQueryUserFragment$fragmentType = any; type RelayModernFragmentSpecResolverTestQueryUsersFragment$fragmentType = any; export type RelayModernFragmentSpecResolverTestQuery$variables = {| + fetchSize: boolean, id: string, size?: ?$ReadOnlyArray, - fetchSize: boolean, |}; export type RelayModernFragmentSpecResolverTestQuery$data = {| +node: ?{| @@ -29,8 +29,8 @@ export type RelayModernFragmentSpecResolverTestQuery$data = {| |}, |}; export type RelayModernFragmentSpecResolverTestQuery = {| - variables: RelayModernFragmentSpecResolverTestQuery$variables, response: RelayModernFragmentSpecResolverTestQuery$data, + variables: RelayModernFragmentSpecResolverTestQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernFragmentSpecResolverWithFragmentOwnershipTestUserQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernFragmentSpecResolverWithFragmentOwnershipTestUserQuery.graphql.js index 5a235a57cfd48..5c8a030d62572 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernFragmentSpecResolverWithFragmentOwnershipTestUserQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernFragmentSpecResolverWithFragmentOwnershipTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<83096bc1acd0013e8d2d8b9f9c1ca844>> + * @generated SignedSource<<0d080c03d9b8b192629ad9857cffc178>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,9 +19,9 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type RelayModernFragmentSpecResolverWithFragmentOwnershipTestUserFragment$fragmentType = any; type RelayModernFragmentSpecResolverWithFragmentOwnershipTestUsersFragment$fragmentType = any; export type RelayModernFragmentSpecResolverWithFragmentOwnershipTestUserQuery$variables = {| + fetchSize: boolean, id: string, size?: ?$ReadOnlyArray, - fetchSize: boolean, |}; export type RelayModernFragmentSpecResolverWithFragmentOwnershipTestUserQuery$data = {| +node: ?{| @@ -29,8 +29,8 @@ export type RelayModernFragmentSpecResolverWithFragmentOwnershipTestUserQuery$da |}, |}; export type RelayModernFragmentSpecResolverWithFragmentOwnershipTestUserQuery = {| - variables: RelayModernFragmentSpecResolverWithFragmentOwnershipTestUserQuery$variables, response: RelayModernFragmentSpecResolverWithFragmentOwnershipTestUserQuery$data, + variables: RelayModernFragmentSpecResolverWithFragmentOwnershipTestUserQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernSelectorTestUserQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernSelectorTestUserQuery.graphql.js index 68535d36b081f..43b3694e761d4 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernSelectorTestUserQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernSelectorTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<97cf93a0923191abff6016f1a324105a>> + * @generated SignedSource<<86fd4e0ca4229b362408db98a5139966>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,9 +19,9 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type RelayModernSelectorTestUserFragment$fragmentType = any; type RelayModernSelectorTestUsersFragment$fragmentType = any; export type RelayModernSelectorTestUserQuery$variables = {| + cond: boolean, id: string, size?: ?$ReadOnlyArray, - cond: boolean, |}; export type RelayModernSelectorTestUserQuery$data = {| +node: ?{| @@ -29,8 +29,8 @@ export type RelayModernSelectorTestUserQuery$data = {| |}, |}; export type RelayModernSelectorTestUserQuery = {| - variables: RelayModernSelectorTestUserQuery$variables, response: RelayModernSelectorTestUserQuery$data, + variables: RelayModernSelectorTestUserQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreSubscriptionsTest1Fragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreSubscriptionsTest1Fragment.graphql.js index 1083a209dfa94..5088c98c06541 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreSubscriptionsTest1Fragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreSubscriptionsTest1Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,11 +19,11 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernStoreSubscriptionsTest1Fragment$fragmentType: FragmentType; export type RelayModernStoreSubscriptionsTest1Fragment$data = {| + +emailAddresses: ?$ReadOnlyArray, +name: ?string, +profilePicture: ?{| +uri: ?string, |}, - +emailAddresses: ?$ReadOnlyArray, +$fragmentType: RelayModernStoreSubscriptionsTest1Fragment$fragmentType, |}; export type RelayModernStoreSubscriptionsTest1Fragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreSubscriptionsTest1Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreSubscriptionsTest1Query.graphql.js index ad2fa1f024384..d7f90275abbf6 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreSubscriptionsTest1Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreSubscriptionsTest1Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<2f057c691d3741e872272ed2cf117549>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayModernStoreSubscriptionsTest1Query$data = {| |}, |}; export type RelayModernStoreSubscriptionsTest1Query = {| - variables: RelayModernStoreSubscriptionsTest1Query$variables, response: RelayModernStoreSubscriptionsTest1Query$data, + variables: RelayModernStoreSubscriptionsTest1Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreSubscriptionsTest2Fragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreSubscriptionsTest2Fragment.graphql.js index a195777d25008..9609dd8fa5e3c 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreSubscriptionsTest2Fragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreSubscriptionsTest2Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,11 +19,11 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernStoreSubscriptionsTest2Fragment$fragmentType: FragmentType; export type RelayModernStoreSubscriptionsTest2Fragment$data = {| + +emailAddresses: ?$ReadOnlyArray, +name: ?string, +profilePicture: ?{| +uri: ?string, |}, - +emailAddresses: ?$ReadOnlyArray, +$fragmentType: RelayModernStoreSubscriptionsTest2Fragment$fragmentType, |}; export type RelayModernStoreSubscriptionsTest2Fragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreSubscriptionsTest2Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreSubscriptionsTest2Query.graphql.js index c4c8360d60fc0..91aed8af060ce 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreSubscriptionsTest2Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreSubscriptionsTest2Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<878d29b88f441929eccd8c91614395e5>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayModernStoreSubscriptionsTest2Query$data = {| |}, |}; export type RelayModernStoreSubscriptionsTest2Query = {| - variables: RelayModernStoreSubscriptionsTest2Query$variables, response: RelayModernStoreSubscriptionsTest2Query$data, + variables: RelayModernStoreSubscriptionsTest2Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest1Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest1Query.graphql.js index 8e9938981ebcd..d6034c2369373 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest1Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest1Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<462552b9d2d920c85da77f135e1fd5fc>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type RelayModernStoreTest1Query$data = {| |}, |}; export type RelayModernStoreTest1Query = {| - variables: RelayModernStoreTest1Query$variables, response: RelayModernStoreTest1Query$data, + variables: RelayModernStoreTest1Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest2Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest2Query.graphql.js index 39b490b717811..56cc7fb7431ad 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest2Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest2Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<8e83b1d0ddbf3efe0024acccef5f03c5>> + * @generated SignedSource<<713aaad32959f1ee7a6978f1b486f4c8>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayModernStoreTest2Query$data = {| |}, |}; export type RelayModernStoreTest2Query = {| - variables: RelayModernStoreTest2Query$variables, response: RelayModernStoreTest2Query$data, + variables: RelayModernStoreTest2Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest3Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest3Query.graphql.js index 1942279c89c98..783e393926c75 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest3Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest3Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayModernStoreTest3Query$data = {| |}, |}; export type RelayModernStoreTest3Query = {| - variables: RelayModernStoreTest3Query$variables, response: RelayModernStoreTest3Query$data, + variables: RelayModernStoreTest3Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest4Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest4Query.graphql.js index f833cfdfd783c..8b6b742ff3269 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest4Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest4Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<615452015c9df7dc2b6d6a9ae7abda68>> + * @generated SignedSource<<5689b85dbc8f573d51977897b36c4f64>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayModernStoreTest4Query$data = {| |}, |}; export type RelayModernStoreTest4Query = {| - variables: RelayModernStoreTest4Query$variables, response: RelayModernStoreTest4Query$data, + variables: RelayModernStoreTest4Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest5Fragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest5Fragment.graphql.js index 1b247314befd3..11ba41a9677f9 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest5Fragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest5Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,11 +19,11 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernStoreTest5Fragment$fragmentType: FragmentType; export type RelayModernStoreTest5Fragment$data = {| + +emailAddresses: ?$ReadOnlyArray, +name: ?string, +profilePicture: ?{| +uri: ?string, |}, - +emailAddresses: ?$ReadOnlyArray, +$fragmentType: RelayModernStoreTest5Fragment$fragmentType, |}; export type RelayModernStoreTest5Fragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest5Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest5Query.graphql.js index 091779247d26c..945b091b3adab 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest5Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest5Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<9296fe0e1e4cc402a37b74421da56cdc>> + * @generated SignedSource<<05084768d43eebd5d66c0a0bf4997707>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayModernStoreTest5Query$data = {| |}, |}; export type RelayModernStoreTest5Query = {| - variables: RelayModernStoreTest5Query$variables, response: RelayModernStoreTest5Query$data, + variables: RelayModernStoreTest5Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest6Fragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest6Fragment.graphql.js index 49e8d1d19232e..35a5cc9b6fdf9 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest6Fragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest6Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<85e55318faffec04ff4832cea9aa22b6>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,11 +19,11 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayModernStoreTest6Fragment$fragmentType: FragmentType; export type RelayModernStoreTest6Fragment$data = {| + +emailAddresses: ?$ReadOnlyArray, +name: ?string, +profilePicture: ?{| +uri: ?string, |}, - +emailAddresses: ?$ReadOnlyArray, +$fragmentType: RelayModernStoreTest6Fragment$fragmentType, |}; export type RelayModernStoreTest6Fragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest6Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest6Query.graphql.js index 6f786f159348c..910e84bbdf7be 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest6Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest6Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<60013a2be4433140d3cf2809c8b27b5c>> + * @generated SignedSource<<316ec08bc21e2304a8203712ab58cfc6>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type RelayModernStoreTest6Query$data = {| |}, |}; export type RelayModernStoreTest6Query = {| - variables: RelayModernStoreTest6Query$variables, response: RelayModernStoreTest6Query$data, + variables: RelayModernStoreTest6Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest7Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest7Query.graphql.js index 36a3caaaf4789..d83e97c6f99a5 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest7Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest7Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<2baaf5cd6c587f97e85108f2e2187335>> + * @generated SignedSource<<4c333673bc7d52c70672df2462722810>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type RelayModernStoreTest7Query$data = {| |}, |}; export type RelayModernStoreTest7Query = {| - variables: RelayModernStoreTest7Query$variables, response: RelayModernStoreTest7Query$data, + variables: RelayModernStoreTest7Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest8Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest8Query.graphql.js index 1628197983698..642fd90ebfd93 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest8Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest8Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<8a31a5e4587bf6e757f89e8ec64c632e>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type RelayModernStoreTest8Query$data = {| |}, |}; export type RelayModernStoreTest8Query = {| - variables: RelayModernStoreTest8Query$variables, response: RelayModernStoreTest8Query$data, + variables: RelayModernStoreTest8Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest9Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest9Query.graphql.js index 6a7a0a3e275d6..fa1d4149eba57 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest9Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTest9Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<06657756fa64406eecc8616cf3f01d01>> + * @generated SignedSource<<9e22bc8ad49aaa58ce1fce6926271c3b>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type RelayModernStoreTest9Query$data = {| |}, |}; export type RelayModernStoreTest9Query = {| - variables: RelayModernStoreTest9Query$variables, response: RelayModernStoreTest9Query$data, + variables: RelayModernStoreTest9Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTestJoeQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTestJoeQuery.graphql.js index a943d2a6aa611..199493b573550 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTestJoeQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayModernStoreTestJoeQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<75354c3797949fb053674041566676e3>> + * @generated SignedSource<<17b98323fd13a8c0ce17ce1e5d966a30>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayModernStoreTestJoeQuery$data = {| +$fragmentSpreads: RelayModernStoreTestJoeFragment$fragmentType, |}; export type RelayModernStoreTestJoeQuery = {| - variables: RelayModernStoreTestJoeQuery$variables, response: RelayModernStoreTestJoeQuery$data, + variables: RelayModernStoreTestJoeQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayOperationTrackerTest1Mutation.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayOperationTrackerTest1Mutation.graphql.js index f5623d3aad281..a033231a778e2 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayOperationTrackerTest1Mutation.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayOperationTrackerTest1Mutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<9d3f45b4f3843e5e3664779aa70ade21>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Mutation } from 'relay-runtime'; export type CommentCreateInput = {| clientMutationId?: ?string, - feedbackId?: ?string, feedback?: ?CommentfeedbackFeedback, + feedbackId?: ?string, |}; export type CommentfeedbackFeedback = {| comment?: ?FeedbackcommentComment, @@ -36,8 +36,8 @@ export type RelayOperationTrackerTest1Mutation$data = {| |}, |}; export type RelayOperationTrackerTest1Mutation = {| - variables: RelayOperationTrackerTest1Mutation$variables, response: RelayOperationTrackerTest1Mutation$data, + variables: RelayOperationTrackerTest1Mutation$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayOperationTrackerTest1Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayOperationTrackerTest1Query.graphql.js index 17181cbd3c06c..6eaefa717d2b0 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayOperationTrackerTest1Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayOperationTrackerTest1Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<5401f4c7ba67298e4ec8cb1845c7de0a>> + * @generated SignedSource<<9d72f2a73bb0b5e079357ed2d3d54ce9>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type RelayOperationTrackerTest1Query$data = {| |}, |}; export type RelayOperationTrackerTest1Query = {| - variables: RelayOperationTrackerTest1Query$variables, response: RelayOperationTrackerTest1Query$data, + variables: RelayOperationTrackerTest1Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayOperationTrackerTest2Mutation.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayOperationTrackerTest2Mutation.graphql.js index 5e6d98cd2408a..08c729c2362a8 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayOperationTrackerTest2Mutation.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayOperationTrackerTest2Mutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<7de7d9abf1dfe95f7f544e9322a39bfe>> * @flow * @lightSyntaxTransform * @nogrep @@ -29,8 +29,8 @@ export type RelayOperationTrackerTest2Mutation$data = {| |}, |}; export type RelayOperationTrackerTest2Mutation = {| - variables: RelayOperationTrackerTest2Mutation$variables, response: RelayOperationTrackerTest2Mutation$data, + variables: RelayOperationTrackerTest2Mutation$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayOperationTrackerTest2Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayOperationTrackerTest2Query.graphql.js index bf4fad8e05816..2d34eaa7ab459 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayOperationTrackerTest2Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayOperationTrackerTest2Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<04791c5de0bd2fbbd743bdd02816d931>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type RelayOperationTrackerTest2Query$data = {| |}, |}; export type RelayOperationTrackerTest2Query = {| - variables: RelayOperationTrackerTest2Query$variables, response: RelayOperationTrackerTest2Query$data, + variables: RelayOperationTrackerTest2Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest10Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest10Query.graphql.js index c121e06d6b511..52c84c9445125 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest10Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest10Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<759d68d72ce5ae5492383a9b9d6fa813>> + * @generated SignedSource<<2e9a1f5392d4e5d6ec8b495ac8631b22>> * @flow * @lightSyntaxTransform * @nogrep @@ -23,8 +23,8 @@ export type RelayPublishQueueTest10Query$data = {| |}, |}; export type RelayPublishQueueTest10Query = {| - variables: RelayPublishQueueTest10Query$variables, response: RelayPublishQueueTest10Query$data, + variables: RelayPublishQueueTest10Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest11Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest11Query.graphql.js index 5a2111387b67c..9336832c865dd 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest11Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest11Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<5c5c7f0a5928ed99b36ba4ff3be1e882>> * @flow * @lightSyntaxTransform * @nogrep @@ -23,8 +23,8 @@ export type RelayPublishQueueTest11Query$data = {| |}, |}; export type RelayPublishQueueTest11Query = {| - variables: RelayPublishQueueTest11Query$variables, response: RelayPublishQueueTest11Query$data, + variables: RelayPublishQueueTest11Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest1Mutation.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest1Mutation.graphql.js index 51ec2801ad5c4..2cee2523dcfce 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest1Mutation.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest1Mutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<566a8226b6b14c2ddb9d67d11a0af206>> + * @generated SignedSource<<47a7845c68ec5d12e3059fed6cee3d23>> * @flow * @lightSyntaxTransform * @nogrep @@ -31,8 +31,8 @@ export type RelayPublishQueueTest1Mutation$data = {| |}, |}; export type RelayPublishQueueTest1Mutation = {| - variables: RelayPublishQueueTest1Mutation$variables, response: RelayPublishQueueTest1Mutation$data, + variables: RelayPublishQueueTest1Mutation$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest1Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest1Query.graphql.js index 0754870c0165d..ddd5ce5cd4664 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest1Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest1Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<72f8043904d951e55eb3bae504bbe5e0>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -23,8 +23,8 @@ export type RelayPublishQueueTest1Query$data = {| |}, |}; export type RelayPublishQueueTest1Query = {| - variables: RelayPublishQueueTest1Query$variables, response: RelayPublishQueueTest1Query$data, + variables: RelayPublishQueueTest1Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest2Mutation.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest2Mutation.graphql.js index 52523fc6de979..fb0cef15c2f41 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest2Mutation.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest2Mutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<4d3f6825912f8f7d084af8a8fc6e1132>> + * @generated SignedSource<<6cbb90833155fb75a8473d55388e9f70>> * @flow * @lightSyntaxTransform * @nogrep @@ -31,8 +31,8 @@ export type RelayPublishQueueTest2Mutation$data = {| |}, |}; export type RelayPublishQueueTest2Mutation = {| - variables: RelayPublishQueueTest2Mutation$variables, response: RelayPublishQueueTest2Mutation$data, + variables: RelayPublishQueueTest2Mutation$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest2Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest2Query.graphql.js index df59822e64673..c219ad6a02989 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest2Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest2Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<506c694bcbc71150e74711bcdd26c817>> * @flow * @lightSyntaxTransform * @nogrep @@ -28,8 +28,8 @@ export type RelayPublishQueueTest2Query$data = {| |}>, |}; export type RelayPublishQueueTest2Query = {| - variables: RelayPublishQueueTest2Query$variables, response: RelayPublishQueueTest2Query$data, + variables: RelayPublishQueueTest2Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest3Mutation.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest3Mutation.graphql.js index 9198d11bd34b8..485df19884089 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest3Mutation.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest3Mutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<3b73670acbec63df90cd0c729ece6163>> + * @generated SignedSource<<336689079e61a5d301c660a064b6ea5f>> * @flow * @lightSyntaxTransform * @nogrep @@ -31,8 +31,8 @@ export type RelayPublishQueueTest3Mutation$data = {| |}, |}; export type RelayPublishQueueTest3Mutation = {| - variables: RelayPublishQueueTest3Mutation$variables, response: RelayPublishQueueTest3Mutation$data, + variables: RelayPublishQueueTest3Mutation$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest3Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest3Query.graphql.js index 553395f80f76b..5a173bf604b2f 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest3Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest3Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<6bd41719bea51b60e6097c6e61c36772>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type RelayPublishQueueTest3Query$data = {| |}, |}; export type RelayPublishQueueTest3Query = {| - variables: RelayPublishQueueTest3Query$variables, response: RelayPublishQueueTest3Query$data, + variables: RelayPublishQueueTest3Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest4Mutation.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest4Mutation.graphql.js index 0c11d963586e6..7bb8a46374303 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest4Mutation.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest4Mutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<3bc9433db5fa3ed41f044acdd0f74e76>> + * @generated SignedSource<<5c3e7a0c6c547b02af28669978912eac>> * @flow * @lightSyntaxTransform * @nogrep @@ -31,8 +31,8 @@ export type RelayPublishQueueTest4Mutation$data = {| |}, |}; export type RelayPublishQueueTest4Mutation = {| - variables: RelayPublishQueueTest4Mutation$variables, response: RelayPublishQueueTest4Mutation$data, + variables: RelayPublishQueueTest4Mutation$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest4Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest4Query.graphql.js index 0fce1133f5a70..67338d9e13cd6 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest4Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest4Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<20b49a5ea7ceed445fd7b2f168681ef5>> + * @generated SignedSource<<759ff4f38099fc574b75790b6d698eed>> * @flow * @lightSyntaxTransform * @nogrep @@ -23,8 +23,8 @@ export type RelayPublishQueueTest4Query$data = {| |}, |}; export type RelayPublishQueueTest4Query = {| - variables: RelayPublishQueueTest4Query$variables, response: RelayPublishQueueTest4Query$data, + variables: RelayPublishQueueTest4Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest5Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest5Query.graphql.js index 0402cc9ccdecb..eb2b7722b67c6 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest5Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest5Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<364841fa16dfc94a167ef0ebd20f617a>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -23,8 +23,8 @@ export type RelayPublishQueueTest5Query$data = {| |}, |}; export type RelayPublishQueueTest5Query = {| - variables: RelayPublishQueueTest5Query$variables, response: RelayPublishQueueTest5Query$data, + variables: RelayPublishQueueTest5Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest6Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest6Query.graphql.js index 61dafe646a499..c9cba86bebdd8 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest6Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest6Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<65b860ee736d5cbc6538e24c31da8196>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -23,8 +23,8 @@ export type RelayPublishQueueTest6Query$data = {| |}, |}; export type RelayPublishQueueTest6Query = {| - variables: RelayPublishQueueTest6Query$variables, response: RelayPublishQueueTest6Query$data, + variables: RelayPublishQueueTest6Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest7Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest7Query.graphql.js index 141d119739ee3..0990dc900c163 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest7Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest7Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<952f65d7a66342260ef3710cbc0895a0>> + * @generated SignedSource<<071f87ddaef8f9b303d68f02b82b5e15>> * @flow * @lightSyntaxTransform * @nogrep @@ -23,8 +23,8 @@ export type RelayPublishQueueTest7Query$data = {| |}, |}; export type RelayPublishQueueTest7Query = {| - variables: RelayPublishQueueTest7Query$variables, response: RelayPublishQueueTest7Query$data, + variables: RelayPublishQueueTest7Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest8Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest8Query.graphql.js index f92d60edc4d46..962954c56f382 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest8Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest8Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<651c4ba64c73e5075dad61d918d0b0b1>> * @flow * @lightSyntaxTransform * @nogrep @@ -28,8 +28,8 @@ export type RelayPublishQueueTest8Query$data = {| |}>, |}; export type RelayPublishQueueTest8Query = {| - variables: RelayPublishQueueTest8Query$variables, response: RelayPublishQueueTest8Query$data, + variables: RelayPublishQueueTest8Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest9Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest9Query.graphql.js index 7e2531e79626c..17eb07c69adf2 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest9Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayPublishQueueTest9Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -28,8 +28,8 @@ export type RelayPublishQueueTest9Query$data = {| |}>, |}; export type RelayPublishQueueTest9Query = {| - variables: RelayPublishQueueTest9Query$variables, response: RelayPublishQueueTest9Query$data, + variables: RelayPublishQueueTest9Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest10Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest10Query.graphql.js index 3078ff4e76cad..7a3ea735346d3 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest10Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest10Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<4b0c580bc059faa974d522950dfd44fb>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayReaderRequiredFieldsTest10Query$data = {| |}, |}; export type RelayReaderRequiredFieldsTest10Query = {| - variables: RelayReaderRequiredFieldsTest10Query$variables, response: RelayReaderRequiredFieldsTest10Query$data, + variables: RelayReaderRequiredFieldsTest10Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest11Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest11Query.graphql.js index f95f583fe9dab..c0e2a38bed3a9 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest11Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest11Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<87f67ab5520c029a4ca65019b12d6a2c>> + * @generated SignedSource<<42d78b80fc86f93088dc4bb44eb58f20>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type RelayReaderRequiredFieldsTest11Query$data = {| |}, |}; export type RelayReaderRequiredFieldsTest11Query = {| - variables: RelayReaderRequiredFieldsTest11Query$variables, response: RelayReaderRequiredFieldsTest11Query$data, + variables: RelayReaderRequiredFieldsTest11Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest12Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest12Query.graphql.js index 87b0fee9987fe..5c53416b29f5f 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest12Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest12Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -23,8 +23,8 @@ export type RelayReaderRequiredFieldsTest12Query$data = {| |}, |}; export type RelayReaderRequiredFieldsTest12Query = {| - variables: RelayReaderRequiredFieldsTest12Query$variables, response: RelayReaderRequiredFieldsTest12Query$data, + variables: RelayReaderRequiredFieldsTest12Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest13Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest13Query.graphql.js index 2d8551c1ad917..e5136e2b0117a 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest13Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest13Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<1ae5062807de744df1d7340273422dfe>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,13 +19,13 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; export type RelayReaderRequiredFieldsTest13Query$variables = {||}; export type RelayReaderRequiredFieldsTest13Query$data = {| +maybeNodeInterface: ?{| - +name: ?string, +lastName?: string, + +name: ?string, |}, |}; export type RelayReaderRequiredFieldsTest13Query = {| - variables: RelayReaderRequiredFieldsTest13Query$variables, response: RelayReaderRequiredFieldsTest13Query$data, + variables: RelayReaderRequiredFieldsTest13Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest14Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest14Query.graphql.js index 3b8a7fbd2ff6c..ec31b76d0decb 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest14Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest14Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<77cf47518adabf7efc18d12511575763>> + * @generated SignedSource<<9decf99194c7fcc475a71f05a31c2026>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type RelayReaderRequiredFieldsTest14Query$data = {| |}, |}; export type RelayReaderRequiredFieldsTest14Query = {| - variables: RelayReaderRequiredFieldsTest14Query$variables, response: RelayReaderRequiredFieldsTest14Query$data, + variables: RelayReaderRequiredFieldsTest14Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest15Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest15Query.graphql.js index bd5a4699f2409..5b5a23648161a 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest15Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest15Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type RelayReaderRequiredFieldsTest15Query$data = {| |}, |}; export type RelayReaderRequiredFieldsTest15Query = {| - variables: RelayReaderRequiredFieldsTest15Query$variables, response: RelayReaderRequiredFieldsTest15Query$data, + variables: RelayReaderRequiredFieldsTest15Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest16Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest16Query.graphql.js index 071078562a341..13a9e2f9465db 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest16Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest16Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<7f261335b52857379bcd218ef1867fac>> + * @generated SignedSource<<5e42628a7ddd9a8a7f7d0c373391ceca>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayReaderRequiredFieldsTest16Query$data = {| |}, |}; export type RelayReaderRequiredFieldsTest16Query = {| - variables: RelayReaderRequiredFieldsTest16Query$variables, response: RelayReaderRequiredFieldsTest16Query$data, + variables: RelayReaderRequiredFieldsTest16Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest17Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest17Query.graphql.js index 26adc7dc95659..363f78fe27780 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest17Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest17Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayReaderRequiredFieldsTest17Query$data = {| |}, |}; export type RelayReaderRequiredFieldsTest17Query = {| - variables: RelayReaderRequiredFieldsTest17Query$variables, response: RelayReaderRequiredFieldsTest17Query$data, + variables: RelayReaderRequiredFieldsTest17Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest18Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest18Query.graphql.js index 821caf684a3dc..ae07f283a570d 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest18Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest18Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<19ec412e47117c6442d048400e9498d6>> + * @generated SignedSource<<0de6cd484803c4bf48174fa176960f63>> * @flow * @lightSyntaxTransform * @nogrep @@ -23,8 +23,8 @@ export type RelayReaderRequiredFieldsTest18Query$data = {| |}, |}; export type RelayReaderRequiredFieldsTest18Query = {| - variables: RelayReaderRequiredFieldsTest18Query$variables, response: RelayReaderRequiredFieldsTest18Query$data, + variables: RelayReaderRequiredFieldsTest18Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest19Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest19Query.graphql.js index d5e6006a3b0b7..82d6e289162a6 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest19Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest19Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<9a5bb1b12b7017c4a9733c9e4a3bdfd2>> + * @generated SignedSource<<5aed5a320d0f6ca6e6782491fffb35f7>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayReaderRequiredFieldsTest19Query$data = {| |}, |}; export type RelayReaderRequiredFieldsTest19Query = {| - variables: RelayReaderRequiredFieldsTest19Query$variables, response: RelayReaderRequiredFieldsTest19Query$data, + variables: RelayReaderRequiredFieldsTest19Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest20Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest20Query.graphql.js index fc49a8097e153..050c2d8b63675 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest20Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest20Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<7a131bd179674ee6d4aea3fb190b439f>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayReaderRequiredFieldsTest20Query$data = {| |}, |}; export type RelayReaderRequiredFieldsTest20Query = {| - variables: RelayReaderRequiredFieldsTest20Query$variables, response: RelayReaderRequiredFieldsTest20Query$data, + variables: RelayReaderRequiredFieldsTest20Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest21Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest21Query.graphql.js index d36e2043dfe48..30a2fd8366fc6 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest21Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest21Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<7718045bf447ccfc32dd37c0bfb9fb2c>> + * @generated SignedSource<<9167a3bf9d673946924399ffe0826c70>> * @flow * @lightSyntaxTransform * @nogrep @@ -22,8 +22,8 @@ export type RelayReaderRequiredFieldsTest21Query$data = {| +$fragmentSpreads: RelayReaderRequiredFieldsTest3Fragment$fragmentType, |}; export type RelayReaderRequiredFieldsTest21Query = {| - variables: RelayReaderRequiredFieldsTest21Query$variables, response: RelayReaderRequiredFieldsTest21Query$data, + variables: RelayReaderRequiredFieldsTest21Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest22Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest22Query.graphql.js index 681edfccb9c34..5f4fcedbc5fc5 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest22Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest22Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<8c0d8705f7b525b5c3dc71978c6ae352>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type RelayReaderRequiredFieldsTest22Query$data = ?{| +$fragmentSpreads: RelayReaderRequiredFieldsTest4Fragment$fragmentType, |}; export type RelayReaderRequiredFieldsTest22Query = {| - variables: RelayReaderRequiredFieldsTest22Query$variables, response: RelayReaderRequiredFieldsTest22Query$data, + variables: RelayReaderRequiredFieldsTest22Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest23Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest23Query.graphql.js index 94476b89d2a3b..18a24e90bfe0a 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest23Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest23Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<272fbe33b33ed758bd7fbc6a203e343f>> + * @generated SignedSource<<9d41482218d546ff51c882a512c7ba63>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayReaderRequiredFieldsTest23Query$data = {| |}, |}; export type RelayReaderRequiredFieldsTest23Query = {| - variables: RelayReaderRequiredFieldsTest23Query$variables, response: RelayReaderRequiredFieldsTest23Query$data, + variables: RelayReaderRequiredFieldsTest23Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest2Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest2Query.graphql.js index d84da6de66c43..7ff46f5f97905 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest2Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest2Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<878e4015e299af7428177311e03d36c9>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayReaderRequiredFieldsTest2Query$data = {| |}, |}; export type RelayReaderRequiredFieldsTest2Query = {| - variables: RelayReaderRequiredFieldsTest2Query$variables, response: RelayReaderRequiredFieldsTest2Query$data, + variables: RelayReaderRequiredFieldsTest2Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest3Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest3Query.graphql.js index fd27e845f9a7e..0b7bc4ebe311c 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest3Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest3Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<22b3c7cd5fb80f140b4740033e92c18a>> + * @generated SignedSource<<139fe2b30a10548785c091a8a0666445>> * @flow * @lightSyntaxTransform * @nogrep @@ -23,8 +23,8 @@ export type RelayReaderRequiredFieldsTest3Query$data = {| |}, |}; export type RelayReaderRequiredFieldsTest3Query = {| - variables: RelayReaderRequiredFieldsTest3Query$variables, response: RelayReaderRequiredFieldsTest3Query$data, + variables: RelayReaderRequiredFieldsTest3Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest4Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest4Query.graphql.js index db69d5abc90a3..7c0d4090a719a 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest4Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest4Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,13 +19,13 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; export type RelayReaderRequiredFieldsTest4Query$variables = {||}; export type RelayReaderRequiredFieldsTest4Query$data = {| +me: ?{| - +lastName: string, +firstName: string, + +lastName: string, |}, |}; export type RelayReaderRequiredFieldsTest4Query = {| - variables: RelayReaderRequiredFieldsTest4Query$variables, response: RelayReaderRequiredFieldsTest4Query$data, + variables: RelayReaderRequiredFieldsTest4Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest5Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest5Query.graphql.js index 2b8a75eb3a727..0048e8c5e887d 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest5Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest5Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<9971aad7192e8fc82a84098f7d3743bf>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type RelayReaderRequiredFieldsTest5Query$data = {| |}, |}; export type RelayReaderRequiredFieldsTest5Query = {| - variables: RelayReaderRequiredFieldsTest5Query$variables, response: RelayReaderRequiredFieldsTest5Query$data, + variables: RelayReaderRequiredFieldsTest5Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest6Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest6Query.graphql.js index 8520b767861d2..d49dd3ad52693 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest6Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest6Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type RelayReaderRequiredFieldsTest6Query$data = {| |}, |}; export type RelayReaderRequiredFieldsTest6Query = {| - variables: RelayReaderRequiredFieldsTest6Query$variables, response: RelayReaderRequiredFieldsTest6Query$data, + variables: RelayReaderRequiredFieldsTest6Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest7Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest7Query.graphql.js index a68b4c336a0ee..78c0185d9b4fb 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest7Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest7Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<69b0a683413a5d0bd0384901bc41ed2e>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -23,8 +23,8 @@ export type RelayReaderRequiredFieldsTest7Query$data = ?{| |}, |}; export type RelayReaderRequiredFieldsTest7Query = {| - variables: RelayReaderRequiredFieldsTest7Query$variables, response: RelayReaderRequiredFieldsTest7Query$data, + variables: RelayReaderRequiredFieldsTest7Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest8Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest8Query.graphql.js index 4e76a85e6d404..10a632072661b 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest8Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest8Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<3e95fc26ee0e70e10498acdc980cc353>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayReaderRequiredFieldsTest8Query$data = {| |}, |}; export type RelayReaderRequiredFieldsTest8Query = {| - variables: RelayReaderRequiredFieldsTest8Query$variables, response: RelayReaderRequiredFieldsTest8Query$data, + variables: RelayReaderRequiredFieldsTest8Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest9Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest9Query.graphql.js index 69efe275c2cf6..d97164133876a 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest9Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest9Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<98d27d496cd74ab654fbbdc479808ce9>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -23,8 +23,8 @@ export type RelayReaderRequiredFieldsTest9Query$data = {| |}, |}; export type RelayReaderRequiredFieldsTest9Query = {| - variables: RelayReaderRequiredFieldsTest9Query$variables, response: RelayReaderRequiredFieldsTest9Query$data, + variables: RelayReaderRequiredFieldsTest9Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestActorChangeQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestActorChangeQuery.graphql.js index c4b4801cd0780..f30f460c2e37c 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestActorChangeQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestActorChangeQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<1fe4bc2ebe84e7a78bc9c9763856196b>> + * @generated SignedSource<<5c5c2ac008a86ac7bad5e939cf6bcf5f>> * @flow * @lightSyntaxTransform * @nogrep @@ -28,8 +28,8 @@ export type RelayReaderTestActorChangeQuery$data = {| |}, |}; export type RelayReaderTestActorChangeQuery = {| - variables: RelayReaderTestActorChangeQuery$variables, response: RelayReaderTestActorChangeQuery$data, + variables: RelayReaderTestActorChangeQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestCreatesFragmentPointersWithFragmentOwnerWhenOwnerIsProvidedParentQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestCreatesFragmentPointersWithFragmentOwnerWhenOwnerIsProvidedParentQuery.graphql.js index fe421485e8d7c..ca578664aff60 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestCreatesFragmentPointersWithFragmentOwnerWhenOwnerIsProvidedParentQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestCreatesFragmentPointersWithFragmentOwnerWhenOwnerIsProvidedParentQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<0c42a3aeabb6d313e0c9c4908c1aced3>> + * @generated SignedSource<<533de51b9d2ef510888c9534d853fda6>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayReaderTestCreatesFragmentPointersWithFragmentOwnerWhenOwnerIsPr |}, |}; export type RelayReaderTestCreatesFragmentPointersWithFragmentOwnerWhenOwnerIsProvidedParentQuery = {| - variables: RelayReaderTestCreatesFragmentPointersWithFragmentOwnerWhenOwnerIsProvidedParentQuery$variables, response: RelayReaderTestCreatesFragmentPointersWithFragmentOwnerWhenOwnerIsProvidedParentQuery$data, + variables: RelayReaderTestCreatesFragmentPointersWithFragmentOwnerWhenOwnerIsProvidedParentQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestCreatesFragmentPointersWithLiteralArgumentsUserQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestCreatesFragmentPointersWithLiteralArgumentsUserQuery.graphql.js index ac4dd94deb546..1b7938b87cd1f 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestCreatesFragmentPointersWithLiteralArgumentsUserQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestCreatesFragmentPointersWithLiteralArgumentsUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<48c6bac151643422c0378fada7d7c302>> + * @generated SignedSource<<1e2153fc7b39923914f2ff9cef608e7f>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayReaderTestCreatesFragmentPointersWithLiteralArgumentsUserQuery$ |}, |}; export type RelayReaderTestCreatesFragmentPointersWithLiteralArgumentsUserQuery = {| - variables: RelayReaderTestCreatesFragmentPointersWithLiteralArgumentsUserQuery$variables, response: RelayReaderTestCreatesFragmentPointersWithLiteralArgumentsUserQuery$data, + variables: RelayReaderTestCreatesFragmentPointersWithLiteralArgumentsUserQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestCreatesFragmentPointersWithVariableArgumentsUserQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestCreatesFragmentPointersWithVariableArgumentsUserQuery.graphql.js index e8a56a3770d80..92fb027d7874c 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestCreatesFragmentPointersWithVariableArgumentsUserQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestCreatesFragmentPointersWithVariableArgumentsUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayReaderTestCreatesFragmentPointersWithVariableArgumentsUserQuery |}, |}; export type RelayReaderTestCreatesFragmentPointersWithVariableArgumentsUserQuery = {| - variables: RelayReaderTestCreatesFragmentPointersWithVariableArgumentsUserQuery$variables, response: RelayReaderTestCreatesFragmentPointersWithVariableArgumentsUserQuery$data, + variables: RelayReaderTestCreatesFragmentPointersWithVariableArgumentsUserQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestDoesNotRecordADependencyOnTypeRecordsForAbstractTypeDiscriminatorsQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestDoesNotRecordADependencyOnTypeRecordsForAbstractTypeDiscriminatorsQuery.graphql.js index dbbe79dde9176..a34cc855c76f6 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestDoesNotRecordADependencyOnTypeRecordsForAbstractTypeDiscriminatorsQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestDoesNotRecordADependencyOnTypeRecordsForAbstractTypeDiscriminatorsQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<2e8e183dcf649f302a0e196b7be72272>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayReaderTestDoesNotRecordADependencyOnTypeRecordsForAbstractTypeD |}, |}; export type RelayReaderTestDoesNotRecordADependencyOnTypeRecordsForAbstractTypeDiscriminatorsQuery = {| - variables: RelayReaderTestDoesNotRecordADependencyOnTypeRecordsForAbstractTypeDiscriminatorsQuery$variables, response: RelayReaderTestDoesNotRecordADependencyOnTypeRecordsForAbstractTypeDiscriminatorsQuery$data, + variables: RelayReaderTestDoesNotRecordADependencyOnTypeRecordsForAbstractTypeDiscriminatorsQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestFeatureEnableReactFlightComponentFieldFlightQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestFeatureEnableReactFlightComponentFieldFlightQuery.graphql.js index df19109c22647..8f00de87467cf 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestFeatureEnableReactFlightComponentFieldFlightQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestFeatureEnableReactFlightComponentFieldFlightQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<0b888ff6f3615cf2ae10264d9f6c6b2f>> + * @generated SignedSource<<035b406d219665764d03c3e513056178>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,8 +19,8 @@ /*:: import type { ConcreteRequest, Query } from 'relay-runtime'; export type RelayReaderTestFeatureEnableReactFlightComponentFieldFlightQuery$variables = {| - id: string, count: number, + id: string, |}; export type RelayReaderTestFeatureEnableReactFlightComponentFieldFlightQuery$data = {| +node: ?{| @@ -28,8 +28,8 @@ export type RelayReaderTestFeatureEnableReactFlightComponentFieldFlightQuery$dat |}, |}; export type RelayReaderTestFeatureEnableReactFlightComponentFieldFlightQuery = {| - variables: RelayReaderTestFeatureEnableReactFlightComponentFieldFlightQuery$variables, response: RelayReaderTestFeatureEnableReactFlightComponentFieldFlightQuery$data, + variables: RelayReaderTestFeatureEnableReactFlightComponentFieldFlightQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestReadScalarUserQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestReadScalarUserQuery.graphql.js index d7bf974daad9d..4d7ec80d999da 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestReadScalarUserQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestReadScalarUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<00813356593c6ba85afd3ad5ca58df06>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayReaderTestReadScalarUserQuery$data = {| |}, |}; export type RelayReaderTestReadScalarUserQuery = {| - variables: RelayReaderTestReadScalarUserQuery$variables, response: RelayReaderTestReadScalarUserQuery$data, + variables: RelayReaderTestReadScalarUserQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestReadsBasicFragmentUserQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestReadsBasicFragmentUserQuery.graphql.js index 3d0d667335b83..201cadb107ddd 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestReadsBasicFragmentUserQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestReadsBasicFragmentUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<466d637062eccf03778ed189f2a18a4a>> + * @generated SignedSource<<75b88faadfc40bbf9b0bd8e16c2106d5>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayReaderTestReadsBasicFragmentUserQuery$data = {| |}, |}; export type RelayReaderTestReadsBasicFragmentUserQuery = {| - variables: RelayReaderTestReadsBasicFragmentUserQuery$variables, response: RelayReaderTestReadsBasicFragmentUserQuery$data, + variables: RelayReaderTestReadsBasicFragmentUserQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestReadsFragmentData.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestReadsFragmentData.graphql.js index 6033d893d1c92..b3536ca562810 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestReadsFragmentData.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestReadsFragmentData.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<6b274ee2aff5414a1fe97e7075827fbf>> + * @generated SignedSource<<239f8bf2c8492e68b0012ce717df01db>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,17 +19,17 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayReaderTestReadsFragmentData$fragmentType: FragmentType; export type RelayReaderTestReadsFragmentData$data = {| - +id: string, +firstName: ?string, +friends: ?{| +edges: ?$ReadOnlyArray, |}, + +id: string, +profilePicture: ?{| +uri: ?string, |}, diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestReadsFragmentDataUserQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestReadsFragmentDataUserQuery.graphql.js index 80252c4a2cae0..06807dbd79257 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestReadsFragmentDataUserQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestReadsFragmentDataUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<603b5db3ade12336a1b9f0479f4cf434>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayReaderTestReadsFragmentDataUserQuery$data = {| |}, |}; export type RelayReaderTestReadsFragmentDataUserQuery = {| - variables: RelayReaderTestReadsFragmentDataUserQuery$variables, response: RelayReaderTestReadsFragmentDataUserQuery$data, + variables: RelayReaderTestReadsFragmentDataUserQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestReadsHandleFieldsForQueryRootFragmentsUserFriendsQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestReadsHandleFieldsForQueryRootFragmentsUserFriendsQuery.graphql.js index 3a5f9785a04d8..0364e739c6ac2 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestReadsHandleFieldsForQueryRootFragmentsUserFriendsQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestReadsHandleFieldsForQueryRootFragmentsUserFriendsQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<39d75786626164ab2e31c525f479d085>> + * @generated SignedSource<<42f970a83867aca3aef59aa8413d86b9>> * @flow * @lightSyntaxTransform * @nogrep @@ -33,8 +33,8 @@ export type RelayReaderTestReadsHandleFieldsForQueryRootFragmentsUserFriendsQuer |}, |}; export type RelayReaderTestReadsHandleFieldsForQueryRootFragmentsUserFriendsQuery = {| - variables: RelayReaderTestReadsHandleFieldsForQueryRootFragmentsUserFriendsQuery$variables, response: RelayReaderTestReadsHandleFieldsForQueryRootFragmentsUserFriendsQuery$data, + variables: RelayReaderTestReadsHandleFieldsForQueryRootFragmentsUserFriendsQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestReadsQueryDataFooQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestReadsQueryDataFooQuery.graphql.js index f27cd9b9fbc0e..c7c1c6919648a 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestReadsQueryDataFooQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestReadsQueryDataFooQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<6a7f1ea2970b1ab75bf18b7893e399d4>> + * @generated SignedSource<<68b92a2f4b3c360f44942b1c9f534ce9>> * @flow * @lightSyntaxTransform * @nogrep @@ -22,7 +22,6 @@ export type RelayReaderTestReadsQueryDataFooQuery$variables = {| |}; export type RelayReaderTestReadsQueryDataFooQuery$data = {| +node: ?{| - +id: string, +__typename: string, +actors?: ?$ReadOnlyArray, |}, + +id: string, +profilePicture?: ?{| +uri: ?string, |}, |}, |}; export type RelayReaderTestReadsQueryDataFooQuery = {| - variables: RelayReaderTestReadsQueryDataFooQuery$variables, response: RelayReaderTestReadsQueryDataFooQuery$data, + variables: RelayReaderTestReadsQueryDataFooQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldConsiderDataMissingIfTheFragmentIsConcreteButOnTheRootQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldConsiderDataMissingIfTheFragmentIsConcreteButOnTheRootQuery.graphql.js index 3d09f03b774ce..545894217e059 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldConsiderDataMissingIfTheFragmentIsConcreteButOnTheRootQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldConsiderDataMissingIfTheFragmentIsConcreteButOnTheRootQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<06dad75136d88bb523996fa267c098d0>> + * @generated SignedSource<<1f892e2929cc48253abcaf1c0f9ce123>> * @flow * @lightSyntaxTransform * @nogrep @@ -22,8 +22,8 @@ export type RelayReaderTestShouldConsiderDataMissingIfTheFragmentIsConcreteButOn +$fragmentSpreads: RelayReaderTestShouldConsiderDataMissingIfTheFragmentIsConcreteButOnTheRootRootFragment$fragmentType, |}; export type RelayReaderTestShouldConsiderDataMissingIfTheFragmentIsConcreteButOnTheRootQuery = {| - variables: RelayReaderTestShouldConsiderDataMissingIfTheFragmentIsConcreteButOnTheRootQuery$variables, response: RelayReaderTestShouldConsiderDataMissingIfTheFragmentIsConcreteButOnTheRootQuery$data, + variables: RelayReaderTestShouldConsiderDataMissingIfTheFragmentIsConcreteButOnTheRootQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldConsiderDataMissingIfTheFragmentTypeIsAbstractActorQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldConsiderDataMissingIfTheFragmentTypeIsAbstractActorQuery.graphql.js index 3e4cd851974e8..af74dd2d424c1 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldConsiderDataMissingIfTheFragmentTypeIsAbstractActorQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldConsiderDataMissingIfTheFragmentTypeIsAbstractActorQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<326c8e876a0a08bcf6c112ac6f2c1a1d>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayReaderTestShouldConsiderDataMissingIfTheFragmentTypeIsAbstractA |}, |}; export type RelayReaderTestShouldConsiderDataMissingIfTheFragmentTypeIsAbstractActorQuery = {| - variables: RelayReaderTestShouldConsiderDataMissingIfTheFragmentTypeIsAbstractActorQuery$variables, response: RelayReaderTestShouldConsiderDataMissingIfTheFragmentTypeIsAbstractActorQuery$data, + variables: RelayReaderTestShouldConsiderDataMissingIfTheFragmentTypeIsAbstractActorQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldHaveIsmissingdataFalseIfDataIsAvailableUserFriends.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldHaveIsmissingdataFalseIfDataIsAvailableUserFriends.graphql.js index 108c6baa7870c..c5b34c9d29e8c 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldHaveIsmissingdataFalseIfDataIsAvailableUserFriends.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldHaveIsmissingdataFalseIfDataIsAvailableUserFriends.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<6674509f8afd2723feb63a4cd476137c>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,7 +19,6 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayReaderTestShouldHaveIsmissingdataFalseIfDataIsAvailableUserFriends$fragmentType: FragmentType; export type RelayReaderTestShouldHaveIsmissingdataFalseIfDataIsAvailableUserFriends$data = {| - +id: string, +friends: ?{| +edges: ?$ReadOnlyArray, |}, + +id: string, +$fragmentType: RelayReaderTestShouldHaveIsmissingdataFalseIfDataIsAvailableUserFriends$fragmentType, |}; export type RelayReaderTestShouldHaveIsmissingdataFalseIfDataIsAvailableUserFriends$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldHaveIsmissingdataFalseIfDataIsAvailableUserQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldHaveIsmissingdataFalseIfDataIsAvailableUserQuery.graphql.js index 179efe277944e..cbcac4efdc822 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldHaveIsmissingdataFalseIfDataIsAvailableUserQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldHaveIsmissingdataFalseIfDataIsAvailableUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<12b46153c7df4e9dfb49468936b57e2b>> + * @generated SignedSource<<9cf195ef03618a5367a14ad054b00f4b>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayReaderTestShouldHaveIsmissingdataFalseIfDataIsAvailableUserQuer |}, |}; export type RelayReaderTestShouldHaveIsmissingdataFalseIfDataIsAvailableUserQuery = {| - variables: RelayReaderTestShouldHaveIsmissingdataFalseIfDataIsAvailableUserQuery$variables, response: RelayReaderTestShouldHaveIsmissingdataFalseIfDataIsAvailableUserQuery$data, + variables: RelayReaderTestShouldHaveIsmissingdataFalseIfDataIsAvailableUserQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingAddress.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingAddress.graphql.js index 5c52dd8a61bf6..6919a36dfa8dd 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingAddress.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingAddress.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<2cb7a68dbd4c6ad3b4449cae917a5c01>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingAddress$fragmentType: FragmentType; export type RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingAddress$data = {| - +id: string, +address: ?{| +city: ?string, |}, + +id: string, +$fragmentType: RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingAddress$fragmentType, |}; export type RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingAddress$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingForConnectionUserFriends.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingForConnectionUserFriends.graphql.js index 01269ec8d203f..0be4eae403581 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingForConnectionUserFriends.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingForConnectionUserFriends.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<1ba314a594bed435be2bb38425ea3783>> + * @generated SignedSource<<2442256c2ce594c9a39e1428a9ff9a42>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,7 +19,6 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingForConnectionUserFriends$fragmentType: FragmentType; export type RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingForConnectionUserFriends$data = {| - +id: string, +friends: ?{| +edges: ?$ReadOnlyArray, |}, + +id: string, +$fragmentType: RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingForConnectionUserFriends$fragmentType, |}; export type RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingForConnectionUserFriends$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingForEdgeInTheConnectionUserFriends.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingForEdgeInTheConnectionUserFriends.graphql.js index 2ee2899618be9..efa7898849042 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingForEdgeInTheConnectionUserFriends.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingForEdgeInTheConnectionUserFriends.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<3c69f7bd2178abf1ea894ae82a6b2d04>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,7 +19,6 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingForEdgeInTheConnectionUserFriends$fragmentType: FragmentType; export type RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingForEdgeInTheConnectionUserFriends$data = {| - +id: string, +friends: ?{| +edges: ?$ReadOnlyArray, |}, + +id: string, +$fragmentType: RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingForEdgeInTheConnectionUserFriends$fragmentType, |}; export type RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingForEdgeInTheConnectionUserFriends$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingForEdgeInTheConnectionUserQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingForEdgeInTheConnectionUserQuery.graphql.js index 529ff76a86902..304435ad1d35a 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingForEdgeInTheConnectionUserQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingForEdgeInTheConnectionUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<8d550310e0af069db7fc9d6b9e60fc3c>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingForEdgeInTh |}, |}; export type RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingForEdgeInTheConnectionUserQuery = {| - variables: RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingForEdgeInTheConnectionUserQuery$variables, response: RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingForEdgeInTheConnectionUserQuery$data, + variables: RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingForEdgeInTheConnectionUserQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingInTheNodeUserFriends.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingInTheNodeUserFriends.graphql.js index eba30057764e5..da9f279ac8c12 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingInTheNodeUserFriends.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingInTheNodeUserFriends.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<17c4a933f8469ab962b04062e4919341>> + * @generated SignedSource<<322fe3c366356efa3e91b20d3a52b01c>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,7 +19,6 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingInTheNodeUserFriends$fragmentType: FragmentType; export type RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingInTheNodeUserFriends$data = {| - +id: string, +friends: ?{| +edges: ?$ReadOnlyArray, |}, + +id: string, +$fragmentType: RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingInTheNodeUserFriends$fragmentType, |}; export type RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingInTheNodeUserFriends$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingUserQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingUserQuery.graphql.js index e566173aa7989..90761d083d966 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingUserQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingUserQuery$d |}, |}; export type RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingUserQuery = {| - variables: RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingUserQuery$variables, response: RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingUserQuery$data, + variables: RelayReaderTestShouldHaveIsmissingdataTrueIfDataIsMissingUserQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldNotConsiderDataMissingIfTheFragmentTypeDoesNotMatchTheDataActorQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldNotConsiderDataMissingIfTheFragmentTypeDoesNotMatchTheDataActorQuery.graphql.js index 795eb632b76db..a1bb9d6a27f53 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldNotConsiderDataMissingIfTheFragmentTypeDoesNotMatchTheDataActorQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldNotConsiderDataMissingIfTheFragmentTypeDoesNotMatchTheDataActorQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<6b5800edb20b57ef96f4071d53c1c28f>> + * @generated SignedSource<<79c76332dd2a6097cf65d7837ede8629>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayReaderTestShouldNotConsiderDataMissingIfTheFragmentTypeDoesNotM |}, |}; export type RelayReaderTestShouldNotConsiderDataMissingIfTheFragmentTypeDoesNotMatchTheDataActorQuery = {| - variables: RelayReaderTestShouldNotConsiderDataMissingIfTheFragmentTypeDoesNotMatchTheDataActorQuery$variables, response: RelayReaderTestShouldNotConsiderDataMissingIfTheFragmentTypeDoesNotMatchTheDataActorQuery$data, + variables: RelayReaderTestShouldNotConsiderDataMissingIfTheFragmentTypeDoesNotMatchTheDataActorQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldNotHaveMissingDataIfMissingFieldsAreClientFieldsUserProfile.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldNotHaveMissingDataIfMissingFieldsAreClientFieldsUserProfile.graphql.js index a48f65b69ceae..952490541eb95 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldNotHaveMissingDataIfMissingFieldsAreClientFieldsUserProfile.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldNotHaveMissingDataIfMissingFieldsAreClientFieldsUserProfile.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<819b6dd001cac20835a7c75f8f253a05>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,21 +19,21 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayReaderTestShouldNotHaveMissingDataIfMissingFieldsAreClientFieldsUserProfile$fragmentType: FragmentType; export type RelayReaderTestShouldNotHaveMissingDataIfMissingFieldsAreClientFieldsUserProfile$data = {| - +id: string, - +friends: ?{| - +client_friends_connection_field: ?string, + +best_friends: ?{| +edges: ?$ReadOnlyArray, |}, - +nickname: ?string, +client_actor_field: ?string, +client_foo: ?{| +client_name: ?string, @@ -41,21 +41,21 @@ export type RelayReaderTestShouldNotHaveMissingDataIfMissingFieldsAreClientField +uri: ?string, |}, |}, - +best_friends: ?{| + +friends: ?{| + +client_friends_connection_field: ?string, +edges: ?$ReadOnlyArray, |}, + +id: string, + +nickname: ?string, +$fragmentType: RelayReaderTestShouldNotHaveMissingDataIfMissingFieldsAreClientFieldsUserProfile$fragmentType, |}; export type RelayReaderTestShouldNotHaveMissingDataIfMissingFieldsAreClientFieldsUserProfile$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldNotHaveMissingDataIfMissingFieldsAreClientFieldsUserQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldNotHaveMissingDataIfMissingFieldsAreClientFieldsUserQuery.graphql.js index 8c33ad55a3a32..e56e3e25c2235 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldNotHaveMissingDataIfMissingFieldsAreClientFieldsUserQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestShouldNotHaveMissingDataIfMissingFieldsAreClientFieldsUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<4ead5b75d99a5d4ffd6a1c74adfebfe2>> + * @generated SignedSource<<574658fb9ee6bd271c06abc8a69887ef>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayReaderTestShouldNotHaveMissingDataIfMissingFieldsAreClientField |}, |}; export type RelayReaderTestShouldNotHaveMissingDataIfMissingFieldsAreClientFieldsUserQuery = {| - variables: RelayReaderTestShouldNotHaveMissingDataIfMissingFieldsAreClientFieldsUserQuery$variables, response: RelayReaderTestShouldNotHaveMissingDataIfMissingFieldsAreClientFieldsUserQuery$data, + variables: RelayReaderTestShouldNotHaveMissingDataIfMissingFieldsAreClientFieldsUserQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestStreamConnectionUserQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestStreamConnectionUserQuery.graphql.js index 9d5707e698228..057fbe2d25ff2 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestStreamConnectionUserQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestStreamConnectionUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<3671dadd971c9e02668e1b2d7cb6db5f>> + * @generated SignedSource<<5f193875c11e59c253f333613cc02505>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayReaderTestStreamConnectionUserQuery$data = {| |}, |}; export type RelayReaderTestStreamConnectionUserQuery = {| - variables: RelayReaderTestStreamConnectionUserQuery$variables, response: RelayReaderTestStreamConnectionUserQuery$data, + variables: RelayReaderTestStreamConnectionUserQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestWhenMatchDirectiveIsPresentBarQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestWhenMatchDirectiveIsPresentBarQuery.graphql.js index 993cfb174761f..c116db69e5d09 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestWhenMatchDirectiveIsPresentBarQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestWhenMatchDirectiveIsPresentBarQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<6f4214177ad4769b808caf01fa93d7dc>> + * @generated SignedSource<<2032680b759ff8dd52ecff5ce4aafdd0>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayReaderTestWhenMatchDirectiveIsPresentBarQuery$data = {| |}, |}; export type RelayReaderTestWhenMatchDirectiveIsPresentBarQuery = {| - variables: RelayReaderTestWhenMatchDirectiveIsPresentBarQuery$variables, response: RelayReaderTestWhenMatchDirectiveIsPresentBarQuery$data, + variables: RelayReaderTestWhenMatchDirectiveIsPresentBarQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestWhenMatchDirectiveIsPresentNoModuleBarQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestWhenMatchDirectiveIsPresentNoModuleBarQuery.graphql.js index 21da12ee1ea55..3aca8eb667649 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestWhenMatchDirectiveIsPresentNoModuleBarQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReaderTestWhenMatchDirectiveIsPresentNoModuleBarQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<5e09d00beed25231ed111cf446646e23>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayReaderTestWhenMatchDirectiveIsPresentNoModuleBarQuery$data = {| |}, |}; export type RelayReaderTestWhenMatchDirectiveIsPresentNoModuleBarQuery = {| - variables: RelayReaderTestWhenMatchDirectiveIsPresentNoModuleBarQuery$variables, response: RelayReaderTestWhenMatchDirectiveIsPresentNoModuleBarQuery$data, + variables: RelayReaderTestWhenMatchDirectiveIsPresentNoModuleBarQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest1Fragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest1Fragment.graphql.js index 66b1a5cfa155d..99294e65c11f1 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest1Fragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest1Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<1c69adc5ace70fe8743c3be010cbee48>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayReferenceMarkerTest1Fragment$data = {| +edges: ?$ReadOnlyArray, |}, diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest1Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest1Query.graphql.js index f296b33c02ace..8e19da646fcd1 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest1Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest1Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<26e7c379ee64184da7643a9c9284b09b>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -23,17 +23,17 @@ export type RelayReferenceMarkerTest1Query$variables = {| |}; export type RelayReferenceMarkerTest1Query$data = {| +node: ?{| - +id: string, +__typename: string, +actors?: ?$ReadOnlyArray, + +id: string, +$fragmentSpreads: RelayReferenceMarkerTest1Fragment$fragmentType, |}, |}; export type RelayReferenceMarkerTest1Query = {| - variables: RelayReferenceMarkerTest1Query$variables, response: RelayReferenceMarkerTest1Query$data, + variables: RelayReferenceMarkerTest1Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest2Fragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest2Fragment.graphql.js index 39c8956c6bb6e..7fa6cc2346c50 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest2Fragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest2Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<7f01e36c823886daad8957c7bce96487>> + * @generated SignedSource<<11d4a4a4c75dd7510a02e8ca63814ebe>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,25 +19,25 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayReferenceMarkerTest2Fragment$fragmentType: FragmentType; export type RelayReferenceMarkerTest2Fragment$data = {| - +client_foo: ?{| - +client_name: ?string, - +profile_picture: ?{| - +uri: ?string, - |}, - |}, - +nickname: ?string, +best_friends: ?{| +client_friends_connection_field: ?string, +edges: ?$ReadOnlyArray, |}, + +client_foo: ?{| + +client_name: ?string, + +profile_picture: ?{| + +uri: ?string, + |}, + |}, +firstName: ?string, + +nickname: ?string, +$fragmentType: RelayReferenceMarkerTest2Fragment$fragmentType, |}; export type RelayReferenceMarkerTest2Fragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest2MarkdownUserNameRenderer_name.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest2MarkdownUserNameRenderer_name.graphql.js index 5f7dd7d6c4b19..63e4db782cb89 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest2MarkdownUserNameRenderer_name.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest2MarkdownUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<3aad2c41a189bd358172c423711ef70a>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayReferenceMarkerTest2MarkdownUserNameRenderer_name$fragmentType: FragmentType; export type RelayReferenceMarkerTest2MarkdownUserNameRenderer_name$data = {| - +markdown: ?string, +data: ?{| +markup: ?string, |}, + +markdown: ?string, +$fragmentType: RelayReferenceMarkerTest2MarkdownUserNameRenderer_name$fragmentType, |}; export type RelayReferenceMarkerTest2MarkdownUserNameRenderer_name$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest2PlainUserNameRenderer_name.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest2PlainUserNameRenderer_name.graphql.js index e2e05e15035f3..67e10862de735 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest2PlainUserNameRenderer_name.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest2PlainUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayReferenceMarkerTest2PlainUserNameRenderer_name$fragmentType: FragmentType; export type RelayReferenceMarkerTest2PlainUserNameRenderer_name$data = {| - +plaintext: ?string, +data: ?{| +text: ?string, |}, + +plaintext: ?string, +$fragmentType: RelayReferenceMarkerTest2PlainUserNameRenderer_name$fragmentType, |}; export type RelayReferenceMarkerTest2PlainUserNameRenderer_name$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest2Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest2Query.graphql.js index 50ea50cf1dedc..83c358935016e 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest2Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest2Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<41d0bfabad08cc93d8102a0efa1371d1>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -33,8 +33,8 @@ export type RelayReferenceMarkerTest2Query$data = {| |}, |}; export type RelayReferenceMarkerTest2Query = {| - variables: RelayReferenceMarkerTest2Query$variables, response: RelayReferenceMarkerTest2Query$data, + variables: RelayReferenceMarkerTest2Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest3Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest3Query.graphql.js index 9932c740c9962..870bffd5cc138 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest3Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest3Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<2f066c3f48c1436147244fabdf0777eb>> * @flow * @lightSyntaxTransform * @nogrep @@ -34,8 +34,8 @@ export type RelayReferenceMarkerTest3Query$data = {| |}, |}; export type RelayReferenceMarkerTest3Query = {| - variables: RelayReferenceMarkerTest3Query$variables, response: RelayReferenceMarkerTest3Query$data, + variables: RelayReferenceMarkerTest3Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest4Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest4Query.graphql.js index 2595b3f0d8e6a..2345c326657a7 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest4Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest4Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<1a75ad942e8caa7364afde7b7f03fd73>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -22,14 +22,14 @@ export type RelayReferenceMarkerTest4Query$variables = {| |}; export type RelayReferenceMarkerTest4Query$data = {| +node: ?{| - +id: string, +__typename: string, + +id: string, +$fragmentSpreads: RelayReferenceMarkerTest2Fragment$fragmentType, |}, |}; export type RelayReferenceMarkerTest4Query = {| - variables: RelayReferenceMarkerTest4Query$variables, response: RelayReferenceMarkerTest4Query$data, + variables: RelayReferenceMarkerTest4Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest5Fragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest5Fragment.graphql.js index 70849a15ef2cf..00d6267c612f3 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest5Fragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest5Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<029f43a1455e4ba1d259ce73c507d57d>> + * @generated SignedSource<<870f46ac0ee3433b8ef66880972a3ebe>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayReferenceMarkerTest5Fragment$fragmentType: FragmentType; export type RelayReferenceMarkerTest5Fragment$data = {| - +id: string, +actors: ?$ReadOnlyArray, + +id: string, +$fragmentType: RelayReferenceMarkerTest5Fragment$fragmentType, |}; export type RelayReferenceMarkerTest5Fragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest5Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest5Query.graphql.js index df2a9dd60057b..47586f59df1d2 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest5Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest5Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayReferenceMarkerTest5Query$data = {| |}, |}; export type RelayReferenceMarkerTest5Query = {| - variables: RelayReferenceMarkerTest5Query$variables, response: RelayReferenceMarkerTest5Query$data, + variables: RelayReferenceMarkerTest5Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest6Fragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest6Fragment.graphql.js index 99aadacb3ec74..0417e6c3f0077 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest6Fragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest6Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayReferenceMarkerTest6Fragment$fragmentType: FragmentType; export type RelayReferenceMarkerTest6Fragment$data = {| - +id: string, +actors: ?$ReadOnlyArray, + +id: string, +$fragmentType: RelayReferenceMarkerTest6Fragment$fragmentType, |}; export type RelayReferenceMarkerTest6Fragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest6Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest6Query.graphql.js index 13a43353896a5..9ed9802d5d49d 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest6Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest6Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<85d9e91dd38cfc7645730d41993d0180>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayReferenceMarkerTest6Query$data = {| |}, |}; export type RelayReferenceMarkerTest6Query = {| - variables: RelayReferenceMarkerTest6Query$variables, response: RelayReferenceMarkerTest6Query$data, + variables: RelayReferenceMarkerTest6Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest7Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest7Query.graphql.js index 1eeb365e7d4f4..463a662e68e7a 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest7Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest7Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayReferenceMarkerTest7Query$data = {| |}, |}; export type RelayReferenceMarkerTest7Query = {| - variables: RelayReferenceMarkerTest7Query$variables, response: RelayReferenceMarkerTest7Query$data, + variables: RelayReferenceMarkerTest7Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest8Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest8Query.graphql.js index 179672b6841d6..ecbea17706422 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest8Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTest8Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<6ec09742349ac3c10dd1f7ac2fafb591>> + * @generated SignedSource<<97ef27529d392cf6831db0e12954cbad>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayReferenceMarkerTest8Query$data = {| |}, |}; export type RelayReferenceMarkerTest8Query = {| - variables: RelayReferenceMarkerTest8Query$variables, response: RelayReferenceMarkerTest8Query$data, + variables: RelayReferenceMarkerTest8Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTestFlightQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTestFlightQuery.graphql.js index 3ccc1af48b3df..7fe630fec1420 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTestFlightQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTestFlightQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<3d6476d850069f5b3e746e274bcf8f89>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,8 +19,8 @@ /*:: import type { ConcreteRequest, Query } from 'relay-runtime'; export type RelayReferenceMarkerTestFlightQuery$variables = {| - id: string, count: number, + id: string, |}; export type RelayReferenceMarkerTestFlightQuery$data = {| +node: ?{| @@ -28,8 +28,8 @@ export type RelayReferenceMarkerTestFlightQuery$data = {| |}, |}; export type RelayReferenceMarkerTestFlightQuery = {| - variables: RelayReferenceMarkerTestFlightQuery$variables, response: RelayReferenceMarkerTestFlightQuery$data, + variables: RelayReferenceMarkerTestFlightQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTestInnerQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTestInnerQuery.graphql.js index 01262d51dd464..89c2a196f44da 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTestInnerQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTestInnerQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<9b9564ecbcaa19af21878d5229107d97>> + * @generated SignedSource<<7d300ffc9b18573a173a8462ebf5990c>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type RelayReferenceMarkerTestInnerQuery$data = {| |}, |}; export type RelayReferenceMarkerTestInnerQuery = {| - variables: RelayReferenceMarkerTestInnerQuery$variables, response: RelayReferenceMarkerTestInnerQuery$data, + variables: RelayReferenceMarkerTestInnerQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTestMarkdownUserNameRenderer_name.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTestMarkdownUserNameRenderer_name.graphql.js index e5074738f79a1..00729b30c2252 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTestMarkdownUserNameRenderer_name.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTestMarkdownUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<9f0db7f270409a436c139204494c737f>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayReferenceMarkerTestMarkdownUserNameRenderer_name$fragmentType: FragmentType; export type RelayReferenceMarkerTestMarkdownUserNameRenderer_name$data = {| - +markdown: ?string, +data: ?{| +markup: ?string, |}, + +markdown: ?string, +$fragmentType: RelayReferenceMarkerTestMarkdownUserNameRenderer_name$fragmentType, |}; export type RelayReferenceMarkerTestMarkdownUserNameRenderer_name$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTestPlainUserNameRenderer_name.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTestPlainUserNameRenderer_name.graphql.js index f584f957e5465..dfde21149b12a 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTestPlainUserNameRenderer_name.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayReferenceMarkerTestPlainUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<0686576335dee7fc05719f6b58622a12>> + * @generated SignedSource<<409089cd453d59df4713d0cf022fe015>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayReferenceMarkerTestPlainUserNameRenderer_name$fragmentType: FragmentType; export type RelayReferenceMarkerTestPlainUserNameRenderer_name$data = {| - +plaintext: ?string, +data: ?{| +text: ?string, |}, + +plaintext: ?string, +$fragmentType: RelayReferenceMarkerTestPlainUserNameRenderer_name$fragmentType, |}; export type RelayReferenceMarkerTestPlainUserNameRenderer_name$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest10Fragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest10Fragment.graphql.js index 238f6b85aaa28..07f472a5688b5 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest10Fragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest10Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<915ad5a6cdbf125cfd03015bcba24bf9>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,13 +19,13 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayResponseNormalizerTest10Fragment$fragmentType: FragmentType; export type RelayResponseNormalizerTest10Fragment$data = {| - +id: string, +actors: ?$ReadOnlyArray, + +name?: ?string, |}>, + +id: string, +$fragmentType: RelayResponseNormalizerTest10Fragment$fragmentType, |}; export type RelayResponseNormalizerTest10Fragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest10Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest10Query.graphql.js index 31ceebb89bc7a..e9e35c2ff4bba 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest10Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest10Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<943902df135f8ec86e16c4e9068cef6b>> + * @generated SignedSource<<8f678f54f824b178aaa257b0f5e1d3d0>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayResponseNormalizerTest10Query$data = {| |}, |}; export type RelayResponseNormalizerTest10Query = {| - variables: RelayResponseNormalizerTest10Query$variables, response: RelayResponseNormalizerTest10Query$data, + variables: RelayResponseNormalizerTest10Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest11Fragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest11Fragment.graphql.js index e0898b6e084d1..5c7e4b4b48094 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest11Fragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest11Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<3847be35abf09a9788dc23e0db910eb9>> + * @generated SignedSource<<6c637c8274e207ec369d48e0ad27b87e>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayResponseNormalizerTest11Fragment$fragmentType: FragmentType; export type RelayResponseNormalizerTest11Fragment$data = {| - +id: string, +actors: ?$ReadOnlyArray, + +id: string, +$fragmentType: RelayResponseNormalizerTest11Fragment$fragmentType, |}; export type RelayResponseNormalizerTest11Fragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest11Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest11Query.graphql.js index 777d3c42009b0..cea8590b5364f 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest11Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest11Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<24a035c4acbf56f968cc0e356ddacb73>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type RelayResponseNormalizerTest7Fragment$fragmentType = any; export type RelayResponseNormalizerTest11Query$variables = {| - id: string, enableStream: boolean, + id: string, |}; export type RelayResponseNormalizerTest11Query$data = {| +node: ?{| @@ -27,8 +27,8 @@ export type RelayResponseNormalizerTest11Query$data = {| |}, |}; export type RelayResponseNormalizerTest11Query = {| - variables: RelayResponseNormalizerTest11Query$variables, response: RelayResponseNormalizerTest11Query$data, + variables: RelayResponseNormalizerTest11Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest12Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest12Query.graphql.js index d8b54ceeb4ed4..be16ad3fa61fd 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest12Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest12Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type RelayResponseNormalizerTest9Fragment$fragmentType = any; export type RelayResponseNormalizerTest12Query$variables = {| - id: string, enableStream: boolean, + id: string, |}; export type RelayResponseNormalizerTest12Query$data = {| +node: ?{| @@ -27,8 +27,8 @@ export type RelayResponseNormalizerTest12Query$data = {| |}, |}; export type RelayResponseNormalizerTest12Query = {| - variables: RelayResponseNormalizerTest12Query$variables, response: RelayResponseNormalizerTest12Query$data, + variables: RelayResponseNormalizerTest12Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest13Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest13Query.graphql.js index cf46a35556349..b9bb0ee3db681 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest13Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest13Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<695d77f412e12f65dad7c9f929864d60>> + * @generated SignedSource<<5c5b443852e5ce4c4bdd8d24d6295e86>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayResponseNormalizerTest13Query$data = {| |}, |}; export type RelayResponseNormalizerTest13Query = {| - variables: RelayResponseNormalizerTest13Query$variables, response: RelayResponseNormalizerTest13Query$data, + variables: RelayResponseNormalizerTest13Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest14Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest14Query.graphql.js index a312e317c6605..0516ca5e952ce 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest14Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest14Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<0eb506171883c5911943baafaa0fefa8>> + * @generated SignedSource<<5dede84152cab15329f566a861f87601>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayResponseNormalizerTest14Query$data = {| |}, |}; export type RelayResponseNormalizerTest14Query = {| - variables: RelayResponseNormalizerTest14Query$variables, response: RelayResponseNormalizerTest14Query$data, + variables: RelayResponseNormalizerTest14Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest15Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest15Query.graphql.js index d776d87ce2881..5078de6585125 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest15Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest15Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<2e128cda90b83d4fe1fd05d6d52a6b4a>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -21,21 +21,21 @@ export type RelayResponseNormalizerTest15Query$variables = {| |}; export type RelayResponseNormalizerTest15Query$data = {| +node: ?{| - +id: string, +__typename: string, +actor?: ?{| - +id: string, +__typename: string, + +id: string, |}, +author?: ?{| - +id: string, +__typename: string, + +id: string, |}, + +id: string, |}, |}; export type RelayResponseNormalizerTest15Query = {| - variables: RelayResponseNormalizerTest15Query$variables, response: RelayResponseNormalizerTest15Query$data, + variables: RelayResponseNormalizerTest15Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest16Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest16Query.graphql.js index b19a61488cc3c..562afddd17498 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest16Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest16Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<4bab4b2fb96919337d727d0bf012998d>> * @flow * @lightSyntaxTransform * @nogrep @@ -32,8 +32,8 @@ export type RelayResponseNormalizerTest16Query$data = {| |}, |}; export type RelayResponseNormalizerTest16Query = {| - variables: RelayResponseNormalizerTest16Query$variables, response: RelayResponseNormalizerTest16Query$data, + variables: RelayResponseNormalizerTest16Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest17Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest17Query.graphql.js index 64d139d3bdc79..74f6eaaaf0f0f 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest17Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest17Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<956f67cfd797177a06ea66288304688d>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayResponseNormalizerTest17Query$data = {| |}, |}; export type RelayResponseNormalizerTest17Query = {| - variables: RelayResponseNormalizerTest17Query$variables, response: RelayResponseNormalizerTest17Query$data, + variables: RelayResponseNormalizerTest17Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest18Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest18Query.graphql.js index faa7d84d6fde2..d97ec463c3b0a 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest18Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest18Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<4ac898da928321682e87aa7adad38f5a>> * @flow * @lightSyntaxTransform * @nogrep @@ -21,17 +21,17 @@ export type RelayResponseNormalizerTest18Query$variables = {| |}; export type RelayResponseNormalizerTest18Query$data = {| +node: ?{| - +id: string, +__typename: string, +actors?: ?$ReadOnlyArray, + +id: string, |}, |}; export type RelayResponseNormalizerTest18Query = {| - variables: RelayResponseNormalizerTest18Query$variables, response: RelayResponseNormalizerTest18Query$data, + variables: RelayResponseNormalizerTest18Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest19Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest19Query.graphql.js index c5601ae104277..b91de42fb7af1 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest19Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest19Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<852a9ef18e383d3e379ad866c33c8575>> * @flow * @lightSyntaxTransform * @nogrep @@ -21,18 +21,18 @@ export type RelayResponseNormalizerTest19Query$variables = {| |}; export type RelayResponseNormalizerTest19Query$data = {| +node: ?{| - +id: string, +__typename: string, +actors?: ?$ReadOnlyArray, + +id: string, |}, |}; export type RelayResponseNormalizerTest19Query = {| - variables: RelayResponseNormalizerTest19Query$variables, response: RelayResponseNormalizerTest19Query$data, + variables: RelayResponseNormalizerTest19Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest1MarkdownUserNameRenderer_name.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest1MarkdownUserNameRenderer_name.graphql.js index 3836fc4b49f18..58afb35df1266 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest1MarkdownUserNameRenderer_name.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest1MarkdownUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayResponseNormalizerTest1MarkdownUserNameRenderer_name$fragmentType: FragmentType; export type RelayResponseNormalizerTest1MarkdownUserNameRenderer_name$data = {| - +markdown: ?string, +data: ?{| +markup: ?string, |}, + +markdown: ?string, +$fragmentType: RelayResponseNormalizerTest1MarkdownUserNameRenderer_name$fragmentType, |}; export type RelayResponseNormalizerTest1MarkdownUserNameRenderer_name$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest1PlainUserNameRenderer_name.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest1PlainUserNameRenderer_name.graphql.js index caeb53d8476b1..9106620efc319 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest1PlainUserNameRenderer_name.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest1PlainUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<601c541e45917f0aa76b1e4350ea15d4>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayResponseNormalizerTest1PlainUserNameRenderer_name$fragmentType: FragmentType; export type RelayResponseNormalizerTest1PlainUserNameRenderer_name$data = {| - +plaintext: ?string, +data: ?{| +text: ?string, |}, + +plaintext: ?string, +$fragmentType: RelayResponseNormalizerTest1PlainUserNameRenderer_name$fragmentType, |}; export type RelayResponseNormalizerTest1PlainUserNameRenderer_name$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest1Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest1Query.graphql.js index 57c6d9627babf..ba449aa7fd8de 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest1Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest1Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<7762a1ffbe43e2275a587667b15c80a4>> * @flow * @lightSyntaxTransform * @nogrep @@ -22,26 +22,26 @@ export type RelayResponseNormalizerTest1Query$variables = {| |}; export type RelayResponseNormalizerTest1Query$data = {| +node: ?{| - +id: string, +__typename: string, +firstName?: ?string, +friends?: ?{| +edges: ?$ReadOnlyArray, |}, + +id: string, +profilePicture?: ?{| +uri: ?string, |}, |}, |}; export type RelayResponseNormalizerTest1Query = {| - variables: RelayResponseNormalizerTest1Query$variables, response: RelayResponseNormalizerTest1Query$data, + variables: RelayResponseNormalizerTest1Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest20Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest20Query.graphql.js index 8338e31c5ff56..a820672a90c43 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest20Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest20Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<2bc1f1435720ad1617c1e5bc56da1932>> * @flow * @lightSyntaxTransform * @nogrep @@ -21,17 +21,17 @@ export type RelayResponseNormalizerTest20Query$variables = {| |}; export type RelayResponseNormalizerTest20Query$data = {| +node: ?{| - +id: string, +__typename: string, +firstName?: ?string, + +id: string, +profilePicture?: ?{| +uri: ?string, |}, |}, |}; export type RelayResponseNormalizerTest20Query = {| - variables: RelayResponseNormalizerTest20Query$variables, response: RelayResponseNormalizerTest20Query$data, + variables: RelayResponseNormalizerTest20Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest21Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest21Query.graphql.js index a9143d9bfc1c4..cbdd5c6f2df39 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest21Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest21Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<413f850272c26c99b0dcb4f3c1c271e8>> + * @generated SignedSource<<7de12c2e51cf00c2be86666da81af8b0>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,13 +19,13 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; export type RelayResponseNormalizerTest21Query$variables = {||}; export type RelayResponseNormalizerTest21Query$data = {| +named: ?{| - +name: ?string, +id?: string, + +name: ?string, |}, |}; export type RelayResponseNormalizerTest21Query = {| - variables: RelayResponseNormalizerTest21Query$variables, response: RelayResponseNormalizerTest21Query$data, + variables: RelayResponseNormalizerTest21Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest22Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest22Query.graphql.js index 50dbc4a070368..6967335c45f42 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest22Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest22Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<3fcad475b77752c71b42aeb8bac85684>> + * @generated SignedSource<<4055600018a0c7292121a71c560847cd>> * @flow * @lightSyntaxTransform * @nogrep @@ -21,22 +21,22 @@ export type RelayResponseNormalizerTest22Query$variables = {| |}; export type RelayResponseNormalizerTest22Query$data = {| +node: ?{| - +id: string, +__typename: string, - +name?: ?string, +friends?: ?{| +edges: ?$ReadOnlyArray, |}, + +id: string, + +name?: ?string, |}, |}; export type RelayResponseNormalizerTest22Query = {| - variables: RelayResponseNormalizerTest22Query$variables, response: RelayResponseNormalizerTest22Query$data, + variables: RelayResponseNormalizerTest22Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest23Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest23Query.graphql.js index 11071691428ad..8b320a945e872 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest23Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest23Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -21,22 +21,22 @@ export type RelayResponseNormalizerTest23Query$variables = {| |}; export type RelayResponseNormalizerTest23Query$data = {| +node: ?{| - +id: string, +__typename: string, - +name?: ?string, +friends?: ?{| +edges: ?$ReadOnlyArray, + +id: string, |}, |}>, |}, + +id: string, + +name?: ?string, |}, |}; export type RelayResponseNormalizerTest23Query = {| - variables: RelayResponseNormalizerTest23Query$variables, response: RelayResponseNormalizerTest23Query$data, + variables: RelayResponseNormalizerTest23Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest24Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest24Query.graphql.js index 4381a752f8996..059284ad21769 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest24Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest24Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<3bccf0b1bc35acce0446a95e62bbeae5>> * @flow * @lightSyntaxTransform * @nogrep @@ -21,22 +21,22 @@ export type RelayResponseNormalizerTest24Query$variables = {| |}; export type RelayResponseNormalizerTest24Query$data = {| +node: ?{| - +id: string, +__typename: string, - +name?: ?string, +friends?: ?{| +edges: ?$ReadOnlyArray, |}, + +id: string, + +name?: ?string, |}, |}; export type RelayResponseNormalizerTest24Query = {| - variables: RelayResponseNormalizerTest24Query$variables, response: RelayResponseNormalizerTest24Query$data, + variables: RelayResponseNormalizerTest24Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest25Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest25Query.graphql.js index e096fb7bb701c..83d9b4e4107ee 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest25Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest25Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<69eec3a791f2765bddd5c6917b7cd0ba>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -21,32 +21,32 @@ export type RelayResponseNormalizerTest25Query$variables = {| |}; export type RelayResponseNormalizerTest25Query$data = {| +node: ?{| - +id: string, +__typename: string, - +name?: ?string, +friends?: ?{| +edges: ?$ReadOnlyArray, |}, + +firstName: ?string, + +id: string, |}, |}>, |}, + +id: string, + +name?: ?string, |}, |}; export type RelayResponseNormalizerTest25Query = {| - variables: RelayResponseNormalizerTest25Query$variables, response: RelayResponseNormalizerTest25Query$data, + variables: RelayResponseNormalizerTest25Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest26Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest26Query.graphql.js index a19d6703318cb..990f9d080fcaf 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest26Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest26Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<9aea8ad975f15dacfc784e6b0d832add>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -21,32 +21,32 @@ export type RelayResponseNormalizerTest26Query$variables = {| |}; export type RelayResponseNormalizerTest26Query$data = {| +node: ?{| - +id: string, +__typename: string, - +name?: ?string, +friends?: ?{| +edges: ?$ReadOnlyArray, |}, + +firstName: ?string, + +id: string, |}, |}>, |}, + +id: string, + +name?: ?string, |}, |}; export type RelayResponseNormalizerTest26Query = {| - variables: RelayResponseNormalizerTest26Query$variables, response: RelayResponseNormalizerTest26Query$data, + variables: RelayResponseNormalizerTest26Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest27Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest27Query.graphql.js index f83ffafbcdbf6..6ca649addeb35 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest27Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest27Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<66c97bd8f17e77cb76af7a9ebea7e0e0>> * @flow * @lightSyntaxTransform * @nogrep @@ -21,21 +21,21 @@ export type RelayResponseNormalizerTest27Query$variables = {| |}; export type RelayResponseNormalizerTest27Query$data = {| +node: ?{| - +id: string, +__typename: string, +actor?: ?{| - +id: string, +__typename: string, + +id: string, |}, +actors?: ?$ReadOnlyArray, + +id: string, |}, |}; export type RelayResponseNormalizerTest27Query = {| - variables: RelayResponseNormalizerTest27Query$variables, response: RelayResponseNormalizerTest27Query$data, + variables: RelayResponseNormalizerTest27Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest28Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest28Query.graphql.js index 525968dd78240..31735a3d6db92 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest28Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest28Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<5e329e664cf4e362d898e2917588f8aa>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -21,21 +21,21 @@ export type RelayResponseNormalizerTest28Query$variables = {| |}; export type RelayResponseNormalizerTest28Query$data = {| +node: ?{| - +id: string, +__typename: string, +actor?: ?{| - +id: string, +__typename: string, + +id: string, |}, +actors?: ?$ReadOnlyArray, + +id: string, |}, |}; export type RelayResponseNormalizerTest28Query = {| - variables: RelayResponseNormalizerTest28Query$variables, response: RelayResponseNormalizerTest28Query$data, + variables: RelayResponseNormalizerTest28Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest29Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest29Query.graphql.js index 2a22e0bfdf4bd..b1a5b3f493d5e 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest29Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest29Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<52183ad8c19bc9a66472061c91ee1dcf>> * @flow * @lightSyntaxTransform * @nogrep @@ -22,17 +22,17 @@ export type RelayResponseNormalizerTest29Query$variables = {| |}; export type RelayResponseNormalizerTest29Query$data = {| +node: ?{| - +id: string, +__typename: string, +firstName?: ?string, + +id: string, +profilePicture?: ?{| +uri: ?string, |}, |}, |}; export type RelayResponseNormalizerTest29Query = {| - variables: RelayResponseNormalizerTest29Query$variables, response: RelayResponseNormalizerTest29Query$data, + variables: RelayResponseNormalizerTest29Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest2Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest2Query.graphql.js index 85e29a5c2c2ab..7a67b46797803 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest2Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest2Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<215181fe80bc14b255b3520d8ee38d0a>> + * @generated SignedSource<<721fc90199c1a3de9f4b7b6f1be36a7f>> * @flow * @lightSyntaxTransform * @nogrep @@ -21,7 +21,6 @@ export type RelayResponseNormalizerTest2Query$variables = {| |}; export type RelayResponseNormalizerTest2Query$data = {| +node: ?{| - +id: string, +__typename: string, +friends?: ?{| +edges: ?$ReadOnlyArray, |}, + +id: string, |}, |}; export type RelayResponseNormalizerTest2Query = {| - variables: RelayResponseNormalizerTest2Query$variables, response: RelayResponseNormalizerTest2Query$data, + variables: RelayResponseNormalizerTest2Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest30Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest30Query.graphql.js index 5413bde420cdc..2eae661d46419 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest30Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest30Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<0fcdf50299604f59f1d0764e99df24e0>> + * @generated SignedSource<<18c713d665758ab65c310d0a5b277572>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type RelayResponseNormalizerTest30Query$data = {| |}, |}; export type RelayResponseNormalizerTest30Query = {| - variables: RelayResponseNormalizerTest30Query$variables, response: RelayResponseNormalizerTest30Query$data, + variables: RelayResponseNormalizerTest30Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest31Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest31Query.graphql.js index f6ed851ef1647..58470154aa1d7 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest31Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest31Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<7a00f1c54a66299c13b34d68c38f0366>> + * @generated SignedSource<<30fddc00ebc4dbf4d55151c5af5a584c>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type RelayResponseNormalizerTest31Query$data = {| |}, |}; export type RelayResponseNormalizerTest31Query = {| - variables: RelayResponseNormalizerTest31Query$variables, response: RelayResponseNormalizerTest31Query$data, + variables: RelayResponseNormalizerTest31Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest32Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest32Query.graphql.js index b08cdd36aba8c..958744ca37880 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest32Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest32Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<61bdc74555b5284cefe07cfb5944964d>> + * @generated SignedSource<<9db2d9b2acb5dc60f23e5ba2a746eff6>> * @flow * @lightSyntaxTransform * @nogrep @@ -21,22 +21,22 @@ export type RelayResponseNormalizerTest32Query$variables = {| |}; export type RelayResponseNormalizerTest32Query$data = {| +node: ?{| - +id: string, +__typename: string, - +name?: ?string, +friends?: ?{| +edges: ?$ReadOnlyArray, |}, + +id: string, + +name?: ?string, |}, |}; export type RelayResponseNormalizerTest32Query = {| - variables: RelayResponseNormalizerTest32Query$variables, response: RelayResponseNormalizerTest32Query$data, + variables: RelayResponseNormalizerTest32Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest33Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest33Query.graphql.js index 2c37d63baabea..2dbb69444b9c7 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest33Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest33Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -22,17 +22,17 @@ export type RelayResponseNormalizerTest33Query$variables = {| |}; export type RelayResponseNormalizerTest33Query$data = {| +node: ?{| - +id: string, +__typename: string, +firstName?: ?string, + +id: string, +profilePicture?: ?{| +uri: ?string, |}, |}, |}; export type RelayResponseNormalizerTest33Query = {| - variables: RelayResponseNormalizerTest33Query$variables, response: RelayResponseNormalizerTest33Query$data, + variables: RelayResponseNormalizerTest33Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest34Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest34Query.graphql.js index 53a00b26156db..bccf3cc667765 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest34Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest34Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<46e41376acfc6492f108839818389409>> + * @generated SignedSource<<575bbba2651e75bea6803a3313a7c0ba>> * @flow * @lightSyntaxTransform * @nogrep @@ -21,20 +21,20 @@ export type RelayResponseNormalizerTest34Query$variables = {| |}; export type RelayResponseNormalizerTest34Query$data = {| +node: ?{| - +id: string, +__typename: string, +firstName?: ?string, - +nickname?: ?string, +foo?: ?{| +bar: ?{| +content: ?string, |}, |}, + +id: string, + +nickname?: ?string, |}, |}; export type RelayResponseNormalizerTest34Query = {| - variables: RelayResponseNormalizerTest34Query$variables, response: RelayResponseNormalizerTest34Query$data, + variables: RelayResponseNormalizerTest34Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest35Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest35Query.graphql.js index fb38ee6b34079..cd267dc29d92e 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest35Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest35Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<53e73c6b687a80908fecea7374dc0ab0>> + * @generated SignedSource<<64877ca8ddfd800ed603bc1daf02ece8>> * @flow * @lightSyntaxTransform * @nogrep @@ -21,22 +21,22 @@ export type RelayResponseNormalizerTest35Query$variables = {| |}; export type RelayResponseNormalizerTest35Query$data = {| +node: ?{| - +id: string, +__typename: string, - +name?: ?string, +friends?: ?{| +edges: ?$ReadOnlyArray, |}, + +id: string, + +name?: ?string, |}, |}; export type RelayResponseNormalizerTest35Query = {| - variables: RelayResponseNormalizerTest35Query$variables, response: RelayResponseNormalizerTest35Query$data, + variables: RelayResponseNormalizerTest35Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest3Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest3Query.graphql.js index 7daac9f077966..bd136ef6c7746 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest3Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest3Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -18,12 +18,11 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; export type RelayResponseNormalizerTest3Query$variables = {| id: string, - orderBy?: ?$ReadOnlyArray, isViewerFriend?: ?boolean, + orderBy?: ?$ReadOnlyArray, |}; export type RelayResponseNormalizerTest3Query$data = {| +node: ?{| - +id: string, +__typename: string, +friends?: ?{| +edges: ?$ReadOnlyArray, +pageInfo: ?{| - +hasNextPage: ?boolean, +endCursor: ?string, + +hasNextPage: ?boolean, |}, |}, + +id: string, |}, |}; export type RelayResponseNormalizerTest3Query = {| - variables: RelayResponseNormalizerTest3Query$variables, response: RelayResponseNormalizerTest3Query$data, + variables: RelayResponseNormalizerTest3Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest4Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest4Query.graphql.js index 0fa3861be006f..f890eb827d0ae 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest4Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest4Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<652fe171665060938efd489481776a6f>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayResponseNormalizerTest4Query$data = {| |}, |}; export type RelayResponseNormalizerTest4Query = {| - variables: RelayResponseNormalizerTest4Query$variables, response: RelayResponseNormalizerTest4Query$data, + variables: RelayResponseNormalizerTest4Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest5Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest5Query.graphql.js index 94967d1e61ae4..3bac79a4a37d8 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest5Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest5Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayResponseNormalizerTest5Query$data = {| |}, |}; export type RelayResponseNormalizerTest5Query = {| - variables: RelayResponseNormalizerTest5Query$variables, response: RelayResponseNormalizerTest5Query$data, + variables: RelayResponseNormalizerTest5Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest6Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest6Query.graphql.js index 01e14711eb2b9..804dec979e6f6 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest6Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest6Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<24663843f1e844aa77f77d0967db0c0b>> + * @generated SignedSource<<3051ac0ff920d51a1894b71aa739c918>> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type RelayResponseNormalizerTest2Fragment$fragmentType = any; export type RelayResponseNormalizerTest6Query$variables = {| - id: string, enableDefer: boolean, + id: string, |}; export type RelayResponseNormalizerTest6Query$data = {| +node: ?{| @@ -27,8 +27,8 @@ export type RelayResponseNormalizerTest6Query$data = {| |}, |}; export type RelayResponseNormalizerTest6Query = {| - variables: RelayResponseNormalizerTest6Query$variables, response: RelayResponseNormalizerTest6Query$data, + variables: RelayResponseNormalizerTest6Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest7Fragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest7Fragment.graphql.js index 37af35fbe1eb8..1faf7ed9728a5 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest7Fragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest7Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<55aef71aa58714e9bd314cc3a1913f4e>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayResponseNormalizerTest7Fragment$fragmentType: FragmentType; export type RelayResponseNormalizerTest7Fragment$data = {| - +id: string, +actors: ?$ReadOnlyArray, + +id: string, +$fragmentType: RelayResponseNormalizerTest7Fragment$fragmentType, |}; export type RelayResponseNormalizerTest7Fragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest7Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest7Query.graphql.js index 8dd69d02f10b8..5de8f4ce840d8 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest7Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest7Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<6f90c76dc8a3bb84f47909d2e7c869b4>> + * @generated SignedSource<<1ce7964e271a2163b490d78337084d49>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayResponseNormalizerTest7Query$data = {| |}, |}; export type RelayResponseNormalizerTest7Query = {| - variables: RelayResponseNormalizerTest7Query$variables, response: RelayResponseNormalizerTest7Query$data, + variables: RelayResponseNormalizerTest7Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest8Fragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest8Fragment.graphql.js index 45122e57600f5..b889840b95afa 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest8Fragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest8Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<5d8f531548ceb848cc3cc6abe74cda9b>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayResponseNormalizerTest8Fragment$fragmentType: FragmentType; export type RelayResponseNormalizerTest8Fragment$data = {| - +id: string, +actors: ?$ReadOnlyArray, + +id: string, +$fragmentType: RelayResponseNormalizerTest8Fragment$fragmentType, |}; export type RelayResponseNormalizerTest8Fragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest8Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest8Query.graphql.js index 28fc47f8b9b81..384e412362015 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest8Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest8Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<30486516ee3f4243e9d020bb1d475098>> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type RelayResponseNormalizerTest4Fragment$fragmentType = any; export type RelayResponseNormalizerTest8Query$variables = {| - id: string, enableDefer: boolean, + id: string, |}; export type RelayResponseNormalizerTest8Query$data = {| +node: ?{| @@ -27,8 +27,8 @@ export type RelayResponseNormalizerTest8Query$data = {| |}, |}; export type RelayResponseNormalizerTest8Query = {| - variables: RelayResponseNormalizerTest8Query$variables, response: RelayResponseNormalizerTest8Query$data, + variables: RelayResponseNormalizerTest8Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest9Fragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest9Fragment.graphql.js index ae4da2b5b6d41..0ee1d6cc2d9e0 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest9Fragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest9Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<09865c72dee44037114a2a163e01be88>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayResponseNormalizerTest9Fragment$fragmentType: FragmentType; export type RelayResponseNormalizerTest9Fragment$data = {| - +id: string, +actors: ?$ReadOnlyArray, + +id: string, +$fragmentType: RelayResponseNormalizerTest9Fragment$fragmentType, |}; export type RelayResponseNormalizerTest9Fragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest9Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest9Query.graphql.js index c569879412bb6..a58125d4fe702 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest9Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest9Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<57d9f990af0ee616481c1fd5f28bf8ef>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -28,8 +28,8 @@ export type RelayResponseNormalizerTest9Query$data = {| |}, |}; export type RelayResponseNormalizerTest9Query = {| - variables: RelayResponseNormalizerTest9Query$variables, response: RelayResponseNormalizerTest9Query$data, + variables: RelayResponseNormalizerTest9Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTestActorChangeQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTestActorChangeQuery.graphql.js index 1fb5d1974c78b..f4efb643dc8a2 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTestActorChangeQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTestActorChangeQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<2df858f046f420051116bf81153378d7>> + * @generated SignedSource<<29544f9a00a3cdeca4cfa3dd6d3e8a61>> * @flow * @lightSyntaxTransform * @nogrep @@ -28,8 +28,8 @@ export type RelayResponseNormalizerTestActorChangeQuery$data = {| |}, |}; export type RelayResponseNormalizerTestActorChangeQuery = {| - variables: RelayResponseNormalizerTestActorChangeQuery$variables, response: RelayResponseNormalizerTestActorChangeQuery$data, + variables: RelayResponseNormalizerTestActorChangeQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTestActorChangeWithAliasQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTestActorChangeWithAliasQuery.graphql.js index 119dad5c6db8a..aee2084b21eb7 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTestActorChangeWithAliasQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTestActorChangeWithAliasQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<6194a5bf345120ba3431e828ac04a54f>> + * @generated SignedSource<<0f2efdab5215cd4619036319473d9393>> * @flow * @lightSyntaxTransform * @nogrep @@ -21,18 +21,18 @@ type RelayResponseNormalizerTestActorChangeFragment$fragmentType = any; export type RelayResponseNormalizerTestActorChangeWithAliasQuery$variables = {||}; export type RelayResponseNormalizerTestActorChangeWithAliasQuery$data = {| +viewer: ?{| - +me: ?{| - +name: ?string, - |}, +actor: ?ActorChangePoint<{| +actor_key: string, +$fragmentSpreads: RelayResponseNormalizerTestActorChangeFragment$fragmentType, |}>, + +me: ?{| + +name: ?string, + |}, |}, |}; export type RelayResponseNormalizerTestActorChangeWithAliasQuery = {| - variables: RelayResponseNormalizerTestActorChangeWithAliasQuery$variables, response: RelayResponseNormalizerTestActorChangeWithAliasQuery$data, + variables: RelayResponseNormalizerTestActorChangeWithAliasQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTestFlightQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTestFlightQuery.graphql.js index 1bfffb15ec278..c35b8e49db9d7 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTestFlightQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTestFlightQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<0e2e4bf143e53e329319660ba1340847>> + * @generated SignedSource<<5f6480c16662ee098f263bc23db99bef>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,8 +19,8 @@ /*:: import type { ConcreteRequest, Query } from 'relay-runtime'; export type RelayResponseNormalizerTestFlightQuery$variables = {| - id: string, count: number, + id: string, |}; export type RelayResponseNormalizerTestFlightQuery$data = {| +node: ?{| @@ -28,8 +28,8 @@ export type RelayResponseNormalizerTestFlightQuery$data = {| |}, |}; export type RelayResponseNormalizerTestFlightQuery = {| - variables: RelayResponseNormalizerTestFlightQuery$variables, response: RelayResponseNormalizerTestFlightQuery$data, + variables: RelayResponseNormalizerTestFlightQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTestMarkdownUserNameRenderer_name.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTestMarkdownUserNameRenderer_name.graphql.js index ff38de13746ab..c3a7bcfead805 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTestMarkdownUserNameRenderer_name.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTestMarkdownUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<3bd6ddc73bd71b417ed2104a0618829d>> + * @generated SignedSource<<857e4849ea32bedffde2cbef9ece756c>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayResponseNormalizerTestMarkdownUserNameRenderer_name$fragmentType: FragmentType; export type RelayResponseNormalizerTestMarkdownUserNameRenderer_name$data = {| - +markdown: ?string, +data: ?{| +markup: ?string, |}, + +markdown: ?string, +$fragmentType: RelayResponseNormalizerTestMarkdownUserNameRenderer_name$fragmentType, |}; export type RelayResponseNormalizerTestMarkdownUserNameRenderer_name$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTestPlainUserNameRenderer_name.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTestPlainUserNameRenderer_name.graphql.js index 053d6e9f9fe06..ecfc58756ca8d 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTestPlainUserNameRenderer_name.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTestPlainUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<6db5fe490c44a832c55335ed493f78c4>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayResponseNormalizerTestPlainUserNameRenderer_name$fragmentType: FragmentType; export type RelayResponseNormalizerTestPlainUserNameRenderer_name$data = {| - +plaintext: ?string, +data: ?{| +text: ?string, |}, + +plaintext: ?string, +$fragmentType: RelayResponseNormalizerTestPlainUserNameRenderer_name$fragmentType, |}; export type RelayResponseNormalizerTestPlainUserNameRenderer_name$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTestQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTestQuery.graphql.js index 7679e6c742384..bd9052a9fe0c5 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTestQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<2d5f3447191bd5c280d2dee177228443>> + * @generated SignedSource<<5d4822839c21811ccd6e29370430ce80>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayResponseNormalizerTestQuery$data = {| |}, |}; export type RelayResponseNormalizerTestQuery = {| - variables: RelayResponseNormalizerTestQuery$variables, response: RelayResponseNormalizerTestQuery$data, + variables: RelayResponseNormalizerTestQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTestServerOrClientQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTestServerOrClientQuery.graphql.js index 5488e1cd4ff67..20a2c54b842b6 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTestServerOrClientQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTestServerOrClientQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<01c7fcb167eff1a641aee089712cea40>> + * @generated SignedSource<<2ae16f7da8bd03694e234591822dbd8d>> * @flow * @lightSyntaxTransform * @nogrep @@ -28,8 +28,8 @@ export type RelayResponseNormalizerTestServerOrClientQuery$data = {| |}, |}; export type RelayResponseNormalizerTestServerOrClientQuery = {| - variables: RelayResponseNormalizerTestServerOrClientQuery$variables, response: RelayResponseNormalizerTestServerOrClientQuery$data, + variables: RelayResponseNormalizerTestServerOrClientQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTestStrippedQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTestStrippedQuery.graphql.js index bc0c39f1a0fa0..4b608aa928d04 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTestStrippedQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTestStrippedQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<8f8be9f3f6e0238ef05300405027f115>> + * @generated SignedSource<<8c5c97f7fe82108146a9b2c94e8f5058>> * @flow * @lightSyntaxTransform * @nogrep @@ -21,20 +21,20 @@ export type RelayResponseNormalizerTestStrippedQuery$variables = {| |}; export type RelayResponseNormalizerTestStrippedQuery$data = {| +node: ?{| - +id: string, +__typename: string, +firstName?: ?string, - +nickname?: ?string, +foo?: ?{| +bar: ?{| +content: ?string, |}, |}, + +id: string, + +nickname?: ?string, |}, |}; export type RelayResponseNormalizerTestStrippedQuery = {| - variables: RelayResponseNormalizerTestStrippedQuery$variables, response: RelayResponseNormalizerTestStrippedQuery$data, + variables: RelayResponseNormalizerTestStrippedQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest_clientFragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest_clientFragment.graphql.js index 6f0f93d57b838..b160edd356152 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest_clientFragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest_clientFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<48c98710870ee2edb949f1ec92253717>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayResponseNormalizerTest_clientFragment$fragmentType: FragmentType; export type RelayResponseNormalizerTest_clientFragment$data = {| - +name: ?string, +body: ?{| +text: ?string, |}, + +name: ?string, +$fragmentType: RelayResponseNormalizerTest_clientFragment$fragmentType, |}; export type RelayResponseNormalizerTest_clientFragment$key = { diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest_pvFragment.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest_pvFragment.graphql.js index 3f0b9dd88c731..baa1b4f1d4353 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest_pvFragment.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest_pvFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<5a177c27af7febd74bdcf77459fcd7fe>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,9 +19,9 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayResponseNormalizerTest_pvFragment$fragmentType: FragmentType; export type RelayResponseNormalizerTest_pvFragment$data = {| - +name?: ?string, +firstName?: ?string, +lastName?: ?string, + +name?: ?string, +username?: ?string, +$fragmentType: RelayResponseNormalizerTest_pvFragment$fragmentType, |}; diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest_pvQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest_pvQuery.graphql.js index 79137ca9c9f0b..9d76a735c5a7f 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest_pvQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayResponseNormalizerTest_pvQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<13093135f77197c94999a50b046b237e>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,14 +27,14 @@ export type RelayResponseNormalizerTest_pvQuery$data = {| |}, |}; export type RelayResponseNormalizerTest_pvQuery = {| - variables: RelayResponseNormalizerTest_pvQuery$variables, response: RelayResponseNormalizerTest_pvQuery$data, + variables: RelayResponseNormalizerTest_pvQuery$variables, |}; type ProvidedVariablesType = {| - +__relay_internal__pv__RelayProvider_returnsTrue: {| + +__relay_internal__pv__RelayProvider_returnsFalse: {| +get: () => boolean, |}, - +__relay_internal__pv__RelayProvider_returnsFalse: {| + +__relay_internal__pv__RelayProvider_returnsTrue: {| +get: () => boolean, |}, |}; diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayStoreUtilsTest1Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayStoreUtilsTest1Query.graphql.js index e350097a8202f..bd690d3736e69 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayStoreUtilsTest1Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayStoreUtilsTest1Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<4759e91e0942f3f3bd3d06455afc6699>> + * @generated SignedSource<<26c80935dab53517afa743f0c198dfb1>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type RelayStoreUtilsTest1Query$data = {| |}, |}; export type RelayStoreUtilsTest1Query = {| - variables: RelayStoreUtilsTest1Query$variables, response: RelayStoreUtilsTest1Query$data, + variables: RelayStoreUtilsTest1Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayStoreUtilsTest2Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayStoreUtilsTest2Query.graphql.js index 8b7fff357a756..b8db468bbed84 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayStoreUtilsTest2Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayStoreUtilsTest2Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<19e2cc32e1b9ad01ff0e0cf553dbe45c>> + * @generated SignedSource<<564755276ba0b794f5f94ba4d00f467a>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type RelayStoreUtilsTest2Query$data = {| |}, |}; export type RelayStoreUtilsTest2Query = {| - variables: RelayStoreUtilsTest2Query$variables, response: RelayStoreUtilsTest2Query$data, + variables: RelayStoreUtilsTest2Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayStoreUtilsTest3Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayStoreUtilsTest3Query.graphql.js index d8dcdcf5022f5..ef5a46c29417f 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayStoreUtilsTest3Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayStoreUtilsTest3Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<314d2d3f504ba0f7eb63767f17ee6ad8>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type RelayStoreUtilsTest3Query$data = {| |}, |}; export type RelayStoreUtilsTest3Query = {| - variables: RelayStoreUtilsTest3Query$variables, response: RelayStoreUtilsTest3Query$data, + variables: RelayStoreUtilsTest3Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayStoreUtilsTest4Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayStoreUtilsTest4Query.graphql.js index 4e46f91f6da09..a36c66292e066 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayStoreUtilsTest4Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayStoreUtilsTest4Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<5b7264043a24af3b54150ccd81308641>> + * @generated SignedSource<<29801aabd48244c5549d0ab0d56c66db>> * @flow * @lightSyntaxTransform * @nogrep @@ -33,8 +33,8 @@ export type RelayStoreUtilsTest4Query$data = {| |}, |}; export type RelayStoreUtilsTest4Query = {| - variables: RelayStoreUtilsTest4Query$variables, response: RelayStoreUtilsTest4Query$data, + variables: RelayStoreUtilsTest4Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/RelayStoreUtilsTest5Query.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/RelayStoreUtilsTest5Query.graphql.js index ca10c8675b7cd..cc2a8f29a9869 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/RelayStoreUtilsTest5Query.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/RelayStoreUtilsTest5Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -33,8 +33,8 @@ export type RelayStoreUtilsTest5Query$data = {| |}, |}; export type RelayStoreUtilsTest5Query = {| - variables: RelayStoreUtilsTest5Query$variables, response: RelayStoreUtilsTest5Query$data, + variables: RelayStoreUtilsTest5Query$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/cloneRelayHandleSourceFieldTestTestQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/cloneRelayHandleSourceFieldTestTestQuery.graphql.js index e4c4140bfd7ff..09942876d2726 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/cloneRelayHandleSourceFieldTestTestQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/cloneRelayHandleSourceFieldTestTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<2c0b5c86cefe7a84f4d5938567898916>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type cloneRelayHandleSourceFieldTestTestQuery$data = {| |}, |}; export type cloneRelayHandleSourceFieldTestTestQuery = {| - variables: cloneRelayHandleSourceFieldTestTestQuery$variables, response: cloneRelayHandleSourceFieldTestTestQuery$data, + variables: cloneRelayHandleSourceFieldTestTestQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/cloneRelayScalarHandleSourceFieldTestQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/cloneRelayScalarHandleSourceFieldTestQuery.graphql.js index 2551bbf7cedc9..e1fa94b719c4c 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/cloneRelayScalarHandleSourceFieldTestQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/cloneRelayScalarHandleSourceFieldTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type cloneRelayScalarHandleSourceFieldTestQuery$data = {| |}, |}; export type cloneRelayScalarHandleSourceFieldTestQuery = {| - variables: cloneRelayScalarHandleSourceFieldTestQuery$variables, response: cloneRelayScalarHandleSourceFieldTestQuery$data, + variables: cloneRelayScalarHandleSourceFieldTestQuery$variables, |}; */ diff --git a/packages/relay-runtime/store/__tests__/__generated__/readInlineDataTestUserQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/readInlineDataTestUserQuery.graphql.js index 3712751695d2f..b246ffdc629c1 100644 --- a/packages/relay-runtime/store/__tests__/__generated__/readInlineDataTestUserQuery.graphql.js +++ b/packages/relay-runtime/store/__tests__/__generated__/readInlineDataTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type readInlineDataTestUserQuery$data = {| |}, |}; export type readInlineDataTestUserQuery = {| - variables: readInlineDataTestUserQuery$variables, response: readInlineDataTestUserQuery$data, + variables: readInlineDataTestUserQuery$variables, |}; */ diff --git a/packages/relay-runtime/subscription/__tests__/__generated__/requestSubscriptionTest1CommentCreateSubscription.graphql.js b/packages/relay-runtime/subscription/__tests__/__generated__/requestSubscriptionTest1CommentCreateSubscription.graphql.js index c5f40d747903c..389bbfea4e516 100644 --- a/packages/relay-runtime/subscription/__tests__/__generated__/requestSubscriptionTest1CommentCreateSubscription.graphql.js +++ b/packages/relay-runtime/subscription/__tests__/__generated__/requestSubscriptionTest1CommentCreateSubscription.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -28,17 +28,17 @@ export type requestSubscriptionTest1CommentCreateSubscription$data = {| +commentCreateSubscribe: ?{| +feedbackCommentEdge: ?{| +node: ?{| - +id: string, +body: ?{| +text: ?string, |}, + +id: string, |}, |}, |}, |}; export type requestSubscriptionTest1CommentCreateSubscription = {| - variables: requestSubscriptionTest1CommentCreateSubscription$variables, response: requestSubscriptionTest1CommentCreateSubscription$data, + variables: requestSubscriptionTest1CommentCreateSubscription$variables, |}; */ diff --git a/packages/relay-runtime/subscription/__tests__/__generated__/requestSubscriptionTestCommentCreateSubscription.graphql.js b/packages/relay-runtime/subscription/__tests__/__generated__/requestSubscriptionTestCommentCreateSubscription.graphql.js index 28d4b7a8097d2..836a78facf5ae 100644 --- a/packages/relay-runtime/subscription/__tests__/__generated__/requestSubscriptionTestCommentCreateSubscription.graphql.js +++ b/packages/relay-runtime/subscription/__tests__/__generated__/requestSubscriptionTestCommentCreateSubscription.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<5ccfcc005ceaa42d0ddc4162369a78dd>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -28,17 +28,17 @@ export type requestSubscriptionTestCommentCreateSubscription$data = {| +commentCreateSubscribe: ?{| +feedbackCommentEdge: ?{| +node: ?{| - +id: string, +body: ?{| +text: ?string, |}, + +id: string, |}, |}, |}, |}; export type requestSubscriptionTestCommentCreateSubscription = {| - variables: requestSubscriptionTestCommentCreateSubscription$variables, response: requestSubscriptionTestCommentCreateSubscription$data, + variables: requestSubscriptionTestCommentCreateSubscription$variables, |}; */ diff --git a/packages/relay-runtime/subscription/__tests__/__generated__/requestSubscriptionTestConfigCreateSubscription.graphql.js b/packages/relay-runtime/subscription/__tests__/__generated__/requestSubscriptionTestConfigCreateSubscription.graphql.js index ac4d418022e27..93622f56f8814 100644 --- a/packages/relay-runtime/subscription/__tests__/__generated__/requestSubscriptionTestConfigCreateSubscription.graphql.js +++ b/packages/relay-runtime/subscription/__tests__/__generated__/requestSubscriptionTestConfigCreateSubscription.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<7139abd87033108ab2d27fdea55cc2ec>> + * @generated SignedSource<<5e310ff359eb50e356d8a72add14ee2d>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type requestSubscriptionTestConfigCreateSubscription$data = {| |}, |}; export type requestSubscriptionTestConfigCreateSubscription = {| - variables: requestSubscriptionTestConfigCreateSubscription$variables, response: requestSubscriptionTestConfigCreateSubscription$data, + variables: requestSubscriptionTestConfigCreateSubscription$variables, |}; */ diff --git a/packages/relay-runtime/subscription/__tests__/__generated__/requestSubscriptionTestConfigsQuery.graphql.js b/packages/relay-runtime/subscription/__tests__/__generated__/requestSubscriptionTestConfigsQuery.graphql.js index 8286ba1950016..1a11a1bb4797c 100644 --- a/packages/relay-runtime/subscription/__tests__/__generated__/requestSubscriptionTestConfigsQuery.graphql.js +++ b/packages/relay-runtime/subscription/__tests__/__generated__/requestSubscriptionTestConfigsQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<882b34bb757d0c421cdbd6c95b7b1d72>> + * @generated SignedSource<<57fefa3632b2258e2fabfcf7cc8e4c0d>> * @flow * @lightSyntaxTransform * @nogrep @@ -29,8 +29,8 @@ export type requestSubscriptionTestConfigsQuery$data = {| |}, |}; export type requestSubscriptionTestConfigsQuery = {| - variables: requestSubscriptionTestConfigsQuery$variables, response: requestSubscriptionTestConfigsQuery$data, + variables: requestSubscriptionTestConfigsQuery$variables, |}; */ diff --git a/packages/relay-runtime/subscription/__tests__/__generated__/requestSubscriptionTestFeedbackCommentQuery.graphql.js b/packages/relay-runtime/subscription/__tests__/__generated__/requestSubscriptionTestFeedbackCommentQuery.graphql.js index a0cd22cabfd56..acfc530fbff03 100644 --- a/packages/relay-runtime/subscription/__tests__/__generated__/requestSubscriptionTestFeedbackCommentQuery.graphql.js +++ b/packages/relay-runtime/subscription/__tests__/__generated__/requestSubscriptionTestFeedbackCommentQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<13f6921f76d64d374f7636c8609e2e50>> + * @generated SignedSource<<4075cfdb7c2928a8faabf242c3773d1b>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,18 +24,18 @@ export type requestSubscriptionTestFeedbackCommentQuery$data = {| +comments?: ?{| +edges: ?$ReadOnlyArray, |}, |}, |}; export type requestSubscriptionTestFeedbackCommentQuery = {| - variables: requestSubscriptionTestFeedbackCommentQuery$variables, response: requestSubscriptionTestFeedbackCommentQuery$data, + variables: requestSubscriptionTestFeedbackCommentQuery$variables, |}; */ diff --git a/packages/relay-runtime/subscription/__tests__/__generated__/requestSubscriptionTestPlainUserNameRenderer_name.graphql.js b/packages/relay-runtime/subscription/__tests__/__generated__/requestSubscriptionTestPlainUserNameRenderer_name.graphql.js index 5e4831644e30f..2e390a079a749 100644 --- a/packages/relay-runtime/subscription/__tests__/__generated__/requestSubscriptionTestPlainUserNameRenderer_name.graphql.js +++ b/packages/relay-runtime/subscription/__tests__/__generated__/requestSubscriptionTestPlainUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type requestSubscriptionTestPlainUserNameRenderer_name$fragmentType: FragmentType; export type requestSubscriptionTestPlainUserNameRenderer_name$data = {| - +plaintext: ?string, +data: ?{| +text: ?string, |}, + +plaintext: ?string, +$fragmentType: requestSubscriptionTestPlainUserNameRenderer_name$fragmentType, |}; export type requestSubscriptionTestPlainUserNameRenderer_name$key = { diff --git a/packages/relay-runtime/subscription/__tests__/__generated__/requestSubscriptionTestSubscription.graphql.js b/packages/relay-runtime/subscription/__tests__/__generated__/requestSubscriptionTestSubscription.graphql.js index ea3bdb73bda98..ae2b025b8b4e5 100644 --- a/packages/relay-runtime/subscription/__tests__/__generated__/requestSubscriptionTestSubscription.graphql.js +++ b/packages/relay-runtime/subscription/__tests__/__generated__/requestSubscriptionTestSubscription.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<6ff25624339fd98caa1c4cafb141a95f>> + * @generated SignedSource<<3cd1fdfe422662285cd1c32ea147c69e>> * @flow * @lightSyntaxTransform * @nogrep @@ -42,8 +42,8 @@ export type requestSubscriptionTestSubscription$data = {| |}, |}; export type requestSubscriptionTestSubscription = {| - variables: requestSubscriptionTestSubscription$variables, response: requestSubscriptionTestSubscription$data, + variables: requestSubscriptionTestSubscription$variables, |}; */ diff --git a/packages/relay-runtime/util/__tests__/__generated__/getFragmentIdentifierTest1UserQuery.graphql.js b/packages/relay-runtime/util/__tests__/__generated__/getFragmentIdentifierTest1UserQuery.graphql.js index 21659f7d86d07..6df002842a474 100644 --- a/packages/relay-runtime/util/__tests__/__generated__/getFragmentIdentifierTest1UserQuery.graphql.js +++ b/packages/relay-runtime/util/__tests__/__generated__/getFragmentIdentifierTest1UserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<399e1e8a5d09d9b72c1634d1bef8aee4>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type getFragmentIdentifierTest1UserQuery$data = {| |}, |}; export type getFragmentIdentifierTest1UserQuery = {| - variables: getFragmentIdentifierTest1UserQuery$variables, response: getFragmentIdentifierTest1UserQuery$data, + variables: getFragmentIdentifierTest1UserQuery$variables, |}; */ diff --git a/packages/relay-runtime/util/__tests__/__generated__/getFragmentIdentifierTest1UserQueryWithArgsQuery.graphql.js b/packages/relay-runtime/util/__tests__/__generated__/getFragmentIdentifierTest1UserQueryWithArgsQuery.graphql.js index a188d145e9051..d705c78850baf 100644 --- a/packages/relay-runtime/util/__tests__/__generated__/getFragmentIdentifierTest1UserQueryWithArgsQuery.graphql.js +++ b/packages/relay-runtime/util/__tests__/__generated__/getFragmentIdentifierTest1UserQueryWithArgsQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type getFragmentIdentifierTest1UserQueryWithArgsQuery$data = {| |}, |}; export type getFragmentIdentifierTest1UserQueryWithArgsQuery = {| - variables: getFragmentIdentifierTest1UserQueryWithArgsQuery$variables, response: getFragmentIdentifierTest1UserQueryWithArgsQuery$data, + variables: getFragmentIdentifierTest1UserQueryWithArgsQuery$variables, |}; */ diff --git a/packages/relay-runtime/util/__tests__/__generated__/getFragmentIdentifierTest1UsersQuery.graphql.js b/packages/relay-runtime/util/__tests__/__generated__/getFragmentIdentifierTest1UsersQuery.graphql.js index 94306b2427b0a..28049d8ed0903 100644 --- a/packages/relay-runtime/util/__tests__/__generated__/getFragmentIdentifierTest1UsersQuery.graphql.js +++ b/packages/relay-runtime/util/__tests__/__generated__/getFragmentIdentifierTest1UsersQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<0b164230daeca03a5f7a33bdb741a44f>> + * @generated SignedSource<<42c2e9811bcb3357bd96e395552e5e94>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type getFragmentIdentifierTest1UsersQuery$data = {| |}>, |}; export type getFragmentIdentifierTest1UsersQuery = {| - variables: getFragmentIdentifierTest1UsersQuery$variables, response: getFragmentIdentifierTest1UsersQuery$data, + variables: getFragmentIdentifierTest1UsersQuery$variables, |}; */ diff --git a/packages/relay-runtime/util/__tests__/__generated__/getFragmentIdentifierTestUserQuery.graphql.js b/packages/relay-runtime/util/__tests__/__generated__/getFragmentIdentifierTestUserQuery.graphql.js index 1799ea2aac66c..02d46101cc1b0 100644 --- a/packages/relay-runtime/util/__tests__/__generated__/getFragmentIdentifierTestUserQuery.graphql.js +++ b/packages/relay-runtime/util/__tests__/__generated__/getFragmentIdentifierTestUserQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<6505beb7af58d750cdef8ada9b655569>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type getFragmentIdentifierTestUserQuery$data = {| |}, |}; export type getFragmentIdentifierTestUserQuery = {| - variables: getFragmentIdentifierTestUserQuery$variables, response: getFragmentIdentifierTestUserQuery$data, + variables: getFragmentIdentifierTestUserQuery$variables, |}; */ diff --git a/packages/relay-runtime/util/__tests__/__generated__/getFragmentIdentifierTestUserQueryWithArgsQuery.graphql.js b/packages/relay-runtime/util/__tests__/__generated__/getFragmentIdentifierTestUserQueryWithArgsQuery.graphql.js index 1719a80f352d8..3186e8ba1583e 100644 --- a/packages/relay-runtime/util/__tests__/__generated__/getFragmentIdentifierTestUserQueryWithArgsQuery.graphql.js +++ b/packages/relay-runtime/util/__tests__/__generated__/getFragmentIdentifierTestUserQueryWithArgsQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<45f31fe0ae0cdaf09ede8a3a7b8ce61b>> + * @generated SignedSource<<78482504e7ffbbb96a3bf79f8a5d2b9d>> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type getFragmentIdentifierTestUserQueryWithArgsQuery$data = {| |}, |}; export type getFragmentIdentifierTestUserQueryWithArgsQuery = {| - variables: getFragmentIdentifierTestUserQueryWithArgsQuery$variables, response: getFragmentIdentifierTestUserQueryWithArgsQuery$data, + variables: getFragmentIdentifierTestUserQueryWithArgsQuery$variables, |}; */ diff --git a/packages/relay-runtime/util/__tests__/__generated__/getFragmentIdentifierTestUsersQuery.graphql.js b/packages/relay-runtime/util/__tests__/__generated__/getFragmentIdentifierTestUsersQuery.graphql.js index 1ae0c35118dd5..a90029b378d84 100644 --- a/packages/relay-runtime/util/__tests__/__generated__/getFragmentIdentifierTestUsersQuery.graphql.js +++ b/packages/relay-runtime/util/__tests__/__generated__/getFragmentIdentifierTestUsersQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<990273a31bf6dc5b1130d67756297a14>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type getFragmentIdentifierTestUsersQuery$data = {| |}>, |}; export type getFragmentIdentifierTestUsersQuery = {| - variables: getFragmentIdentifierTestUsersQuery$variables, response: getFragmentIdentifierTestUsersQuery$data, + variables: getFragmentIdentifierTestUsersQuery$variables, |}; */ diff --git a/packages/relay-runtime/util/__tests__/__generated__/withProvidedVariablesTest1Query.graphql.js b/packages/relay-runtime/util/__tests__/__generated__/withProvidedVariablesTest1Query.graphql.js index 7e39e23b4dcab..cd1c0e2fb8e02 100644 --- a/packages/relay-runtime/util/__tests__/__generated__/withProvidedVariablesTest1Query.graphql.js +++ b/packages/relay-runtime/util/__tests__/__generated__/withProvidedVariablesTest1Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type withProvidedVariablesTest1Query$data = {| |}, |}; export type withProvidedVariablesTest1Query = {| - variables: withProvidedVariablesTest1Query$variables, response: withProvidedVariablesTest1Query$data, + variables: withProvidedVariablesTest1Query$variables, |}; type ProvidedVariablesType = {| +__relay_internal__pv__provideNumberOfFriends: {| diff --git a/packages/relay-runtime/util/__tests__/__generated__/withProvidedVariablesTest2Query.graphql.js b/packages/relay-runtime/util/__tests__/__generated__/withProvidedVariablesTest2Query.graphql.js index e32fe79c86934..d5151a0ab86e1 100644 --- a/packages/relay-runtime/util/__tests__/__generated__/withProvidedVariablesTest2Query.graphql.js +++ b/packages/relay-runtime/util/__tests__/__generated__/withProvidedVariablesTest2Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<86a2f684a1932a0f92fb23b902a196ac>> + * @generated SignedSource<<9461a97d2044713616087c07ac72fc79>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type withProvidedVariablesTest2Query$data = {| |}, |}; export type withProvidedVariablesTest2Query = {| - variables: withProvidedVariablesTest2Query$variables, response: withProvidedVariablesTest2Query$data, + variables: withProvidedVariablesTest2Query$variables, |}; type ProvidedVariablesType = {| +__relay_internal__pv__provideNumberOfFriends: {| diff --git a/packages/relay-runtime/util/__tests__/__generated__/withProvidedVariablesTest3Fragment.graphql.js b/packages/relay-runtime/util/__tests__/__generated__/withProvidedVariablesTest3Fragment.graphql.js index b2a08c591c3fa..ae70f223b238e 100644 --- a/packages/relay-runtime/util/__tests__/__generated__/withProvidedVariablesTest3Fragment.graphql.js +++ b/packages/relay-runtime/util/__tests__/__generated__/withProvidedVariablesTest3Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<77e18a1053611a13bb804b19257f2e02>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type withProvidedVariablesTest3Fragment$fragmentType: FragmentType; export type withProvidedVariablesTest3Fragment$data = {| - +name?: ?string, +friends: ?{| +count: ?number, |}, + +name?: ?string, +$fragmentType: withProvidedVariablesTest3Fragment$fragmentType, |}; export type withProvidedVariablesTest3Fragment$key = { diff --git a/packages/relay-runtime/util/__tests__/__generated__/withProvidedVariablesTest3Query.graphql.js b/packages/relay-runtime/util/__tests__/__generated__/withProvidedVariablesTest3Query.graphql.js index 407f9bf9f4e8d..ce8c25939bc96 100644 --- a/packages/relay-runtime/util/__tests__/__generated__/withProvidedVariablesTest3Query.graphql.js +++ b/packages/relay-runtime/util/__tests__/__generated__/withProvidedVariablesTest3Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -24,16 +24,16 @@ export type withProvidedVariablesTest3Query$data = {| |}, |}; export type withProvidedVariablesTest3Query = {| - variables: withProvidedVariablesTest3Query$variables, response: withProvidedVariablesTest3Query$data, + variables: withProvidedVariablesTest3Query$variables, |}; type ProvidedVariablesType = {| - +__relay_internal__pv__provideNumberOfFriends: {| - +get: () => number, - |}, +__relay_internal__pv__provideIncludeUserNames: {| +get: () => boolean, |}, + +__relay_internal__pv__provideNumberOfFriends: {| + +get: () => number, + |}, |}; */ diff --git a/packages/relay-runtime/util/__tests__/__generated__/withProvidedVariablesTest4Query.graphql.js b/packages/relay-runtime/util/__tests__/__generated__/withProvidedVariablesTest4Query.graphql.js index 1a824ed067a66..64d2cd60762a4 100644 --- a/packages/relay-runtime/util/__tests__/__generated__/withProvidedVariablesTest4Query.graphql.js +++ b/packages/relay-runtime/util/__tests__/__generated__/withProvidedVariablesTest4Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<08e727524f8414baece4a12bb895d1f3>> + * @generated SignedSource<<1a8bd168205298102b8eda149d3ff2da>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,16 +25,16 @@ export type withProvidedVariablesTest4Query$data = {| |}, |}; export type withProvidedVariablesTest4Query = {| - variables: withProvidedVariablesTest4Query$variables, response: withProvidedVariablesTest4Query$data, + variables: withProvidedVariablesTest4Query$variables, |}; type ProvidedVariablesType = {| - +__relay_internal__pv__provideNumberOfFriends: {| - +get: () => number, - |}, +__relay_internal__pv__provideIncludeUserNames: {| +get: () => boolean, |}, + +__relay_internal__pv__provideNumberOfFriends: {| + +get: () => number, + |}, |}; */ diff --git a/packages/relay-runtime/util/__tests__/__generated__/withProvidedVariablesTest5Fragment.graphql.js b/packages/relay-runtime/util/__tests__/__generated__/withProvidedVariablesTest5Fragment.graphql.js index 4c36f46b61378..655a86b7183bb 100644 --- a/packages/relay-runtime/util/__tests__/__generated__/withProvidedVariablesTest5Fragment.graphql.js +++ b/packages/relay-runtime/util/__tests__/__generated__/withProvidedVariablesTest5Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<296629043261b16230010d270a9d94f0>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type withProvidedVariablesTest5Fragment$fragmentType: FragmentType; export type withProvidedVariablesTest5Fragment$data = {| - +profile_picture: ?{| + +other_picture: ?{| +uri: ?string, |}, - +other_picture: ?{| + +profile_picture: ?{| +uri: ?string, |}, +$fragmentType: withProvidedVariablesTest5Fragment$fragmentType, diff --git a/packages/relay-runtime/util/__tests__/__generated__/withProvidedVariablesTest5Query.graphql.js b/packages/relay-runtime/util/__tests__/__generated__/withProvidedVariablesTest5Query.graphql.js index 01b369c66eff1..21b8e206c5d03 100644 --- a/packages/relay-runtime/util/__tests__/__generated__/withProvidedVariablesTest5Query.graphql.js +++ b/packages/relay-runtime/util/__tests__/__generated__/withProvidedVariablesTest5Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<97ef6d3ac23e0400cae1419bc6658a92>> + * @generated SignedSource<<41c212368df9ad3fbbf10d403f0bf8c6>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type withProvidedVariablesTest5Query$data = {| |}, |}; export type withProvidedVariablesTest5Query = {| - variables: withProvidedVariablesTest5Query$variables, response: withProvidedVariablesTest5Query$data, + variables: withProvidedVariablesTest5Query$variables, |}; type ProvidedVariablesType = {| +__relay_internal__pv__provideRandomNumber_invalid1: {| diff --git a/packages/relay-runtime/util/__tests__/__generated__/withProvidedVariablesTest6Query.graphql.js b/packages/relay-runtime/util/__tests__/__generated__/withProvidedVariablesTest6Query.graphql.js index 5a3616c08888a..1144fc44389db 100644 --- a/packages/relay-runtime/util/__tests__/__generated__/withProvidedVariablesTest6Query.graphql.js +++ b/packages/relay-runtime/util/__tests__/__generated__/withProvidedVariablesTest6Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<101a6b20b4067cf10432a4ecbfded4d3>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type withProvidedVariablesTest6Query$data = {| |}, |}; export type withProvidedVariablesTest6Query = {| - variables: withProvidedVariablesTest6Query$variables, response: withProvidedVariablesTest6Query$data, + variables: withProvidedVariablesTest6Query$variables, |}; type ProvidedVariablesType = {| +__relay_internal__pv__provideRandomNumber_invalid1: {| diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentTestQuery.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentTestQuery.graphql.js index 206b98dd0965c..ca3f4a8960cee 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentTestQuery.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentTestQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<596dbefb18ef5e8a01f8eb3d6f9f085d>> + * @generated SignedSource<<434613cb6b637b52549fc7deaf99f625>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayMockEnvironmentTestQuery$data = {| |}, |}; export type RelayMockEnvironmentTestQuery = {| - variables: RelayMockEnvironmentTestQuery$variables, response: RelayMockEnvironmentTestQuery$data, + variables: RelayMockEnvironmentTestQuery$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestDisruptiveSuccessMutation.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestDisruptiveSuccessMutation.graphql.js index 63a8edea75784..15d62669e96d8 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestDisruptiveSuccessMutation.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestDisruptiveSuccessMutation.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<2244e6a9efd60d12536ca4dea65ef9a4>> + * @generated SignedSource<<615b958e0672754f8e81802fcbac53d0>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,14 +26,14 @@ export type RelayMockEnvironmentWithComponentsTestDisruptiveSuccessMutation$vari export type RelayMockEnvironmentWithComponentsTestDisruptiveSuccessMutation$data = {| +feedbackLike: ?{| +feedback: ?{| - +id: string, +doesViewerLike: ?boolean, + +id: string, |}, |}, |}; export type RelayMockEnvironmentWithComponentsTestDisruptiveSuccessMutation = {| - variables: RelayMockEnvironmentWithComponentsTestDisruptiveSuccessMutation$variables, response: RelayMockEnvironmentWithComponentsTestDisruptiveSuccessMutation$data, + variables: RelayMockEnvironmentWithComponentsTestDisruptiveSuccessMutation$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestExceptionalImpactQuery.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestExceptionalImpactQuery.graphql.js index 952948aed352b..1373d2a06aa03 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestExceptionalImpactQuery.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestExceptionalImpactQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<578a3f9853ce3481092590e188a6b312>> * @flow * @lightSyntaxTransform * @nogrep @@ -22,16 +22,16 @@ export type RelayMockEnvironmentWithComponentsTestExceptionalImpactQuery$variabl |}; export type RelayMockEnvironmentWithComponentsTestExceptionalImpactQuery$data = {| +user: ?{| - +id: string, - +name: ?string, +hometown: ?{| +$fragmentSpreads: RelayMockEnvironmentWithComponentsTestUsefulAwesomenessFragment$fragmentType, |}, + +id: string, + +name: ?string, |}, |}; export type RelayMockEnvironmentWithComponentsTestExceptionalImpactQuery = {| - variables: RelayMockEnvironmentWithComponentsTestExceptionalImpactQuery$variables, response: RelayMockEnvironmentWithComponentsTestExceptionalImpactQuery$data, + variables: RelayMockEnvironmentWithComponentsTestExceptionalImpactQuery$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestFantasticEffortQuery.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestFantasticEffortQuery.graphql.js index 5a6a8b93791d5..ee4be5f167a17 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestFantasticEffortQuery.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestFantasticEffortQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<3810bc977a09ab97c56db97c5d2ebb53>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayMockEnvironmentWithComponentsTestFantasticEffortQuery$data = {| |}, |}; export type RelayMockEnvironmentWithComponentsTestFantasticEffortQuery = {| - variables: RelayMockEnvironmentWithComponentsTestFantasticEffortQuery$variables, response: RelayMockEnvironmentWithComponentsTestFantasticEffortQuery$data, + variables: RelayMockEnvironmentWithComponentsTestFantasticEffortQuery$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestImpactfulAwesomenessFragment.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestImpactfulAwesomenessFragment.graphql.js index f9b6b1177c019..90738f8971184 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestImpactfulAwesomenessFragment.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestImpactfulAwesomenessFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,11 +19,11 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayMockEnvironmentWithComponentsTestImpactfulAwesomenessFragment$fragmentType: FragmentType; export type RelayMockEnvironmentWithComponentsTestImpactfulAwesomenessFragment$data = {| + +doesViewerLike: ?boolean, +id: string, +message: ?{| +text: ?string, |}, - +doesViewerLike: ?boolean, +$fragmentType: RelayMockEnvironmentWithComponentsTestImpactfulAwesomenessFragment$fragmentType, |}; export type RelayMockEnvironmentWithComponentsTestImpactfulAwesomenessFragment$key = { diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestImpossibleAwesomenessQuery.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestImpossibleAwesomenessQuery.graphql.js index 41985e1fdf3c1..97ffd4c8671da 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestImpossibleAwesomenessQuery.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestImpossibleAwesomenessQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<28022cba3314e01f07231d3ce0027db0>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -29,8 +29,8 @@ export type RelayMockEnvironmentWithComponentsTestImpossibleAwesomenessQuery$dat |}, |}; export type RelayMockEnvironmentWithComponentsTestImpossibleAwesomenessQuery = {| - variables: RelayMockEnvironmentWithComponentsTestImpossibleAwesomenessQuery$variables, response: RelayMockEnvironmentWithComponentsTestImpossibleAwesomenessQuery$data, + variables: RelayMockEnvironmentWithComponentsTestImpossibleAwesomenessQuery$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestImpressiveResultQuery.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestImpressiveResultQuery.graphql.js index 83de9fe5ce77c..44038cca1ff31 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestImpressiveResultQuery.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestImpressiveResultQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<6854cdc751e62b7686950fe043b52405>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayMockEnvironmentWithComponentsTestImpressiveResultQuery$data = { |}, |}; export type RelayMockEnvironmentWithComponentsTestImpressiveResultQuery = {| - variables: RelayMockEnvironmentWithComponentsTestImpressiveResultQuery$variables, response: RelayMockEnvironmentWithComponentsTestImpressiveResultQuery$data, + variables: RelayMockEnvironmentWithComponentsTestImpressiveResultQuery$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestNoticeableResultFragment.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestNoticeableResultFragment.graphql.js index 08fabf102e9b4..664c32a7df8fb 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestNoticeableResultFragment.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestNoticeableResultFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<16c4d86bed92718c931073f0644780d9>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,11 +19,11 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayMockEnvironmentWithComponentsTestNoticeableResultFragment$fragmentType: FragmentType; export type RelayMockEnvironmentWithComponentsTestNoticeableResultFragment$data = {| + +doesViewerLike: ?boolean, +id: string, +message: ?{| +text: ?string, |}, - +doesViewerLike: ?boolean, +$fragmentType: RelayMockEnvironmentWithComponentsTestNoticeableResultFragment$fragmentType, |}; export type RelayMockEnvironmentWithComponentsTestNoticeableResultFragment$key = { diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestNoticeableSuccessQuery.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestNoticeableSuccessQuery.graphql.js index 06f8c2ee725a8..e3248c71a2e33 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestNoticeableSuccessQuery.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestNoticeableSuccessQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<5b7678ba1de74e0868cf32ccb3afd73f>> + * @generated SignedSource<<1f9d753301ec24bcf7405590bfc74e09>> * @flow * @lightSyntaxTransform * @nogrep @@ -18,9 +18,9 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type RelayMockEnvironmentWithComponentsTestRobustAwesomenessFragment$fragmentType = any; export type RelayMockEnvironmentWithComponentsTestNoticeableSuccessQuery$variables = {| - id?: ?string, - first?: ?number, cursor?: ?string, + first?: ?number, + id?: ?string, |}; export type RelayMockEnvironmentWithComponentsTestNoticeableSuccessQuery$data = {| +user: ?{| @@ -30,8 +30,8 @@ export type RelayMockEnvironmentWithComponentsTestNoticeableSuccessQuery$data = |}, |}; export type RelayMockEnvironmentWithComponentsTestNoticeableSuccessQuery = {| - variables: RelayMockEnvironmentWithComponentsTestNoticeableSuccessQuery$variables, response: RelayMockEnvironmentWithComponentsTestNoticeableSuccessQuery$data, + variables: RelayMockEnvironmentWithComponentsTestNoticeableSuccessQuery$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestOutstandingSolutionQuery.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestOutstandingSolutionQuery.graphql.js index 148f37c032234..738119374c3bb 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestOutstandingSolutionQuery.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestOutstandingSolutionQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<24f288d3469bde3d3c34d7e26171d49e>> + * @generated SignedSource<<6a2d95b74b8bc0a2e00af4eeca5ab704>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type RelayMockEnvironmentWithComponentsTestOutstandingSolutionQuery$data |}, |}; export type RelayMockEnvironmentWithComponentsTestOutstandingSolutionQuery = {| - variables: RelayMockEnvironmentWithComponentsTestOutstandingSolutionQuery$variables, response: RelayMockEnvironmentWithComponentsTestOutstandingSolutionQuery$data, + variables: RelayMockEnvironmentWithComponentsTestOutstandingSolutionQuery$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestRedefiningSolutionQuery.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestRedefiningSolutionQuery.graphql.js index f40f39a64dd81..7a6c91e0c062e 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestRedefiningSolutionQuery.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestRedefiningSolutionQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<122f967760c4d65b8a50c036a0ec7e32>> + * @generated SignedSource<<1b08c925b2926388117b4e546f58b2cc>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayMockEnvironmentWithComponentsTestRedefiningSolutionQuery$data = |}, |}; export type RelayMockEnvironmentWithComponentsTestRedefiningSolutionQuery = {| - variables: RelayMockEnvironmentWithComponentsTestRedefiningSolutionQuery$variables, response: RelayMockEnvironmentWithComponentsTestRedefiningSolutionQuery$data, + variables: RelayMockEnvironmentWithComponentsTestRedefiningSolutionQuery$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestRemarkableFixSubscription.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestRemarkableFixSubscription.graphql.js index 75f096c7a8f65..8b25744aa5509 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestRemarkableFixSubscription.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestRemarkableFixSubscription.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<873b615a310d9477fa46bc9e1b8773ff>> + * @generated SignedSource<<4db31eb61fefed4f08cc95d024082fe0>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,14 +26,14 @@ export type RelayMockEnvironmentWithComponentsTestRemarkableFixSubscription$vari export type RelayMockEnvironmentWithComponentsTestRemarkableFixSubscription$data = {| +feedbackLikeSubscribe: ?{| +feedback: ?{| - +id: string, +doesViewerLike: ?boolean, + +id: string, |}, |}, |}; export type RelayMockEnvironmentWithComponentsTestRemarkableFixSubscription = {| - variables: RelayMockEnvironmentWithComponentsTestRemarkableFixSubscription$variables, response: RelayMockEnvironmentWithComponentsTestRemarkableFixSubscription$data, + variables: RelayMockEnvironmentWithComponentsTestRemarkableFixSubscription$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestRemarkableImpactQuery.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestRemarkableImpactQuery.graphql.js index 340fe2aebeebb..5181680566d06 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestRemarkableImpactQuery.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestRemarkableImpactQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<0bd162dfaaa69556d762a055f2ca98bf>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayMockEnvironmentWithComponentsTestRemarkableImpactQuery$data = { |}, |}; export type RelayMockEnvironmentWithComponentsTestRemarkableImpactQuery = {| - variables: RelayMockEnvironmentWithComponentsTestRemarkableImpactQuery$variables, response: RelayMockEnvironmentWithComponentsTestRemarkableImpactQuery$data, + variables: RelayMockEnvironmentWithComponentsTestRemarkableImpactQuery$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestRobustAwesomenessFragment.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestRobustAwesomenessFragment.graphql.js index 84b05c2f567ac..8e051916c87cf 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestRobustAwesomenessFragment.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestRobustAwesomenessFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<43cd81245334f55c2556d044e7ef250a>> + * @generated SignedSource<<2971c1bcb8ed7cb91ff4553594d19fe4>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,7 +19,6 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayMockEnvironmentWithComponentsTestRobustAwesomenessFragment$fragmentType: FragmentType; export type RelayMockEnvironmentWithComponentsTestRobustAwesomenessFragment$data = {| - +id: string, +friends: ?{| +edges: ?$ReadOnlyArray, |}, + +id: string, +$fragmentType: RelayMockEnvironmentWithComponentsTestRobustAwesomenessFragment$fragmentType, |}; export type RelayMockEnvironmentWithComponentsTestRobustAwesomenessFragment$key = { diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestSwiftPerformanceQuery.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestSwiftPerformanceQuery.graphql.js index dceee94282d64..3ff59173067e8 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestSwiftPerformanceQuery.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestSwiftPerformanceQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<9b78f9bd2cdad508206bc4965748d677>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayMockEnvironmentWithComponentsTestSwiftPerformanceQuery$data = { |}, |}; export type RelayMockEnvironmentWithComponentsTestSwiftPerformanceQuery = {| - variables: RelayMockEnvironmentWithComponentsTestSwiftPerformanceQuery$variables, response: RelayMockEnvironmentWithComponentsTestSwiftPerformanceQuery$data, + variables: RelayMockEnvironmentWithComponentsTestSwiftPerformanceQuery$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestWorldClassAwesomenessQuery.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestWorldClassAwesomenessQuery.graphql.js index 077493c38a1bb..0f02591ad8e6e 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestWorldClassAwesomenessQuery.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestWorldClassAwesomenessQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<39005ab088cb71108a5ed0610e14e950>> + * @generated SignedSource<<88f26714ecd9eb7f991c7afc948885f4>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayMockEnvironmentWithComponentsTestWorldClassAwesomenessQuery$dat |}, |}; export type RelayMockEnvironmentWithComponentsTestWorldClassAwesomenessQuery = {| - variables: RelayMockEnvironmentWithComponentsTestWorldClassAwesomenessQuery$variables, response: RelayMockEnvironmentWithComponentsTestWorldClassAwesomenessQuery$data, + variables: RelayMockEnvironmentWithComponentsTestWorldClassAwesomenessQuery$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestWorldClassFeatureQuery.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestWorldClassFeatureQuery.graphql.js index 336e46efb24cc..f8ae43adc291a 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestWorldClassFeatureQuery.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockEnvironmentWithComponentsTestWorldClassFeatureQuery.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayMockEnvironmentWithComponentsTestWorldClassFeatureQuery$data = |}, |}; export type RelayMockEnvironmentWithComponentsTestWorldClassFeatureQuery = {| - variables: RelayMockEnvironmentWithComponentsTestWorldClassFeatureQuery$variables, response: RelayMockEnvironmentWithComponentsTestWorldClassFeatureQuery$data, + variables: RelayMockEnvironmentWithComponentsTestWorldClassFeatureQuery$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest10Fragment.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest10Fragment.graphql.js index 0478c7330b9d5..fe3bb2fad2320 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest10Fragment.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest10Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<8956b523770481ef73f0a23f9e3df0c1>> + * @generated SignedSource<<621a723af15eb73553d52b9031080b93>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,15 +19,15 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayMockPayloadGeneratorTest10Fragment$fragmentType: FragmentType; export type RelayMockPayloadGeneratorTest10Fragment$data = {| - +name: ?string, +actor: ?{| +id?: string, +name?: ?string, +profile_picture?: ?{| - +uri: ?string, +height: ?number, + +uri: ?string, |}, |}, + +name: ?string, +profile_picture: ?{| +uri: ?string, |}, diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest10Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest10Query.graphql.js index 776fc0c577dcc..5b9496ac1058c 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest10Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest10Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayMockPayloadGeneratorTest10Query$data = {| |}, |}; export type RelayMockPayloadGeneratorTest10Query = {| - variables: RelayMockPayloadGeneratorTest10Query$variables, response: RelayMockPayloadGeneratorTest10Query$data, + variables: RelayMockPayloadGeneratorTest10Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest11Fragment.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest11Fragment.graphql.js index 51ad241db0147..1a4aa0bde8bcb 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest11Fragment.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest11Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<93ab22b9efded8776679a1b9947013dc>> + * @generated SignedSource<<2e8d3313bea2280f4fc0a80b3ee39642>> * @flow * @lightSyntaxTransform * @nogrep @@ -23,8 +23,8 @@ export type RelayMockPayloadGeneratorTest11Fragment$data = {| +id?: string, +name?: ?string, +profile_picture?: ?{| - +uri: ?string, +height: ?number, + +uri: ?string, |}, |}, +$fragmentType: RelayMockPayloadGeneratorTest11Fragment$fragmentType, diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest11Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest11Query.graphql.js index 68d73b5bcfaf1..31bf322cd9358 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest11Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest11Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayMockPayloadGeneratorTest11Query$data = {| |}, |}; export type RelayMockPayloadGeneratorTest11Query = {| - variables: RelayMockPayloadGeneratorTest11Query$variables, response: RelayMockPayloadGeneratorTest11Query$data, + variables: RelayMockPayloadGeneratorTest11Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest12Fragment.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest12Fragment.graphql.js index a0d01a7cf3374..636f8769e7cdf 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest12Fragment.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest12Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<71c928454a7f22e8d5d85c794c60e496>> + * @generated SignedSource<<9cbe1db9e30fe863710d56726a01a64d>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,35 +19,35 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayMockPayloadGeneratorTest12Fragment$fragmentType: FragmentType; export type RelayMockPayloadGeneratorTest12Fragment$data = {| - +id: string, - +name: ?string, +body: ?{| +text: ?string, |}, + +id: string, +myTown: ?{| - +id: string, - +name: ?string, - +url: ?string, +feedback: ?{| +comments: ?{| +edges: ?$ReadOnlyArray, +pageInfo: ?{| +startCursor: ?string, |}, |}, |}, + +id: string, + +name: ?string, + +url: ?string, |}, + +name: ?string, +$fragmentType: RelayMockPayloadGeneratorTest12Fragment$fragmentType, |}; export type RelayMockPayloadGeneratorTest12Fragment$key = { diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest12Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest12Query.graphql.js index f349bad4da30a..0dc527c437b90 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest12Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest12Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<5f3a19e920f1795046e14d909949d3e4>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayMockPayloadGeneratorTest12Query$data = {| |}, |}; export type RelayMockPayloadGeneratorTest12Query = {| - variables: RelayMockPayloadGeneratorTest12Query$variables, response: RelayMockPayloadGeneratorTest12Query$data, + variables: RelayMockPayloadGeneratorTest12Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest13Fragment.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest13Fragment.graphql.js index f64b8f4d9b4ba..b3f257ec6c027 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest13Fragment.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest13Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<62b65ca6141e00ecbd7d7d9e256b4e09>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -16,18 +16,18 @@ /*:: import type { Fragment, ReaderFragment } from 'relay-runtime'; -export type PersonalityTraits = "CHEERFUL" | "DERISIVE" | "HELPFUL" | "SNARKY" | "%future added value"; +export type PersonalityTraits = ("CHEERFUL" | "DERISIVE" | "HELPFUL" | "SNARKY" | "%future added value"); import type { FragmentType } from "relay-runtime"; declare export opaque type RelayMockPayloadGeneratorTest13Fragment$fragmentType: FragmentType; export type RelayMockPayloadGeneratorTest13Fragment$data = {| +actor: ?{| +id?: string, +name?: ?string, - +traits?: ?$ReadOnlyArray, +profile_picture?: ?{| - +uri: ?string, +height: ?number, + +uri: ?string, |}, + +traits?: ?$ReadOnlyArray, +websites?: ?$ReadOnlyArray, |}, +$fragmentType: RelayMockPayloadGeneratorTest13Fragment$fragmentType, diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest13Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest13Query.graphql.js index 150ba9b96ca75..19b03e8840d7d 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest13Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest13Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<95ccada2e587ac3cd0d9c7bcda2114fd>> + * @generated SignedSource<<22956097c862137848afab5194569ed7>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayMockPayloadGeneratorTest13Query$data = {| |}, |}; export type RelayMockPayloadGeneratorTest13Query = {| - variables: RelayMockPayloadGeneratorTest13Query$variables, response: RelayMockPayloadGeneratorTest13Query$data, + variables: RelayMockPayloadGeneratorTest13Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest14Fragment.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest14Fragment.graphql.js index 2bdef28767c39..83cca758ce0ac 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest14Fragment.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest14Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<6e7d2105d7b553b214d30cfbabc75ab8>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,14 +19,14 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayMockPayloadGeneratorTest14Fragment$fragmentType: FragmentType; export type RelayMockPayloadGeneratorTest14Fragment$data = {| + +bigImage: ?{| + +uri: ?string, + |}, +id: string, +name: ?string, +smallImage: ?{| +uri: ?string, |}, - +bigImage: ?{| - +uri: ?string, - |}, +$fragmentType: RelayMockPayloadGeneratorTest14Fragment$fragmentType, |}; export type RelayMockPayloadGeneratorTest14Fragment$key = { diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest14Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest14Query.graphql.js index 247fa1f09df9c..4f64500b35fef 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest14Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest14Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -18,8 +18,8 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type RelayMockPayloadGeneratorTest14Fragment$fragmentType = any; export type RelayMockPayloadGeneratorTest14Query$variables = {| - smallScale?: ?number, bigScale?: ?number, + smallScale?: ?number, |}; export type RelayMockPayloadGeneratorTest14Query$data = {| +node: ?{| @@ -27,8 +27,8 @@ export type RelayMockPayloadGeneratorTest14Query$data = {| |}, |}; export type RelayMockPayloadGeneratorTest14Query = {| - variables: RelayMockPayloadGeneratorTest14Query$variables, response: RelayMockPayloadGeneratorTest14Query$data, + variables: RelayMockPayloadGeneratorTest14Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest15Fragment.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest15Fragment.graphql.js index 4d12e9789ab5b..fcc6becfdaa98 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest15Fragment.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest15Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -22,9 +22,9 @@ export type RelayMockPayloadGeneratorTest15Fragment$data = {| +id: string, +name?: ?string, +profile_picture: ?{| + +height: ?number, +uri: ?string, +width: ?number, - +height: ?number, |}, +$fragmentType: RelayMockPayloadGeneratorTest15Fragment$fragmentType, |}; diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest15Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest15Query.graphql.js index 6c2bafe822948..cf20950b8beb3 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest15Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest15Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<9c9728ec3160ad1ac8c2dcdd3add584e>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayMockPayloadGeneratorTest15Query$data = {| |}, |}; export type RelayMockPayloadGeneratorTest15Query = {| - variables: RelayMockPayloadGeneratorTest15Query$variables, response: RelayMockPayloadGeneratorTest15Query$data, + variables: RelayMockPayloadGeneratorTest15Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest16Fragment.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest16Fragment.graphql.js index ddab7f7d296b3..ab64c7540d735 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest16Fragment.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest16Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<12ff6a8c07ed8e9c1c8dbd60e63fac50>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayMockPayloadGeneratorTest16Fragment$fragmentType: FragmentType; export type RelayMockPayloadGeneratorTest16Fragment$data = $ReadOnlyArray<{| - +id: string, +body: ?{| +text: ?string, |}, + +id: string, +$fragmentType: RelayMockPayloadGeneratorTest16Fragment$fragmentType, |}>; export type RelayMockPayloadGeneratorTest16Fragment$key = $ReadOnlyArray<{ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest16Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest16Query.graphql.js index 62089d6e9ae72..d4dac2c764153 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest16Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest16Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayMockPayloadGeneratorTest16Query$data = {| |}>, |}; export type RelayMockPayloadGeneratorTest16Query = {| - variables: RelayMockPayloadGeneratorTest16Query$variables, response: RelayMockPayloadGeneratorTest16Query$data, + variables: RelayMockPayloadGeneratorTest16Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest17Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest17Query.graphql.js index 33de61986267b..2095ee033eac5 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest17Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest17Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<828a9eaf11630242cd7ab3fe95dfdb7a>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayMockPayloadGeneratorTest17Query$data = {| |}, |}; export type RelayMockPayloadGeneratorTest17Query = {| - variables: RelayMockPayloadGeneratorTest17Query$variables, response: RelayMockPayloadGeneratorTest17Query$data, + variables: RelayMockPayloadGeneratorTest17Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest18Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest18Query.graphql.js index 4d5f9a8a9a8e4..5c1ea68acf8fa 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest18Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest18Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -17,11 +17,11 @@ /*:: import type { ConcreteRequest, Query } from 'relay-runtime'; type RelayMockPayloadGeneratorTest22Fragment$fragmentType = any; -export type PhotoSize = "SMALL" | "LARGE" | "%future added value"; +export type PhotoSize = ("SMALL" | "LARGE" | "%future added value"); export type RelayMockPayloadGeneratorTest18Query$variables = {| + RELAY_INCREMENTAL_DELIVERY?: ?boolean, first?: ?number, picturePreset?: ?PhotoSize, - RELAY_INCREMENTAL_DELIVERY?: ?boolean, |}; export type RelayMockPayloadGeneratorTest18Query$data = {| +node: ?{| @@ -29,8 +29,8 @@ export type RelayMockPayloadGeneratorTest18Query$data = {| |}, |}; export type RelayMockPayloadGeneratorTest18Query = {| - variables: RelayMockPayloadGeneratorTest18Query$variables, response: RelayMockPayloadGeneratorTest18Query$data, + variables: RelayMockPayloadGeneratorTest18Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest19Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest19Query.graphql.js index f8810de58a912..607e894494e7f 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest19Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest19Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<2ac67989b6b60687decd9d50094e73d8>> + * @generated SignedSource<<8556164b68bfd70561f64525f58f55c0>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayMockPayloadGeneratorTest19Query$data = {| |}, |}; export type RelayMockPayloadGeneratorTest19Query = {| - variables: RelayMockPayloadGeneratorTest19Query$variables, response: RelayMockPayloadGeneratorTest19Query$data, + variables: RelayMockPayloadGeneratorTest19Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest1Fragment.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest1Fragment.graphql.js index fc130836c91be..12a64b795f9ec 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest1Fragment.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest1Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<8beb7c563d63b6e3223a1e0260d992bd>> + * @generated SignedSource<<07d080abf5a9c697db1f946b26164ea1>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayMockPayloadGeneratorTest1Fragment$fragmentType: FragmentType; export type RelayMockPayloadGeneratorTest1Fragment$data = {| - +id: string, - +name?: ?string, +firstName?: ?string, + +id: string, +lastName?: ?string, + +name?: ?string, +websites?: ?$ReadOnlyArray, +$fragmentType: RelayMockPayloadGeneratorTest1Fragment$fragmentType, |}; diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest1MarkdownUserNameRenderer_name.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest1MarkdownUserNameRenderer_name.graphql.js index 02c581068be17..1d2e003d0649f 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest1MarkdownUserNameRenderer_name.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest1MarkdownUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<4bae236848edfd3d58452e4dcb9f23a1>> + * @generated SignedSource<<3ab3c168550e45dfddab89458109a9ab>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayMockPayloadGeneratorTest1MarkdownUserNameRenderer_name$fragmentType: FragmentType; export type RelayMockPayloadGeneratorTest1MarkdownUserNameRenderer_name$data = {| - +markdown: ?string, +data: ?{| +markup: ?string, |}, + +markdown: ?string, +$fragmentType: RelayMockPayloadGeneratorTest1MarkdownUserNameRenderer_name$fragmentType, |}; export type RelayMockPayloadGeneratorTest1MarkdownUserNameRenderer_name$key = { diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest1PlainUserNameRenderer_name.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest1PlainUserNameRenderer_name.graphql.js index 5d64177bf44ed..723c4794d116e 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest1PlainUserNameRenderer_name.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest1PlainUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<5c89e688bc7c398b31101677150cf2b6>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayMockPayloadGeneratorTest1PlainUserNameRenderer_name$fragmentType: FragmentType; export type RelayMockPayloadGeneratorTest1PlainUserNameRenderer_name$data = {| - +plaintext: ?string, +data: ?{| +text: ?string, |}, + +plaintext: ?string, +$fragmentType: RelayMockPayloadGeneratorTest1PlainUserNameRenderer_name$fragmentType, |}; export type RelayMockPayloadGeneratorTest1PlainUserNameRenderer_name$key = { diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest1Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest1Query.graphql.js index 8fed03e6e0ba8..39b2fdbea7d82 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest1Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest1Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<7488a05d95fdcc843c9e4de00db63c46>> + * @generated SignedSource<<2d8812baa507fc792bc51e62c0d39e47>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayMockPayloadGeneratorTest1Query$data = {| |}, |}; export type RelayMockPayloadGeneratorTest1Query = {| - variables: RelayMockPayloadGeneratorTest1Query$variables, response: RelayMockPayloadGeneratorTest1Query$data, + variables: RelayMockPayloadGeneratorTest1Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest20Fragment.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest20Fragment.graphql.js index 3a93fe6274717..ada66a438ebe3 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest20Fragment.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest20Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<4de7eef1e8b87ffb3f09a44dcd3b6cc8>> + * @generated SignedSource<<537d22aef6e44f83a3d71780b8fb3637>> * @flow * @lightSyntaxTransform * @nogrep @@ -22,12 +22,12 @@ type RelayMockPayloadGeneratorTest19Fragment$fragmentType = any; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayMockPayloadGeneratorTest20Fragment$fragmentType: FragmentType; export type RelayMockPayloadGeneratorTest20Fragment$data = {| - +body: ?{| - +text: ?string, - |}, +actor: ?{| - +name: ?string, +id: string, + +name: ?string, + |}, + +body: ?{| + +text: ?string, |}, +myActor: ?{| +$fragmentSpreads: RelayMockPayloadGeneratorTest17Fragment$fragmentType, diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest20Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest20Query.graphql.js index 72de0ef6de663..4ce90b9a871ce 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest20Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest20Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<0c6e0b54006dcc3dc0892670e635dca5>> + * @generated SignedSource<<90b93c9edb8c03c3f9e425089a996011>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,19 +19,19 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; export type RelayMockPayloadGeneratorTest20Query$variables = {||}; export type RelayMockPayloadGeneratorTest20Query$data = {| +me: ?{| + +emailAddresses: ?$ReadOnlyArray, +id: string, +name: ?string, - +emailAddresses: ?$ReadOnlyArray, +profile_picture: ?{| + +height: ?number, +uri: ?string, +width: ?number, - +height: ?number, |}, |}, |}; export type RelayMockPayloadGeneratorTest20Query = {| - variables: RelayMockPayloadGeneratorTest20Query$variables, response: RelayMockPayloadGeneratorTest20Query$data, + variables: RelayMockPayloadGeneratorTest20Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest21Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest21Query.graphql.js index eccb0c8cd1454..c6d0882a6f744 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest21Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest21Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<40d7a2b8b2f2f5c97b1942f3f058e1ca>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayMockPayloadGeneratorTest21Query$data = {| |}, |}; export type RelayMockPayloadGeneratorTest21Query = {| - variables: RelayMockPayloadGeneratorTest21Query$variables, response: RelayMockPayloadGeneratorTest21Query$data, + variables: RelayMockPayloadGeneratorTest21Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest22Fragment.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest22Fragment.graphql.js index 038910e16ec91..31c6e529e789c 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest22Fragment.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest22Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<2ed9fd75f2614e648b3ab2ee3747633f>> * @flow * @lightSyntaxTransform * @nogrep @@ -21,11 +21,26 @@ type RelayMockPayloadGeneratorTest23Fragment$fragmentType = any; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayMockPayloadGeneratorTest22Fragment$fragmentType: FragmentType; export type RelayMockPayloadGeneratorTest22Fragment$data = {| - +id: string, - +name: ?string, - +myActor: ?{| - +id: string, - +name: ?string, + +actor: ?{| + +feedback?: ?{| + +comments: ?{| + +edges: ?$ReadOnlyArray, + |}, + |}, + +id?: string, + +name?: ?string, + +pageName?: ?string, + +profilePicture?: ?{| + +height: ?number, + +uri: ?string, + +width: ?number, + |}, + +userName?: ?string, + +username: ?string, |}, +customName: ?string, +friends: ?{| @@ -40,32 +55,17 @@ export type RelayMockPayloadGeneratorTest22Fragment$data = {| +hasNextPage: ?boolean, |}, |}, - +profile_picture: ?{| - +uri: ?string, + +id: string, + +myActor: ?{| + +id: string, + +name: ?string, |}, + +name: ?string, +profilePicture?: ?{| +uri: ?string, |}, - +actor: ?{| - +username: ?string, - +id?: string, - +userName?: ?string, - +name?: ?string, - +profilePicture?: ?{| - +uri: ?string, - +width: ?number, - +height: ?number, - |}, - +feedback?: ?{| - +comments: ?{| - +edges: ?$ReadOnlyArray, - |}, - |}, - +pageName?: ?string, + +profile_picture: ?{| + +uri: ?string, |}, +$fragmentSpreads: RelayMockPayloadGeneratorTest21Fragment$fragmentType, +$fragmentType: RelayMockPayloadGeneratorTest22Fragment$fragmentType, diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest22Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest22Query.graphql.js index 0ffb92cfa878e..7f62aed6315ad 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest22Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest22Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -16,18 +16,18 @@ /*:: import type { ConcreteRequest, Query } from 'relay-runtime'; -export type Environment = "WEB" | "MOBILE" | "%future added value"; +export type Environment = ("WEB" | "MOBILE" | "%future added value"); export type RelayMockPayloadGeneratorTest22Query$variables = {||}; export type RelayMockPayloadGeneratorTest22Query$data = {| +node: ?{| + +environment?: ?Environment, +id?: string, +name?: ?string, - +environment?: ?Environment, |}, |}; export type RelayMockPayloadGeneratorTest22Query = {| - variables: RelayMockPayloadGeneratorTest22Query$variables, response: RelayMockPayloadGeneratorTest22Query$data, + variables: RelayMockPayloadGeneratorTest22Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest23Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest23Query.graphql.js index 9acdd495489f5..62a79160f4146 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest23Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest23Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<3faaa41db6488fed65649fb8c1585cae>> + * @generated SignedSource<<10493c787872351945afe2dd29f51745>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayMockPayloadGeneratorTest23Query$data = {| |}, |}; export type RelayMockPayloadGeneratorTest23Query = {| - variables: RelayMockPayloadGeneratorTest23Query$variables, response: RelayMockPayloadGeneratorTest23Query$data, + variables: RelayMockPayloadGeneratorTest23Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest24Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest24Query.graphql.js index 04cc74de64f08..6a4fb7067728e 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest24Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest24Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<9f7e1ae31537119cda72c8df83ff391d>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayMockPayloadGeneratorTest24Query$data = {| |}, |}; export type RelayMockPayloadGeneratorTest24Query = {| - variables: RelayMockPayloadGeneratorTest24Query$variables, response: RelayMockPayloadGeneratorTest24Query$data, + variables: RelayMockPayloadGeneratorTest24Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest25Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest25Query.graphql.js index b9642dceb065a..fc22b75f1990b 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest25Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest25Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<0bf762945735dacd858fcc00c8c1d597>> + * @generated SignedSource<<34bdae6d3b7994055200d9340aa13fa0>> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type RelayMockPayloadGeneratorTest25Query$data = {| |}, |}; export type RelayMockPayloadGeneratorTest25Query = {| - variables: RelayMockPayloadGeneratorTest25Query$variables, response: RelayMockPayloadGeneratorTest25Query$data, + variables: RelayMockPayloadGeneratorTest25Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest26Fragment.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest26Fragment.graphql.js index b39bf1f710c2b..33d7775f230df 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest26Fragment.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest26Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<961dce13d56a1729ca0f9e872766da38>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,9 +19,9 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayMockPayloadGeneratorTest26Fragment$fragmentType: FragmentType; export type RelayMockPayloadGeneratorTest26Fragment$data = {| + +height: ?number, +uri: ?string, +width: ?number, - +height: ?number, +$fragmentType: RelayMockPayloadGeneratorTest26Fragment$fragmentType, |}; export type RelayMockPayloadGeneratorTest26Fragment$key = { diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest26Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest26Query.graphql.js index 70d78c62188f9..9fe10cf66d45f 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest26Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest26Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<6a67266cbce59a2f65b7c7ce8fddd8d1>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -25,8 +25,8 @@ export type RelayMockPayloadGeneratorTest26Query$data = {| |}, |}; export type RelayMockPayloadGeneratorTest26Query = {| - variables: RelayMockPayloadGeneratorTest26Query$variables, response: RelayMockPayloadGeneratorTest26Query$data, + variables: RelayMockPayloadGeneratorTest26Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest27Fragment.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest27Fragment.graphql.js index 83d01e99d0bca..acdb521d52e63 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest27Fragment.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest27Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<08575f1ecf4daab0066a3a1d6da0d835>> * @flow * @lightSyntaxTransform * @nogrep @@ -21,12 +21,12 @@ type RelayMockPayloadGeneratorTest25Fragment$fragmentType = any; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayMockPayloadGeneratorTest27Fragment$fragmentType: FragmentType; export type RelayMockPayloadGeneratorTest27Fragment$data = {| - +body: ?{| - +text: ?string, - |}, +actor: ?{| - +name: ?string, +id: string, + +name: ?string, + |}, + +body: ?{| + +text: ?string, |}, +myActor: ?{| +$fragmentSpreads: RelayMockPayloadGeneratorTest24Fragment$fragmentType, diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest27Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest27Query.graphql.js index e895be78aea03..de77903f804b8 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest27Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest27Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<6ab86aacaa8db900ecee7f96a3ec3aa5>> + * @generated SignedSource<<5a19eeec5678dc213b54f1218e112dcb>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayMockPayloadGeneratorTest27Query$data = {| |}, |}; export type RelayMockPayloadGeneratorTest27Query = {| - variables: RelayMockPayloadGeneratorTest27Query$variables, response: RelayMockPayloadGeneratorTest27Query$data, + variables: RelayMockPayloadGeneratorTest27Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest28Fragment.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest28Fragment.graphql.js index f692078c21c2e..f2ab21aa03a71 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest28Fragment.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest28Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<1ac270e2ab45df853227e2a9b7f39b35>> + * @generated SignedSource<<4e06e10bea4b4f466baa278eb78159ec>> * @flow * @lightSyntaxTransform * @nogrep @@ -22,9 +22,9 @@ export type RelayMockPayloadGeneratorTest28Fragment$data = {| +id: string, +name: ?string, +profile_picture: ?{| + +height: ?number, +uri: ?string, +width: ?number, - +height: ?number, |}, +$fragmentType: RelayMockPayloadGeneratorTest28Fragment$fragmentType, |}; diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest28Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest28Query.graphql.js index 174a4698ed977..ddc3b54e92eb4 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest28Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest28Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<41ec80094ecfd905cb54ac20bfc8858a>> + * @generated SignedSource<<6841ec2de919abfb7723a78f1333865d>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayMockPayloadGeneratorTest28Query$data = {| |}, |}; export type RelayMockPayloadGeneratorTest28Query = {| - variables: RelayMockPayloadGeneratorTest28Query$variables, response: RelayMockPayloadGeneratorTest28Query$data, + variables: RelayMockPayloadGeneratorTest28Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest29Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest29Query.graphql.js index ce474e14f2bb8..5eafc09fd203d 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest29Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest29Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,13 +19,13 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; export type RelayMockPayloadGeneratorTest29Query$variables = {||}; export type RelayMockPayloadGeneratorTest29Query$data = {| +node: ?{| - +id?: string, +emailAddresses?: ?$ReadOnlyArray, + +id?: string, |}, |}; export type RelayMockPayloadGeneratorTest29Query = {| - variables: RelayMockPayloadGeneratorTest29Query$variables, response: RelayMockPayloadGeneratorTest29Query$data, + variables: RelayMockPayloadGeneratorTest29Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest2Fragment.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest2Fragment.graphql.js index fd7a0cb45ee79..8183da141f5c9 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest2Fragment.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest2Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<48aba4bdf69b0afe750f78bfdeb28db6>> + * @generated SignedSource<<72bb21e10f6f5d6691e3e5d9bc86c832>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,22 +19,22 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayMockPayloadGeneratorTest2Fragment$fragmentType: FragmentType; export type RelayMockPayloadGeneratorTest2Fragment$data = {| - +id: string, - +name: ?string, +author: ?{| - +myId: string, - +myUsername: ?string, - +emailAddresses: ?$ReadOnlyArray, + +authorID?: string, +birthdate: ?{| +day: ?number, +month: ?number, +year: ?number, |}, + +emailAddresses: ?$ReadOnlyArray, +id?: string, + +myId: string, + +myUsername: ?string, +name?: ?string, - +authorID?: string, +username?: ?string, |}, + +id: string, + +name: ?string, +$fragmentType: RelayMockPayloadGeneratorTest2Fragment$fragmentType, |}; export type RelayMockPayloadGeneratorTest2Fragment$key = { diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest2Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest2Query.graphql.js index 13ee9c7d92e12..61d9337d1a9eb 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest2Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest2Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayMockPayloadGeneratorTest2Query$data = {| |}, |}; export type RelayMockPayloadGeneratorTest2Query = {| - variables: RelayMockPayloadGeneratorTest2Query$variables, response: RelayMockPayloadGeneratorTest2Query$data, + variables: RelayMockPayloadGeneratorTest2Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest30Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest30Query.graphql.js index 89fd4606daeb5..3dc4aaa91ee25 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest30Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest30Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<706bbd425ffd03bd42c430f455bdecfa>> + * @generated SignedSource<<2f7e0890c113e9e550cae336a579baef>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,13 +19,13 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; export type RelayMockPayloadGeneratorTest30Query$variables = {||}; export type RelayMockPayloadGeneratorTest30Query$data = {| +node: ?{| - +id?: string, +emailAddresses?: ?$ReadOnlyArray, + +id?: string, |}, |}; export type RelayMockPayloadGeneratorTest30Query = {| - variables: RelayMockPayloadGeneratorTest30Query$variables, response: RelayMockPayloadGeneratorTest30Query$data, + variables: RelayMockPayloadGeneratorTest30Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest31Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest31Query.graphql.js index 16e6d3f64ee35..8715bcef59581 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest31Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest31Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<121b1e1a3332d4136a267bb82f6af0a2>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,25 +19,25 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; export type RelayMockPayloadGeneratorTest31Query$variables = {||}; export type RelayMockPayloadGeneratorTest31Query$data = {| +node: ?{| - +id?: string, +friends?: ?{| +edges: ?$ReadOnlyArray, |}, + +id?: string, |}, |}; export type RelayMockPayloadGeneratorTest31Query = {| - variables: RelayMockPayloadGeneratorTest31Query$variables, response: RelayMockPayloadGeneratorTest31Query$data, + variables: RelayMockPayloadGeneratorTest31Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest32Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest32Query.graphql.js index eb5c9f2c826a6..b9449ee856660 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest32Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest32Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<52ca360ebb7a789df3686f3693d093f2>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,25 +19,25 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; export type RelayMockPayloadGeneratorTest32Query$variables = {||}; export type RelayMockPayloadGeneratorTest32Query$data = {| +node: ?{| - +id?: string, +friends?: ?{| +edges: ?$ReadOnlyArray, |}, + +id?: string, |}, |}; export type RelayMockPayloadGeneratorTest32Query = {| - variables: RelayMockPayloadGeneratorTest32Query$variables, response: RelayMockPayloadGeneratorTest32Query$data, + variables: RelayMockPayloadGeneratorTest32Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest33Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest33Query.graphql.js index e593850cdbc7d..b001c986f9c69 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest33Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest33Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<82ba0fa9907b17c6bf422bbb1e6dca5a>> + * @generated SignedSource<<16435f263046c42d49a0742d86cb2900>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,25 +19,25 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; export type RelayMockPayloadGeneratorTest33Query$variables = {||}; export type RelayMockPayloadGeneratorTest33Query$data = {| +node: ?{| - +id?: string, +friends?: ?{| +edges: ?$ReadOnlyArray, |}, + +id?: string, |}, |}; export type RelayMockPayloadGeneratorTest33Query = {| - variables: RelayMockPayloadGeneratorTest33Query$variables, response: RelayMockPayloadGeneratorTest33Query$data, + variables: RelayMockPayloadGeneratorTest33Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest34Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest34Query.graphql.js index e0e8f884f57e8..352539aa30fef 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest34Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest34Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<168b21e332077e54b8f8a9c0239b2e85>> + * @generated SignedSource<<83886d255e5431f19b2a0a5bbf44bfbb>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,25 +19,25 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; export type RelayMockPayloadGeneratorTest34Query$variables = {||}; export type RelayMockPayloadGeneratorTest34Query$data = {| +node: ?{| - +id?: string, +friends?: ?{| +edges: ?$ReadOnlyArray, |}, + +id?: string, |}, |}; export type RelayMockPayloadGeneratorTest34Query = {| - variables: RelayMockPayloadGeneratorTest34Query$variables, response: RelayMockPayloadGeneratorTest34Query$data, + variables: RelayMockPayloadGeneratorTest34Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest35Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest35Query.graphql.js index 18ee65ef15446..1c70d7b0ef08c 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest35Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest35Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,7 +19,6 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; export type RelayMockPayloadGeneratorTest35Query$variables = {||}; export type RelayMockPayloadGeneratorTest35Query$data = {| +node: ?{| - +id?: string, +friends?: ?{| +edges: ?$ReadOnlyArray, |}, + +id?: string, |}, |}; export type RelayMockPayloadGeneratorTest35Query = {| - variables: RelayMockPayloadGeneratorTest35Query$variables, response: RelayMockPayloadGeneratorTest35Query$data, + variables: RelayMockPayloadGeneratorTest35Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest36Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest36Query.graphql.js index ee58180c7ea02..979fe4f2c794c 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest36Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest36Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<4dfe01b08a44aad1c837663b74400e97>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,7 +19,6 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; export type RelayMockPayloadGeneratorTest36Query$variables = {||}; export type RelayMockPayloadGeneratorTest36Query$data = {| +node: ?{| - +id?: string, +friends?: ?{| +edges: ?$ReadOnlyArray, |}, + +id?: string, |}, |}; export type RelayMockPayloadGeneratorTest36Query = {| - variables: RelayMockPayloadGeneratorTest36Query$variables, response: RelayMockPayloadGeneratorTest36Query$data, + variables: RelayMockPayloadGeneratorTest36Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest37Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest37Query.graphql.js index 5406a0fdb8865..2d8a4112817d2 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest37Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest37Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<3e4c5937dd43ee25260f0378e33c5138>> + * @generated SignedSource<<87da96a9e50a8f4449eed003a2ced1de>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,7 +19,6 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; export type RelayMockPayloadGeneratorTest37Query$variables = {||}; export type RelayMockPayloadGeneratorTest37Query$data = {| +node: ?{| - +id?: string, +friends?: ?{| +edges: ?$ReadOnlyArray, |}, + +id?: string, |}, |}; export type RelayMockPayloadGeneratorTest37Query = {| - variables: RelayMockPayloadGeneratorTest37Query$variables, response: RelayMockPayloadGeneratorTest37Query$data, + variables: RelayMockPayloadGeneratorTest37Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest38Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest38Query.graphql.js index 8657d8c0e21c8..ceb6f279e3194 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest38Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest38Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<264e09d14bb2e3104076be989dc77826>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,13 +19,13 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; export type RelayMockPayloadGeneratorTest38Query$variables = {||}; export type RelayMockPayloadGeneratorTest38Query$data = {| +node: ?{| - +id?: string, +emailAddresses?: ?$ReadOnlyArray, + +id?: string, |}, |}; export type RelayMockPayloadGeneratorTest38Query = {| - variables: RelayMockPayloadGeneratorTest38Query$variables, response: RelayMockPayloadGeneratorTest38Query$data, + variables: RelayMockPayloadGeneratorTest38Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest39Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest39Query.graphql.js index 05e5a7ef72336..2a1f1612cafd7 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest39Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest39Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<030ccf4717fd23ececa274f15fe4f653>> * @flow * @lightSyntaxTransform * @nogrep @@ -16,17 +16,17 @@ /*:: import type { ConcreteRequest, Query } from 'relay-runtime'; -export type Environment = "WEB" | "MOBILE" | "%future added value"; +export type Environment = ("WEB" | "MOBILE" | "%future added value"); export type RelayMockPayloadGeneratorTest39Query$variables = {||}; export type RelayMockPayloadGeneratorTest39Query$data = {| +node: ?{| - +id?: string, +environment?: ?Environment, + +id?: string, |}, |}; export type RelayMockPayloadGeneratorTest39Query = {| - variables: RelayMockPayloadGeneratorTest39Query$variables, response: RelayMockPayloadGeneratorTest39Query$data, + variables: RelayMockPayloadGeneratorTest39Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest3Fragment.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest3Fragment.graphql.js index d1eabba13269b..0eb8d8070b1b3 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest3Fragment.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest3Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<1a9500572616b55c3a0d0c41fbf35ac2>> + * @generated SignedSource<<0d0b2382b0cd6be5889856b4d7079e74>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,31 +19,31 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayMockPayloadGeneratorTest3Fragment$fragmentType: FragmentType; export type RelayMockPayloadGeneratorTest3Fragment$data = {| - +id: string, - +name: ?string, - +customId: string, - +profile_picture?: ?{| - +uri: ?string, - |}, - +birthdate?: ?{| - +year: ?number, - +month?: ?number, - |}, - +author: ?{| - +authorID: string, - +objectType: string, - +username: ?string, - +name?: ?string, - |}, +allPhones: ?$ReadOnlyArray, - +emailAddresses: ?$ReadOnlyArray, + +author: ?{| + +authorID: string, + +name?: ?string, + +objectType: string, + +username: ?string, + |}, +backgroundImage: ?{| +uri: ?string, |}, + +birthdate?: ?{| + +month?: ?number, + +year: ?number, + |}, + +customId: string, + +emailAddresses: ?$ReadOnlyArray, + +id: string, + +name: ?string, + +profile_picture?: ?{| + +uri: ?string, + |}, +$fragmentType: RelayMockPayloadGeneratorTest3Fragment$fragmentType, |}; export type RelayMockPayloadGeneratorTest3Fragment$key = { diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest3MarkdownUserNameRenderer_name.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest3MarkdownUserNameRenderer_name.graphql.js index d02d7a9f07ea4..3d5ff458ab241 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest3MarkdownUserNameRenderer_name.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest3MarkdownUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<3d40ae7c637c8ad667caae1119a9600f>> + * @generated SignedSource<<662caacc073cd8ef7b49e8dff3c1178b>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayMockPayloadGeneratorTest3MarkdownUserNameRenderer_name$fragmentType: FragmentType; export type RelayMockPayloadGeneratorTest3MarkdownUserNameRenderer_name$data = {| - +markdown: ?string, +data: ?{| +markup: ?string, |}, + +markdown: ?string, +$fragmentType: RelayMockPayloadGeneratorTest3MarkdownUserNameRenderer_name$fragmentType, |}; export type RelayMockPayloadGeneratorTest3MarkdownUserNameRenderer_name$key = { diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest3PlainUserNameRenderer_name.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest3PlainUserNameRenderer_name.graphql.js index 4bcb25531e779..be864baaa49ac 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest3PlainUserNameRenderer_name.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest3PlainUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<1912a7862585dfd0a66ceaf4eb458eb0>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayMockPayloadGeneratorTest3PlainUserNameRenderer_name$fragmentType: FragmentType; export type RelayMockPayloadGeneratorTest3PlainUserNameRenderer_name$data = {| - +plaintext: ?string, +data: ?{| +text: ?string, |}, + +plaintext: ?string, +$fragmentType: RelayMockPayloadGeneratorTest3PlainUserNameRenderer_name$fragmentType, |}; export type RelayMockPayloadGeneratorTest3PlainUserNameRenderer_name$key = { diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest3Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest3Query.graphql.js index 8a8a0fae53d1e..2b2ef8a63b213 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest3Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest3Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<1fa15bfe295a3f3408fcd20cddce639f>> + * @generated SignedSource<<7674454b53ea6c2a4c51956b1b119fba>> * @flow * @lightSyntaxTransform * @nogrep @@ -26,8 +26,8 @@ export type RelayMockPayloadGeneratorTest3Query$data = {| |}, |}; export type RelayMockPayloadGeneratorTest3Query = {| - variables: RelayMockPayloadGeneratorTest3Query$variables, response: RelayMockPayloadGeneratorTest3Query$data, + variables: RelayMockPayloadGeneratorTest3Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest40Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest40Query.graphql.js index 2ec5da08d54ff..aac9e426ada2e 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest40Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest40Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<685485c70e9b8a961ec8878fb18c3d2b>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -16,7 +16,7 @@ /*:: import type { ConcreteRequest, Query } from 'relay-runtime'; -export type PersonalityTraits = "CHEERFUL" | "DERISIVE" | "HELPFUL" | "SNARKY" | "%future added value"; +export type PersonalityTraits = ("CHEERFUL" | "DERISIVE" | "HELPFUL" | "SNARKY" | "%future added value"); export type RelayMockPayloadGeneratorTest40Query$variables = {||}; export type RelayMockPayloadGeneratorTest40Query$data = {| +node: ?{| @@ -25,8 +25,8 @@ export type RelayMockPayloadGeneratorTest40Query$data = {| |}, |}; export type RelayMockPayloadGeneratorTest40Query = {| - variables: RelayMockPayloadGeneratorTest40Query$variables, response: RelayMockPayloadGeneratorTest40Query$data, + variables: RelayMockPayloadGeneratorTest40Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest41Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest41Query.graphql.js index 021e0bf2d7819..f2d552c5c480e 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest41Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest41Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -16,17 +16,17 @@ /*:: import type { ConcreteRequest, Query } from 'relay-runtime'; -export type Environment = "WEB" | "MOBILE" | "%future added value"; +export type Environment = ("WEB" | "MOBILE" | "%future added value"); export type RelayMockPayloadGeneratorTest41Query$variables = {||}; export type RelayMockPayloadGeneratorTest41Query$data = {| +node: ?{| - +id?: string, +environment?: ?Environment, + +id?: string, |}, |}; export type RelayMockPayloadGeneratorTest41Query = {| - variables: RelayMockPayloadGeneratorTest41Query$variables, response: RelayMockPayloadGeneratorTest41Query$data, + variables: RelayMockPayloadGeneratorTest41Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest42Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest42Query.graphql.js index 45b9f6d99749f..f25918c77a4f4 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest42Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest42Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<42c328fd26a01eade0d7ae5450d85997>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -16,17 +16,17 @@ /*:: import type { ConcreteRequest, Query } from 'relay-runtime'; -export type Environment = "WEB" | "MOBILE" | "%future added value"; +export type Environment = ("WEB" | "MOBILE" | "%future added value"); export type RelayMockPayloadGeneratorTest42Query$variables = {||}; export type RelayMockPayloadGeneratorTest42Query$data = {| +node: ?{| - +id?: string, +environment?: ?Environment, + +id?: string, |}, |}; export type RelayMockPayloadGeneratorTest42Query = {| - variables: RelayMockPayloadGeneratorTest42Query$variables, response: RelayMockPayloadGeneratorTest42Query$data, + variables: RelayMockPayloadGeneratorTest42Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest43Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest43Query.graphql.js index f91bf6145b75e..32294a9abe142 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest43Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest43Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<0f010571860932b7d39187f37f6133b0>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,14 +19,14 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; export type RelayMockPayloadGeneratorTest43Query$variables = {||}; export type RelayMockPayloadGeneratorTest43Query$data = {| +node: ?{| - +id?: string, - +client_name?: ?string, +client_code?: ?number, + +client_name?: ?string, + +id?: string, |}, |}; export type RelayMockPayloadGeneratorTest43Query = {| - variables: RelayMockPayloadGeneratorTest43Query$variables, response: RelayMockPayloadGeneratorTest43Query$data, + variables: RelayMockPayloadGeneratorTest43Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest44Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest44Query.graphql.js index 5a71453b3ea94..046fa76f5e537 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest44Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest44Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<0aa1862dc6bf6c8c54c44aa00022e248>> + * @generated SignedSource<<55fb68b2b0253aadd974714b9c2b5df9>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayMockPayloadGeneratorTest44Query$data = {| |}, |}; export type RelayMockPayloadGeneratorTest44Query = {| - variables: RelayMockPayloadGeneratorTest44Query$variables, response: RelayMockPayloadGeneratorTest44Query$data, + variables: RelayMockPayloadGeneratorTest44Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest45Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest45Query.graphql.js index 2caebca117558..27dda4406a3ce 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest45Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest45Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<083ec2d39e152f81f5830023275c5ca1>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayMockPayloadGeneratorTest45Query$data = {| |}, |}; export type RelayMockPayloadGeneratorTest45Query = {| - variables: RelayMockPayloadGeneratorTest45Query$variables, response: RelayMockPayloadGeneratorTest45Query$data, + variables: RelayMockPayloadGeneratorTest45Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest46Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest46Query.graphql.js index 9a35560ea4847..14dc08b7b425a 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest46Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest46Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<262344d149ff3affff0c82556f8cab7d>> + * @generated SignedSource<<0f030eb6d4750d18c66b70791a53039c>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayMockPayloadGeneratorTest46Query$data = {| |}, |}; export type RelayMockPayloadGeneratorTest46Query = {| - variables: RelayMockPayloadGeneratorTest46Query$variables, response: RelayMockPayloadGeneratorTest46Query$data, + variables: RelayMockPayloadGeneratorTest46Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest47Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest47Query.graphql.js index 91f300c1bdef5..133c6bc5fdf01 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest47Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest47Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<747017855368e93f8cb6eb1271386169>> + * @generated SignedSource<<59bb5a7d75471cdadfb3b7b6d1c4bff3>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayMockPayloadGeneratorTest47Query$data = {| |}, |}; export type RelayMockPayloadGeneratorTest47Query = {| - variables: RelayMockPayloadGeneratorTest47Query$variables, response: RelayMockPayloadGeneratorTest47Query$data, + variables: RelayMockPayloadGeneratorTest47Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest48Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest48Query.graphql.js index 3c0f110c215cb..0c206eb2765ea 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest48Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest48Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<693fb786280a65998a0b1b9a80f1bd27>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayMockPayloadGeneratorTest48Query$data = {| |}, |}; export type RelayMockPayloadGeneratorTest48Query = {| - variables: RelayMockPayloadGeneratorTest48Query$variables, response: RelayMockPayloadGeneratorTest48Query$data, + variables: RelayMockPayloadGeneratorTest48Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest4Fragment.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest4Fragment.graphql.js index 4c9fa7008e359..030f8c6ba7f88 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest4Fragment.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest4Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<24caf7acc94da4b75fa5fa0c77bc8fc4>> + * @generated SignedSource<<316fb96ce91d0da571a5ab5e0d8308ef>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,9 +19,9 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayMockPayloadGeneratorTest4Fragment$fragmentType: FragmentType; export type RelayMockPayloadGeneratorTest4Fragment$data = {| + +emailAddresses: ?$ReadOnlyArray, +name: ?string, +username: ?string, - +emailAddresses: ?$ReadOnlyArray, +$fragmentType: RelayMockPayloadGeneratorTest4Fragment$fragmentType, |}; export type RelayMockPayloadGeneratorTest4Fragment$key = { diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest4MarkdownUserNameRenderer_name.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest4MarkdownUserNameRenderer_name.graphql.js index cdb35dff6cba9..50213e68fe90f 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest4MarkdownUserNameRenderer_name.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest4MarkdownUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<487c0ccad83cbe05a5b40e3782fae319>> + * @generated SignedSource<<295fec8639777688b3ef8d46e5e8b9d4>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayMockPayloadGeneratorTest4MarkdownUserNameRenderer_name$fragmentType: FragmentType; export type RelayMockPayloadGeneratorTest4MarkdownUserNameRenderer_name$data = {| - +markdown: ?string, +data: ?{| +markup: ?string, |}, + +markdown: ?string, +$fragmentType: RelayMockPayloadGeneratorTest4MarkdownUserNameRenderer_name$fragmentType, |}; export type RelayMockPayloadGeneratorTest4MarkdownUserNameRenderer_name$key = { diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest4Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest4Query.graphql.js index 376f9bf7e9a50..a6e13f6915c23 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest4Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest4Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<0ef7683079a6153d59a0b5e15a7efcb2>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -18,10 +18,10 @@ import type { ConcreteRequest, Query } from 'relay-runtime'; type RelayMockPayloadGeneratorTest3Fragment$fragmentType = any; export type RelayMockPayloadGeneratorTest4Query$variables = {| - showProfilePicture: boolean, + hideAuthorUsername: boolean, hideBirthday: boolean, showBirthdayMonth: boolean, - hideAuthorUsername: boolean, + showProfilePicture: boolean, |}; export type RelayMockPayloadGeneratorTest4Query$data = {| +node: ?{| @@ -29,8 +29,8 @@ export type RelayMockPayloadGeneratorTest4Query$data = {| |}, |}; export type RelayMockPayloadGeneratorTest4Query = {| - variables: RelayMockPayloadGeneratorTest4Query$variables, response: RelayMockPayloadGeneratorTest4Query$data, + variables: RelayMockPayloadGeneratorTest4Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest5Fragment.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest5Fragment.graphql.js index ca59a3d91e55b..d45b7a20b2f24 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest5Fragment.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest5Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<8998c61026fa1456116761588be00076>> + * @generated SignedSource<<186e7807759a8428676abb55464b1893>> * @flow * @lightSyntaxTransform * @nogrep @@ -21,10 +21,6 @@ import type { FragmentType } from "relay-runtime"; declare export opaque type RelayMockPayloadGeneratorTest5Fragment$fragmentType: FragmentType; export type RelayMockPayloadGeneratorTest5Fragment$data = {| +actor: ?({| - +id: string, - +myType: "User", - +myName: ?string, - +name: ?string, +friends: ?{| +edges: ?$ReadOnlyArray, |}, + +id: string, + +myName: ?string, + +myType: "User", + +name: ?string, +$fragmentSpreads: RelayMockPayloadGeneratorTest4Fragment$fragmentType, |} | {| // This will never be '%other', but we need some diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest5MarkdownUserNameRenderer_name.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest5MarkdownUserNameRenderer_name.graphql.js index 16225dd69f91b..16ea3dc15a843 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest5MarkdownUserNameRenderer_name.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest5MarkdownUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<2202f788db3f7092823ec749bcb64f25>> + * @generated SignedSource<<483b22ce81d184dcaf705576a529a845>> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayMockPayloadGeneratorTest5MarkdownUserNameRenderer_name$fragmentType: FragmentType; export type RelayMockPayloadGeneratorTest5MarkdownUserNameRenderer_name$data = {| - +markdown: ?string, +data: ?{| +markup: ?string, |}, + +markdown: ?string, +$fragmentType: RelayMockPayloadGeneratorTest5MarkdownUserNameRenderer_name$fragmentType, |}; export type RelayMockPayloadGeneratorTest5MarkdownUserNameRenderer_name$key = { diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest5Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest5Query.graphql.js index b33164326ac3d..4121c01b506b0 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest5Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest5Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<24b28a1ca0c67677f7ee5d4841856103>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -27,8 +27,8 @@ export type RelayMockPayloadGeneratorTest5Query$data = {| |}, |}; export type RelayMockPayloadGeneratorTest5Query = {| - variables: RelayMockPayloadGeneratorTest5Query$variables, response: RelayMockPayloadGeneratorTest5Query$data, + variables: RelayMockPayloadGeneratorTest5Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest6Fragment.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest6Fragment.graphql.js index 1e272262852bb..f835d05f04dd3 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest6Fragment.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest6Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<99287302159356696c84172db29b7c84>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,12 +19,12 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayMockPayloadGeneratorTest6Fragment$fragmentType: FragmentType; export type RelayMockPayloadGeneratorTest6Fragment$data = {| - +id: string, - +name: ?string, +author: ?{| +id: string, +name: ?string, |}, + +id: string, + +name: ?string, +$fragmentType: RelayMockPayloadGeneratorTest6Fragment$fragmentType, |}; export type RelayMockPayloadGeneratorTest6Fragment$key = { diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest6Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest6Query.graphql.js index a5bb559e0d8c5..66988004564de 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest6Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest6Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<54ad1b9214b67a303ef34f92de110e7d>> + * @generated SignedSource<<8ffbf9e5264dfab278cdcdcbf8fd1c8a>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayMockPayloadGeneratorTest6Query$data = {| |}, |}; export type RelayMockPayloadGeneratorTest6Query = {| - variables: RelayMockPayloadGeneratorTest6Query$variables, response: RelayMockPayloadGeneratorTest6Query$data, + variables: RelayMockPayloadGeneratorTest6Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest7Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest7Query.graphql.js index f646aa38ba28c..a1db0525358b9 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest7Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest7Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<72f1226edc17f1fe15df27f62ad209c9>> + * @generated SignedSource<<46f4a4c71cfff9b6dcd3d2d3e5fb9afb>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayMockPayloadGeneratorTest7Query$data = {| |}, |}; export type RelayMockPayloadGeneratorTest7Query = {| - variables: RelayMockPayloadGeneratorTest7Query$variables, response: RelayMockPayloadGeneratorTest7Query$data, + variables: RelayMockPayloadGeneratorTest7Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest8Fragment.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest8Fragment.graphql.js index 9e0b37f77099f..e04fa4a818466 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest8Fragment.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest8Fragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<509370672f46d5b125fd82c792750413>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayMockPayloadGeneratorTest8Fragment$data = {| +name: ?string, |}, +backgroundImage: ?{| - +width: ?number, +uri: ?string, + +width: ?number, |}, +$fragmentType: RelayMockPayloadGeneratorTest8Fragment$fragmentType, |}; diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest8Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest8Query.graphql.js index 6b2bb9cad8d3a..12327638baef8 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest8Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest8Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<95fe1489806bba77033ebc4cc69cb596>> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayMockPayloadGeneratorTest8Query$data = {| |}, |}; export type RelayMockPayloadGeneratorTest8Query = {| - variables: RelayMockPayloadGeneratorTest8Query$variables, response: RelayMockPayloadGeneratorTest8Query$data, + variables: RelayMockPayloadGeneratorTest8Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest9Query.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest9Query.graphql.js index c70250a82463c..ac6c18872924e 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest9Query.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTest9Query.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<992898650fa6700ba80f62fa5a85371f>> + * @generated SignedSource<<9b0823478ec7945e117cfca9040f1c5e>> * @flow * @lightSyntaxTransform * @nogrep @@ -24,8 +24,8 @@ export type RelayMockPayloadGeneratorTest9Query$data = {| |}, |}; export type RelayMockPayloadGeneratorTest9Query = {| - variables: RelayMockPayloadGeneratorTest9Query$variables, response: RelayMockPayloadGeneratorTest9Query$data, + variables: RelayMockPayloadGeneratorTest9Query$variables, |}; */ diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTestFragment.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTestFragment.graphql.js index fbe981370ff75..58ede2a4ed4b4 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTestFragment.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTestFragment.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<310a3805b5ee180f1362e1f1234d94ff>> + * @generated SignedSource<<7577963960d02ba23a1c50ad4a7ec7ef>> * @flow * @lightSyntaxTransform * @nogrep @@ -22,9 +22,9 @@ export type RelayMockPayloadGeneratorTestFragment$data = {| +id: string, +name: ?string, +profile_picture: ?{| + +height: ?number, +uri: ?string, +width: ?number, - +height: ?number, |}, +$fragmentType: RelayMockPayloadGeneratorTestFragment$fragmentType, |}; diff --git a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTestMarkdownUserNameRenderer_name.graphql.js b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTestMarkdownUserNameRenderer_name.graphql.js index 421e6afa38799..e39dc91dea389 100644 --- a/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTestMarkdownUserNameRenderer_name.graphql.js +++ b/packages/relay-test-utils/__tests__/__generated__/RelayMockPayloadGeneratorTestMarkdownUserNameRenderer_name.graphql.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow * @lightSyntaxTransform * @nogrep @@ -19,10 +19,10 @@ import type { Fragment, ReaderFragment } from 'relay-runtime'; import type { FragmentType } from "relay-runtime"; declare export opaque type RelayMockPayloadGeneratorTestMarkdownUserNameRenderer_name$fragmentType: FragmentType; export type RelayMockPayloadGeneratorTestMarkdownUserNameRenderer_name$data = {| - +markdown: ?string, +data: ?{| +markup: ?string, |}, + +markdown: ?string, +$fragmentType: RelayMockPayloadGeneratorTestMarkdownUserNameRenderer_name$fragmentType, |}; export type RelayMockPayloadGeneratorTestMarkdownUserNameRenderer_name$key = { From e4e4c92bc975c4b099977aad676fd3f521048e69 Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Sat, 26 Feb 2022 18:43:13 +0100 Subject: [PATCH 36/41] Sort enum members. --- compiler/crates/relay-typegen/src/lib.rs | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/compiler/crates/relay-typegen/src/lib.rs b/compiler/crates/relay-typegen/src/lib.rs index 8d694d88f2e66..74de13150c158 100644 --- a/compiler/crates/relay-typegen/src/lib.rs +++ b/compiler/crates/relay-typegen/src/lib.rs @@ -1478,18 +1478,29 @@ impl<'a> TypeGenerator<'a> { &format!("{}{}", enum_type.name, enum_module_suffix), )?; } else { - let mut members: Vec = enum_type + let mut members: Vec<_> = enum_type .values .iter() - .map(|enum_value| AST::StringLiteral(enum_value.value)) + .map(|enum_value| enum_value.value) .collect(); + if self.should_sort_typegen_items { + members.sort(); + } + if !self.typegen_config.flow_typegen.no_future_proof_enums { - members.push(AST::StringLiteral(*FUTURE_ENUM_VALUE)); + members.push(*FUTURE_ENUM_VALUE); } - self.writer - .write_export_type(enum_type.name.lookup(), &AST::Union(members))?; + self.writer.write_export_type( + enum_type.name.lookup(), + &AST::Union( + members + .into_iter() + .map(|key| AST::StringLiteral(key)) + .collect(), + ), + )?; } } Ok(()) From c671d16b7a547ce28c82d135618fe8c5398aaae5 Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Sat, 26 Feb 2022 18:44:07 +0100 Subject: [PATCH 37/41] Sort fragment refs. --- compiler/crates/relay-typegen/src/lib.rs | 79 +++++++++++-------- .../fixtures/match-field-in-query.expected | 2 +- .../fixtures/match-field.expected | 2 +- .../query-mixed-provided-variables.expected | 2 +- .../query-only-provided-variables.expected | 2 +- .../fixtures/query-with-match-fields.expected | 2 +- .../query-with-multiple-match-fields.expected | 4 +- .../fixtures/match-field-in-query.expected | 2 +- .../fixtures/match-field.expected | 2 +- .../fixtures/query-with-match-fields.expected | 2 +- .../query-with-multiple-match-fields.expected | 4 +- 11 files changed, 58 insertions(+), 45 deletions(-) diff --git a/compiler/crates/relay-typegen/src/lib.rs b/compiler/crates/relay-typegen/src/lib.rs index 74de13150c158..2ffd072c30c6f 100644 --- a/compiler/crates/relay-typegen/src/lib.rs +++ b/compiler/crates/relay-typegen/src/lib.rs @@ -897,16 +897,19 @@ impl<'a> TypeGenerator<'a> { let mut typename_aliases = IndexSet::new(); for (concrete_type, selections) in by_concrete_type { types.push( - group_refs(base_fields.values().cloned().chain(selections)) - .map(|selection| { - if selection.is_typename() { - typename_aliases.insert(selection.get_field_name_or_alias().expect( + group_refs( + base_fields.values().cloned().chain(selections), + self.should_sort_typegen_items, + ) + .map(|selection| { + if selection.is_typename() { + typename_aliases.insert(selection.get_field_name_or_alias().expect( "Just checked this exists by checking that the field is typename", )); - } - self.make_prop(selection, unmasked, Some(concrete_type)) - }) - .collect(), + } + self.make_prop(selection, unmasked, Some(concrete_type)) + }) + .collect(), ); } @@ -941,35 +944,38 @@ impl<'a> TypeGenerator<'a> { true, ); } - let selection_map_values = group_refs(hashmap_into_values(selection_map)) - .map(|sel| { - if let TypeSelection::ScalarField(ref scalar_field) = sel { - if sel.is_typename() { - if let Some(type_condition) = scalar_field.concrete_type { - let mut scalar_field = scalar_field.clone(); - scalar_field.conditional = false; - return self.make_prop( - TypeSelection::ScalarField(scalar_field), - unmasked, - Some(type_condition), - ); - } - } - } else if let TypeSelection::LinkedField(ref linked_field) = sel { - if let Some(concrete_type) = linked_field.concrete_type { - let mut linked_field = linked_field.clone(); - linked_field.concrete_type = None; + let selection_map_values = group_refs( + hashmap_into_values(selection_map), + self.should_sort_typegen_items, + ) + .map(|sel| { + if let TypeSelection::ScalarField(ref scalar_field) = sel { + if sel.is_typename() { + if let Some(type_condition) = scalar_field.concrete_type { + let mut scalar_field = scalar_field.clone(); + scalar_field.conditional = false; return self.make_prop( - TypeSelection::LinkedField(linked_field), + TypeSelection::ScalarField(scalar_field), unmasked, - Some(concrete_type), + Some(type_condition), ); } } + } else if let TypeSelection::LinkedField(ref linked_field) = sel { + if let Some(concrete_type) = linked_field.concrete_type { + let mut linked_field = linked_field.clone(); + linked_field.concrete_type = None; + return self.make_prop( + TypeSelection::LinkedField(linked_field), + unmasked, + Some(concrete_type), + ); + } + } - self.make_prop(sel, unmasked, None) - }) - .collect(); + self.make_prop(sel, unmasked, None) + }) + .collect(); types.push(selection_map_values); } @@ -2161,7 +2167,10 @@ fn selections_to_map( // TODO: T85950736 Fix these clippy errors #[allow(clippy::while_let_on_iterator, clippy::useless_conversion)] -fn group_refs(props: impl Iterator) -> impl Iterator { +fn group_refs( + props: impl Iterator, + should_sort_typegen_items: bool, +) -> impl Iterator { let mut fragment_spreads = None; let mut props = props.into_iter(); std::iter::from_fn(move || { @@ -2178,7 +2187,11 @@ fn group_refs(props: impl Iterator) -> impl Iterator; + readonly " $fragmentSpreads": FragmentRefs<("MarkdownUserNameRenderer_name" | "PlainUserNameRenderer_name")>; } | null); } | null); }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected index 8e49d22de0f1c..c00a5686df05b 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected @@ -41,7 +41,7 @@ export type NameRendererFragment$data = { readonly nameRenderer: ({ readonly __fragmentPropName?: (string | null); readonly __module_component?: (string | null); - readonly " $fragmentSpreads": FragmentRefs<("PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name")>; + readonly " $fragmentSpreads": FragmentRefs<("MarkdownUserNameRenderer_name" | "PlainUserNameRenderer_name")>; } | null); readonly " $fragmentType": "NameRendererFragment"; }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected index eea58fa116b5f..375dea70eca9c 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected @@ -98,7 +98,7 @@ export type NameRendererFragment$data = { readonly nameRenderer: ({ readonly __fragmentPropName?: (string | null); readonly __module_component?: (string | null); - readonly " $fragmentSpreads": FragmentRefs<("PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name")>; + readonly " $fragmentSpreads": FragmentRefs<("MarkdownUserNameRenderer_name" | "PlainUserNameRenderer_name")>; } | null); readonly " $fragmentType": "NameRendererFragment"; }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected index a212ffd501ca6..532483808c69a 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected @@ -138,7 +138,7 @@ export type AnotherNameRendererFragment$data = { readonly nameRenderer: ({ readonly __fragmentPropName?: (string | null); readonly __module_component?: (string | null); - readonly " $fragmentSpreads": FragmentRefs<("PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name")>; + readonly " $fragmentSpreads": FragmentRefs<("MarkdownUserNameRenderer_name" | "PlainUserNameRenderer_name")>; } | null); readonly " $fragmentType": "AnotherNameRendererFragment"; }; @@ -166,7 +166,7 @@ export type NameRendererFragment$data = { readonly nameRenderer: ({ readonly __fragmentPropName?: (string | null); readonly __module_component?: (string | null); - readonly " $fragmentSpreads": FragmentRefs<("PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name")>; + readonly " $fragmentSpreads": FragmentRefs<("MarkdownUserNameRenderer_name" | "PlainUserNameRenderer_name")>; } | null); readonly " $fragmentType": "NameRendererFragment"; }; From 6f4e49f92918cf8602a11aa4bff395369a272796 Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Sat, 26 Feb 2022 22:14:28 +0100 Subject: [PATCH 38/41] Only wrap unions & intersections if needed. --- compiler/crates/relay-typegen/src/flow.rs | 110 +++++++++------ .../crates/relay-typegen/src/typescript.rs | 125 +++++++++++------- .../fixtures/fragment-spread.expected | 16 +-- .../fixtures/inline-fragment.expected | 4 +- .../mutation-with-enums-on-fragment.expected | 4 +- ...aw_response_and_client_components.expected | 8 +- .../fixtures/scalar-field.expected | 2 +- .../fixtures/typename-on-union.expected | 16 +-- .../fixtures/fragment-spread.expected | 34 ++--- .../fixtures/inline-fragment.expected | 44 +++--- .../fixtures/linked-field.expected | 28 ++-- .../fixtures/match-field-in-query.expected | 30 ++--- .../fixtures/match-field.expected | 26 ++-- .../mutation-input-has-array.expected | 26 ++-- .../mutation-with-client-extension.expected | 34 ++--- .../mutation-with-enums-on-fragment.expected | 78 +++++------ .../mutation-with-nested-fragments.expected | 76 +++++------ ...with-response-on-inline-fragments.expected | 66 ++++----- .../fixtures/mutation.expected | 30 ++--- .../fixtures/query-with-handles.expected | 32 ++--- .../fixtures/query-with-match-fields.expected | 66 ++++----- .../fixtures/query-with-module-field.expected | 36 ++--- .../query-with-multiple-match-fields.expected | 114 ++++++++-------- ...-with-raw-response-on-conditional.expected | 28 ++-- ...w-response-on-literal-conditional.expected | 28 ++-- .../query-with-stream-connection.expected | 58 ++++---- .../fixtures/query-with-stream.expected | 46 +++---- .../fixtures/refetchable-fragment.expected | 10 +- .../fixtures/refetchable.expected | 6 +- .../fixtures/relay-client-id-field.expected | 18 +-- ...ough-inline-fragments-to-fragment.expected | 4 +- .../required-bubbles-to-fragment.expected | 6 +- ...d-bubbles-to-item-in-plural-field.expected | 8 +- .../required-bubbles-to-query.expected | 6 +- ...d-bubbles-up-to-mutation-response.expected | 14 +- ...solates-concrete-inline-fragments.expected | 20 +-- .../required-raw-response-type.expected | 10 +- ...-throw-doesnt-bubbles-to-fragment.expected | 2 +- ...red-throw-doesnt-bubbles-to-query.expected | 4 +- .../fixtures/required-throws-nested.expected | 6 +- .../fixtures/required.expected | 6 +- .../fixtures/roots.expected | 36 ++--- .../fixtures/scalar-field.expected | 22 +-- .../fixtures/simple.expected | 12 +- ...me-inside-with-overlapping-fields.expected | 14 +- .../fixtures/typename-on-union.expected | 54 ++++---- .../unmasked-fragment-spreads.expected | 22 +-- 47 files changed, 750 insertions(+), 695 deletions(-) diff --git a/compiler/crates/relay-typegen/src/flow.rs b/compiler/crates/relay-typegen/src/flow.rs index 1f1e645449e01..c571b7ab38776 100644 --- a/compiler/crates/relay-typegen/src/flow.rs +++ b/compiler/crates/relay-typegen/src/flow.rs @@ -32,35 +32,7 @@ impl Writer for FlowPrinter { } fn write(&mut self, ast: &AST) -> FmtResult { - match ast { - AST::Any => write!(&mut self.result, "any"), - AST::String => write!(&mut self.result, "string"), - AST::StringLiteral(literal) => self.write_string_literal(*literal), - AST::OtherTypename => self.write_other_string(), - AST::Number => write!(&mut self.result, "number"), - AST::Boolean => write!(&mut self.result, "boolean"), - AST::Callable(return_type) => self.write_callable(&*return_type), - AST::Identifier(identifier) => write!(&mut self.result, "{}", identifier), - AST::RawType(raw) => write!(&mut self.result, "{}", raw), - AST::Union(members) => self.write_union(members), - AST::Intersection(members) => self.write_intersection(members), - AST::ReadOnlyArray(of_type) => self.write_read_only_array(of_type), - AST::Nullable(of_type) => self.write_nullable(of_type), - AST::NonNullable(of_type) => self.write_non_nullable(of_type), - AST::ExactObject(props) => self.write_object(props, true), - AST::InexactObject(props) => self.write_object(props, false), - AST::Local3DPayload(document_name, selections) => { - self.write_local_3d_payload(*document_name, selections) - } - AST::FragmentReference(fragments) => self.write_fragment_references(fragments), - AST::FragmentReferenceType(fragment) => { - write!(&mut self.result, "{}$fragmentType", fragment) - } - AST::ReturnTypeOfFunctionWithName(function_name) => { - self.write_return_type_of_function_with_name(*function_name) - } - AST::ActorChangePoint(selections) => self.write_actor_change_point(selections), - } + self.write_ast(ast, true) } fn get_runtime_fragment_import(&self) -> &'static str { @@ -69,13 +41,13 @@ impl Writer for FlowPrinter { fn write_local_type(&mut self, name: &str, value: &AST) -> FmtResult { write!(&mut self.result, "type {} = ", name)?; - self.write(value)?; + self.write_ast(value, false)?; writeln!(&mut self.result, ";") } fn write_export_type(&mut self, name: &str, value: &AST) -> FmtResult { write!(&mut self.result, "export type {} = ", name)?; - self.write(value)?; + self.write_ast(value, false)?; writeln!(&mut self.result, ";") } @@ -145,6 +117,38 @@ impl FlowPrinter { } } + fn write_ast(&mut self, ast: &AST, wrapping_required: bool) -> FmtResult { + match ast { + AST::Any => write!(&mut self.result, "any"), + AST::String => write!(&mut self.result, "string"), + AST::StringLiteral(literal) => self.write_string_literal(*literal), + AST::OtherTypename => self.write_other_string(), + AST::Number => write!(&mut self.result, "number"), + AST::Boolean => write!(&mut self.result, "boolean"), + AST::Callable(return_type) => self.write_callable(&*return_type), + AST::Identifier(identifier) => write!(&mut self.result, "{}", identifier), + AST::RawType(raw) => write!(&mut self.result, "{}", raw), + AST::Union(members) => self.write_union(members, wrapping_required), + AST::Intersection(members) => self.write_intersection(members, wrapping_required), + AST::ReadOnlyArray(of_type) => self.write_read_only_array(of_type), + AST::Nullable(of_type) => self.write_nullable(of_type), + AST::NonNullable(of_type) => self.write_non_nullable(of_type), + AST::ExactObject(props) => self.write_object(props, true), + AST::InexactObject(props) => self.write_object(props, false), + AST::Local3DPayload(document_name, selections) => { + self.write_local_3d_payload(*document_name, selections) + } + AST::FragmentReference(fragments) => self.write_fragment_references(fragments), + AST::FragmentReferenceType(fragment) => { + write!(&mut self.result, "{}$fragmentType", fragment) + } + AST::ReturnTypeOfFunctionWithName(function_name) => { + self.write_return_type_of_function_with_name(*function_name) + } + AST::ActorChangePoint(selections) => self.write_actor_change_point(selections), + } + } + fn write_indentation(&mut self) -> FmtResult { self.result.write_str(&" ".repeat(self.indentation)) } @@ -157,8 +161,8 @@ impl FlowPrinter { write!(&mut self.result, r#""%other""#) } - fn write_union(&mut self, members: &[AST]) -> FmtResult { - if members.len() > 1 && self.should_wrap_unions_in_parentheses { + fn write_union(&mut self, members: &[AST], wrapping_required: bool) -> FmtResult { + if members.len() > 1 && self.should_wrap_unions_in_parentheses && wrapping_required { write!(&mut self.result, "(")?; } let mut first = true; @@ -170,14 +174,14 @@ impl FlowPrinter { } self.write(member)?; } - if members.len() > 1 && self.should_wrap_unions_in_parentheses { + if members.len() > 1 && self.should_wrap_unions_in_parentheses && wrapping_required { write!(&mut self.result, ")")?; } Ok(()) } - fn write_intersection(&mut self, members: &[AST]) -> FmtResult { - if members.len() > 1 { + fn write_intersection(&mut self, members: &[AST], wrapping_required: bool) -> FmtResult { + if members.len() > 1 && wrapping_required { write!(&mut self.result, "(")?; } let mut first = true; @@ -189,7 +193,7 @@ impl FlowPrinter { } self.write(member)?; } - if members.len() > 1 { + if members.len() > 1 && wrapping_required { write!(&mut self.result, ")")?; } Ok(()) @@ -210,13 +214,13 @@ impl FlowPrinter { fn write_read_only_array(&mut self, of_type: &AST) -> FmtResult { write!(&mut self.result, "$ReadOnlyArray<")?; - self.write(of_type)?; + self.write_ast(of_type, false)?; write!(&mut self.result, ">") } fn write_non_nullable(&mut self, of_type: &AST) -> FmtResult { write!(&mut self.result, "$NonMaybeType<")?; - self.write(of_type)?; + self.write_ast(of_type, false)?; write!(&mut self.result, ">") } @@ -268,7 +272,7 @@ impl FlowPrinter { write!(&mut self.result, "?")?; } write!(&mut self.result, ": ")?; - self.write(&key_value_pair.value)?; + self.write_ast(&key_value_pair.value, false)?; writeln!(&mut self.result, ",")?; } Prop::GetterSetterPair(getter_setter_pair) => { @@ -305,7 +309,7 @@ impl FlowPrinter { fn write_local_3d_payload(&mut self, document_name: StringKey, selections: &AST) -> FmtResult { write!(&mut self.result, "Local3DPayload<\"{}\", ", document_name)?; - self.write(selections)?; + self.write_ast(selections, false)?; write!(&mut self.result, ">")?; Ok(()) } @@ -320,7 +324,7 @@ impl FlowPrinter { fn write_actor_change_point(&mut self, selections: &AST) -> FmtResult { write!(&mut self.result, "ActorChangePoint<")?; - self.write(selections)?; + self.write_ast(selections, false)?; write!(&mut self.result, ">")?; Ok(()) } @@ -383,6 +387,28 @@ mod tests { ) } + #[test] + fn wrapping() { + assert_eq!( + print_type(&AST::ExactObject(ExactObject::new( + vec![Prop::KeyValuePair(KeyValuePairProp { + key: "key".intern(), + optional: false, + read_only: false, + value: AST::Intersection(vec![ + AST::Union(vec![AST::String, AST::Number]), + AST::Boolean + ]) + })], + true + ))), + r"{| + key: (string | number) & boolean, +|}" + .to_string() + ); + } + #[test] fn exact_object() { assert_eq!( diff --git a/compiler/crates/relay-typegen/src/typescript.rs b/compiler/crates/relay-typegen/src/typescript.rs index 209931332e175..1c4b2552d9b8d 100644 --- a/compiler/crates/relay-typegen/src/typescript.rs +++ b/compiler/crates/relay-typegen/src/typescript.rs @@ -35,44 +35,18 @@ impl Writer for TypeScriptPrinter { } fn write(&mut self, ast: &AST) -> FmtResult { - match ast { - AST::Any => write!(&mut self.result, "any"), - AST::String => write!(&mut self.result, "string"), - AST::StringLiteral(literal) => self.write_string_literal(*literal), - AST::OtherTypename => self.write_other_string(), - AST::Number => write!(&mut self.result, "number"), - AST::Boolean => write!(&mut self.result, "boolean"), - AST::Callable(return_type) => self.write_callable(&*return_type), - AST::Identifier(identifier) => write!(&mut self.result, "{}", identifier), - AST::RawType(raw) => write!(&mut self.result, "{}", raw), - AST::Union(members) => self.write_union(members), - AST::Intersection(members) => self.write_intersection(members), - AST::ReadOnlyArray(of_type) => self.write_read_only_array(of_type), - AST::Nullable(of_type) => self.write_nullable(of_type), - AST::NonNullable(of_type) => self.write_non_nullable(of_type), - AST::ExactObject(object) => self.write_object(object), - AST::InexactObject(object) => self.write_object(object), - AST::Local3DPayload(document_name, selections) => { - self.write_local_3d_payload(*document_name, selections) - } - AST::FragmentReference(fragments) => self.write_fragment_references(fragments), - AST::FragmentReferenceType(fragment) => self.write_fragment_references_type(*fragment), - AST::ReturnTypeOfFunctionWithName(function_name) => { - self.write_return_type_of_function_with_name(*function_name) - } - AST::ActorChangePoint(_) => panic!("Not supported yet"), - } + self.write_ast(ast, true) } fn write_local_type(&mut self, name: &str, value: &AST) -> FmtResult { write!(&mut self.result, "type {} = ", name)?; - self.write(value)?; + self.write_ast(value, false)?; writeln!(&mut self.result, ";") } fn write_export_type(&mut self, name: &str, value: &AST) -> FmtResult { write!(&mut self.result, "export type {} = ", name)?; - self.write(value)?; + self.write_ast(value, false)?; writeln!(&mut self.result, ";") } @@ -127,6 +101,36 @@ impl TypeScriptPrinter { } } + fn write_ast(&mut self, ast: &AST, wrapping_required: bool) -> FmtResult { + match ast { + AST::Any => write!(&mut self.result, "any"), + AST::String => write!(&mut self.result, "string"), + AST::StringLiteral(literal) => self.write_string_literal(*literal), + AST::OtherTypename => self.write_other_string(), + AST::Number => write!(&mut self.result, "number"), + AST::Boolean => write!(&mut self.result, "boolean"), + AST::Callable(return_type) => self.write_callable(&*return_type), + AST::Identifier(identifier) => write!(&mut self.result, "{}", identifier), + AST::RawType(raw) => write!(&mut self.result, "{}", raw), + AST::Union(members) => self.write_union(members, wrapping_required), + AST::Intersection(members) => self.write_intersection(members, wrapping_required), + AST::ReadOnlyArray(of_type) => self.write_read_only_array(of_type), + AST::Nullable(of_type) => self.write_nullable(of_type, wrapping_required), + AST::NonNullable(of_type) => self.write_non_nullable(of_type), + AST::ExactObject(object) => self.write_object(object), + AST::InexactObject(object) => self.write_object(object), + AST::Local3DPayload(document_name, selections) => { + self.write_local_3d_payload(*document_name, selections) + } + AST::FragmentReference(fragments) => self.write_fragment_references(fragments), + AST::FragmentReferenceType(fragment) => self.write_fragment_references_type(*fragment), + AST::ReturnTypeOfFunctionWithName(function_name) => { + self.write_return_type_of_function_with_name(*function_name) + } + AST::ActorChangePoint(_) => panic!("Not supported yet"), + } + } + fn write_indentation(&mut self) -> FmtResult { self.result.write_str(&" ".repeat(self.indentation)) } @@ -139,8 +143,8 @@ impl TypeScriptPrinter { write!(&mut self.result, r#""%other""#) } - fn write_union(&mut self, members: &[AST]) -> FmtResult { - if members.len() > 1 && self.should_wrap_unions_in_parentheses { + fn write_union(&mut self, members: &[AST], wrapping_required: bool) -> FmtResult { + if members.len() > 1 && self.should_wrap_unions_in_parentheses && wrapping_required { write!(&mut self.result, "(")?; } let mut first = true; @@ -152,14 +156,14 @@ impl TypeScriptPrinter { } self.write(member)?; } - if members.len() > 1 && self.should_wrap_unions_in_parentheses { + if members.len() > 1 && self.should_wrap_unions_in_parentheses && wrapping_required { write!(&mut self.result, ")")?; } Ok(()) } - fn write_intersection(&mut self, members: &[AST]) -> FmtResult { - if members.len() > 1 { + fn write_intersection(&mut self, members: &[AST], wrapping_required: bool) -> FmtResult { + if members.len() > 1 && wrapping_required { write!(&mut self.result, "(")?; } let mut first = true; @@ -171,7 +175,7 @@ impl TypeScriptPrinter { } self.write(member)?; } - if members.len() > 1 { + if members.len() > 1 && wrapping_required { write!(&mut self.result, ")")?; } Ok(()) @@ -179,25 +183,25 @@ impl TypeScriptPrinter { fn write_read_only_array(&mut self, of_type: &AST) -> FmtResult { write!(&mut self.result, "ReadonlyArray<")?; - self.write(of_type)?; + self.write_ast(of_type, false)?; write!(&mut self.result, ">") } fn write_non_nullable(&mut self, of_type: &AST) -> FmtResult { write!(&mut self.result, "NonNullable<")?; - self.write(of_type)?; + self.write_ast(of_type, false)?; write!(&mut self.result, ">") } - fn write_nullable(&mut self, of_type: &AST) -> FmtResult { + fn write_nullable(&mut self, of_type: &AST, wrapping_required: bool) -> FmtResult { let null_type = AST::RawType("null".intern()); if let AST::Union(members) = of_type { let mut new_members = Vec::with_capacity(members.len() + 1); new_members.extend_from_slice(members); new_members.push(null_type); - self.write_union(&*new_members)?; + self.write_union(&*new_members, wrapping_required)?; } else { - self.write_union(&*vec![of_type.clone(), null_type])?; + self.write_union(&*vec![of_type.clone(), null_type], wrapping_required)?; } Ok(()) } @@ -252,7 +256,7 @@ impl TypeScriptPrinter { write!(&mut self.result, "?")?; } write!(&mut self.result, ": ")?; - self.write(&key_value_pair.value)?; + self.write_ast(&key_value_pair.value, false)?; writeln!(&mut self.result, ";")?; } Prop::GetterSetterPair(_) => { @@ -270,19 +274,22 @@ impl TypeScriptPrinter { fn write_local_3d_payload(&mut self, document_name: StringKey, selections: &AST) -> FmtResult { write!(&mut self.result, "Local3DPayload<\"{}\", ", document_name)?; - self.write(selections)?; + self.write_ast(selections, false)?; write!(&mut self.result, ">")?; Ok(()) } fn write_fragment_references(&mut self, fragments: &[StringKey]) -> FmtResult { write!(&mut self.result, "FragmentRefs<")?; - self.write(&AST::Union( - fragments - .iter() - .map(|key| AST::StringLiteral(*key)) - .collect(), - ))?; + self.write_ast( + &AST::Union( + fragments + .iter() + .map(|key| AST::StringLiteral(*key)) + .collect(), + ), + false, + )?; write!(&mut self.result, ">") } @@ -428,6 +435,28 @@ mod tests { ); } + #[test] + fn wrapping() { + assert_eq!( + print_type(&AST::ExactObject(ExactObject::new( + vec![Prop::KeyValuePair(KeyValuePairProp { + key: "key".intern(), + optional: false, + read_only: false, + value: AST::Intersection(vec![ + AST::Union(vec![AST::String, AST::Number]), + AST::Boolean + ]) + })], + true + ))), + r"{ + key: (string | number) & boolean; +}" + .to_string() + ); + } + #[test] fn exact_object() { assert_eq!( diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/fragment-spread.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/fragment-spread.expected index 55bad59874e08..92307abaf347d 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/fragment-spread.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/fragment-spread.expected @@ -110,7 +110,7 @@ export type OtherFragment$key = { ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; declare export opaque type PageFragment$fragmentType: FragmentType; -export type PageFragment$data = ({| +export type PageFragment$data = {| +__typename: "Page", +$fragmentType: PageFragment$fragmentType, |} | {| @@ -118,7 +118,7 @@ export type PageFragment$data = ({| // value in case none of the concrete values match. +__typename: "%other", +$fragmentType: PageFragment$fragmentType, -|}); +|}; export type PageFragment$key = { +$data?: PageFragment$data, +$fragmentSpreads: PageFragment$fragmentType, @@ -127,7 +127,7 @@ export type PageFragment$key = { ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; declare export opaque type PictureFragment$fragmentType: FragmentType; -export type PictureFragment$data = ({| +export type PictureFragment$data = {| +__typename: "Image", +$fragmentType: PictureFragment$fragmentType, |} | {| @@ -135,7 +135,7 @@ export type PictureFragment$data = ({| // value in case none of the concrete values match. +__typename: "%other", +$fragmentType: PictureFragment$fragmentType, -|}); +|}; export type PictureFragment$key = { +$data?: PictureFragment$data, +$fragmentSpreads: PictureFragment$fragmentType, @@ -144,7 +144,7 @@ export type PictureFragment$key = { ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; declare export opaque type UserFrag1$fragmentType: FragmentType; -export type UserFrag1$data = ({| +export type UserFrag1$data = {| +__typename: "User", +$fragmentType: UserFrag1$fragmentType, |} | {| @@ -152,7 +152,7 @@ export type UserFrag1$data = ({| // value in case none of the concrete values match. +__typename: "%other", +$fragmentType: UserFrag1$fragmentType, -|}); +|}; export type UserFrag1$key = { +$data?: UserFrag1$data, +$fragmentSpreads: UserFrag1$fragmentType, @@ -161,7 +161,7 @@ export type UserFrag1$key = { ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; declare export opaque type UserFrag2$fragmentType: FragmentType; -export type UserFrag2$data = ({| +export type UserFrag2$data = {| +__typename: "User", +$fragmentType: UserFrag2$fragmentType, |} | {| @@ -169,7 +169,7 @@ export type UserFrag2$data = ({| // value in case none of the concrete values match. +__typename: "%other", +$fragmentType: UserFrag2$fragmentType, -|}); +|}; export type UserFrag2$key = { +$data?: UserFrag2$data, +$fragmentSpreads: UserFrag2$fragmentType, diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/inline-fragment.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/inline-fragment.expected index 3360c570d5b82..c865e0610f83d 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/inline-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/inline-fragment.expected @@ -136,7 +136,7 @@ export type InlineFragmentWithOverlappingFields$key = { ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; declare export opaque type SomeFragment$fragmentType: FragmentType; -export type SomeFragment$data = ({| +export type SomeFragment$data = {| +__typename: "User", +$fragmentType: SomeFragment$fragmentType, |} | {| @@ -144,7 +144,7 @@ export type SomeFragment$data = ({| // value in case none of the concrete values match. +__typename: "%other", +$fragmentType: SomeFragment$fragmentType, -|}); +|}; export type SomeFragment$key = { +$data?: SomeFragment$data, +$fragmentSpreads: SomeFragment$fragmentType, diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-enums-on-fragment.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-enums-on-fragment.expected index 46470b47579a1..e112f80c3b6e4 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-enums-on-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-enums-on-fragment.expected @@ -28,7 +28,7 @@ fragment FriendFragment on User { } ==================================== OUTPUT =================================== import type { FriendFragment$fragmentType } from "FriendFragment.graphql"; -export type TestEnums = ("mark" | "zuck" | "%future added value"); +export type TestEnums = "mark" | "zuck" | "%future added value"; export type CommentCreateInput = {| clientMutationId?: ?string, feedback?: ?CommentfeedbackFeedback, @@ -86,7 +86,7 @@ export type CommentCreateMutation = {| variables: CommentCreateMutation$variables, |}; ------------------------------------------------------------------------------- -export type TestEnums = ("mark" | "zuck" | "%future added value"); +export type TestEnums = "mark" | "zuck" | "%future added value"; import type { FragmentType } from "relay-runtime"; declare export opaque type FriendFragment$fragmentType: FragmentType; export type FriendFragment$data = {| diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query_with_raw_response_and_client_components.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query_with_raw_response_and_client_components.expected index f44e68f20739b..5c86702963661 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query_with_raw_response_and_client_components.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query_with_raw_response_and_client_components.expected @@ -33,7 +33,7 @@ export type queryWithRelayClientComponentQuery = {| ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; declare export opaque type queryWithRelayClientComponent_f1$fragmentType: FragmentType; -export type queryWithRelayClientComponent_f1$data = ({| +export type queryWithRelayClientComponent_f1$data = {| +__typename: "Viewer", +$fragmentType: queryWithRelayClientComponent_f1$fragmentType, |} | {| @@ -41,7 +41,7 @@ export type queryWithRelayClientComponent_f1$data = ({| // value in case none of the concrete values match. +__typename: "%other", +$fragmentType: queryWithRelayClientComponent_f1$fragmentType, -|}); +|}; export type queryWithRelayClientComponent_f1$key = { +$data?: queryWithRelayClientComponent_f1$data, +$fragmentSpreads: queryWithRelayClientComponent_f1$fragmentType, @@ -50,7 +50,7 @@ export type queryWithRelayClientComponent_f1$key = { ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; declare export opaque type queryWithRelayClientComponent_f2$fragmentType: FragmentType; -export type queryWithRelayClientComponent_f2$data = ({| +export type queryWithRelayClientComponent_f2$data = {| +__typename: "Viewer", +$fragmentType: queryWithRelayClientComponent_f2$fragmentType, |} | {| @@ -58,7 +58,7 @@ export type queryWithRelayClientComponent_f2$data = ({| // value in case none of the concrete values match. +__typename: "%other", +$fragmentType: queryWithRelayClientComponent_f2$fragmentType, -|}); +|}; export type queryWithRelayClientComponent_f2$key = { +$data?: queryWithRelayClientComponent_f2$data, +$fragmentSpreads: queryWithRelayClientComponent_f2$fragmentType, diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/scalar-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/scalar-field.expected index bc08dc4951c74..0a8b625c01f47 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/scalar-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/scalar-field.expected @@ -13,7 +13,7 @@ fragment ScalarField on User { } } ==================================== OUTPUT =================================== -export type PersonalityTraits = ("CHEERFUL" | "DERISIVE" | "HELPFUL" | "SNARKY" | "%future added value"); +export type PersonalityTraits = "CHEERFUL" | "DERISIVE" | "HELPFUL" | "SNARKY" | "%future added value"; import type { FragmentType } from "relay-runtime"; declare export opaque type ScalarField$fragmentType: FragmentType; export type ScalarField$data = {| diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected index 0dc9cb8a4ef57..cc368a4e7b3d4 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/typename-on-union.expected @@ -82,7 +82,7 @@ fragment TypenameAliases on Actor { ==================================== OUTPUT =================================== import type { FragmentType } from "relay-runtime"; declare export opaque type TypenameAlias$fragmentType: FragmentType; -export type TypenameAlias$data = ({| +export type TypenameAlias$data = {| +_typeAlias: "User", +firstName: ?string, +$fragmentType: TypenameAlias$fragmentType, @@ -95,7 +95,7 @@ export type TypenameAlias$data = ({| // value in case none of the concrete values match. +_typeAlias: "%other", +$fragmentType: TypenameAlias$fragmentType, -|}); +|}; export type TypenameAlias$key = { +$data?: TypenameAlias$data, +$fragmentSpreads: TypenameAlias$fragmentType, @@ -104,7 +104,7 @@ export type TypenameAlias$key = { ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; declare export opaque type TypenameAliases$fragmentType: FragmentType; -export type TypenameAliases$data = ({| +export type TypenameAliases$data = {| +_typeAlias1: "User", +_typeAlias2: "User", +firstName: ?string, @@ -122,7 +122,7 @@ export type TypenameAliases$data = ({| // value in case none of the concrete values match. +_typeAlias2: "%other", +$fragmentType: TypenameAliases$fragmentType, -|}); +|}; export type TypenameAliases$key = { +$data?: TypenameAliases$data, +$fragmentSpreads: TypenameAliases$fragmentType, @@ -131,7 +131,7 @@ export type TypenameAliases$key = { ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; declare export opaque type TypenameInside$fragmentType: FragmentType; -export type TypenameInside$data = ({| +export type TypenameInside$data = {| +__typename: "User", +firstName: ?string, +$fragmentType: TypenameInside$fragmentType, @@ -144,7 +144,7 @@ export type TypenameInside$data = ({| // value in case none of the concrete values match. +__typename: "%other", +$fragmentType: TypenameInside$fragmentType, -|}); +|}; export type TypenameInside$key = { +$data?: TypenameInside$data, +$fragmentSpreads: TypenameInside$fragmentType, @@ -153,7 +153,7 @@ export type TypenameInside$key = { ------------------------------------------------------------------------------- import type { FragmentType } from "relay-runtime"; declare export opaque type TypenameOutside$fragmentType: FragmentType; -export type TypenameOutside$data = ({| +export type TypenameOutside$data = {| +__typename: "User", +firstName: ?string, +$fragmentType: TypenameOutside$fragmentType, @@ -166,7 +166,7 @@ export type TypenameOutside$data = ({| // value in case none of the concrete values match. +__typename: "%other", +$fragmentType: TypenameOutside$fragmentType, -|}); +|}; export type TypenameOutside$key = { +$data?: TypenameOutside$data, +$fragmentSpreads: TypenameOutside$fragmentType, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected index 9c1147112f012..6972092c662a4 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected @@ -50,18 +50,18 @@ fragment UserFrag2 on User { ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; export type ConcreateTypes$data = { - readonly actor: ({ + readonly actor: { readonly __typename: "Page"; readonly id: string; readonly " $fragmentSpreads": FragmentRefs<"PageFragment">; } | { readonly __typename: "User"; - readonly name: (string | null); + readonly name: string | null; } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly __typename: "%other"; - } | null); + } | null; readonly " $fragmentType": "ConcreateTypes"; }; export type ConcreateTypes$key = { @@ -71,15 +71,15 @@ export type ConcreateTypes$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type FragmentSpread$data = { - readonly fragAndField: ({ - readonly uri: (string | null); + readonly fragAndField: { + readonly uri: string | null; readonly " $fragmentSpreads": FragmentRefs<"PictureFragment">; - } | null); + } | null; readonly id: string; - readonly justFrag: ({ + readonly justFrag: { readonly " $fragmentSpreads": FragmentRefs<"PictureFragment">; - } | null); - readonly " $fragmentSpreads": FragmentRefs<("OtherFragment" | "UserFrag1" | "UserFrag2")>; + } | null; + readonly " $fragmentSpreads": FragmentRefs<"OtherFragment" | "UserFrag1" | "UserFrag2">; readonly " $fragmentType": "FragmentSpread"; }; export type FragmentSpread$key = { @@ -98,7 +98,7 @@ export type OtherFragment$key = { }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type PageFragment$data = ({ +export type PageFragment$data = { readonly __typename: "Page"; readonly " $fragmentType": "PageFragment"; } | { @@ -106,14 +106,14 @@ export type PageFragment$data = ({ // value in case none of the concrete values match. readonly __typename: "%other"; readonly " $fragmentType": "PageFragment"; -}); +}; export type PageFragment$key = { readonly " $data"?: PageFragment$data; readonly " $fragmentSpreads": FragmentRefs<"PageFragment">; }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type PictureFragment$data = ({ +export type PictureFragment$data = { readonly __typename: "Image"; readonly " $fragmentType": "PictureFragment"; } | { @@ -121,14 +121,14 @@ export type PictureFragment$data = ({ // value in case none of the concrete values match. readonly __typename: "%other"; readonly " $fragmentType": "PictureFragment"; -}); +}; export type PictureFragment$key = { readonly " $data"?: PictureFragment$data; readonly " $fragmentSpreads": FragmentRefs<"PictureFragment">; }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type UserFrag1$data = ({ +export type UserFrag1$data = { readonly __typename: "User"; readonly " $fragmentType": "UserFrag1"; } | { @@ -136,14 +136,14 @@ export type UserFrag1$data = ({ // value in case none of the concrete values match. readonly __typename: "%other"; readonly " $fragmentType": "UserFrag1"; -}); +}; export type UserFrag1$key = { readonly " $data"?: UserFrag1$data; readonly " $fragmentSpreads": FragmentRefs<"UserFrag1">; }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type UserFrag2$data = ({ +export type UserFrag2$data = { readonly __typename: "User"; readonly " $fragmentType": "UserFrag2"; } | { @@ -151,7 +151,7 @@ export type UserFrag2$data = ({ // value in case none of the concrete values match. readonly __typename: "%other"; readonly " $fragmentType": "UserFrag2"; -}); +}; export type UserFrag2$key = { readonly " $data"?: UserFrag2$data; readonly " $fragmentSpreads": FragmentRefs<"UserFrag2">; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected index 3255f3f37dad0..c604753353db8 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected @@ -67,10 +67,10 @@ fragment SomeFragment on User { import { FragmentRefs } from "relay-runtime"; export type InlineFragment$data = { readonly id: string; - readonly message?: ({ - readonly text: (string | null); - } | null); - readonly name?: (string | null); + readonly message?: { + readonly text: string | null; + } | null; + readonly name?: string | null; readonly " $fragmentType": "InlineFragment"; }; export type InlineFragment$key = { @@ -81,7 +81,7 @@ export type InlineFragment$key = { import { FragmentRefs } from "relay-runtime"; export type InlineFragmentConditionalID$data = { readonly id?: string; - readonly name?: (string | null); + readonly name?: string | null; readonly " $fragmentType": "InlineFragmentConditionalID"; }; export type InlineFragmentConditionalID$key = { @@ -91,16 +91,16 @@ export type InlineFragmentConditionalID$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type InlineFragmentKitchenSink$data = { - readonly actor: ({ + readonly actor: { readonly id: string; - readonly name?: (string | null); - readonly profilePicture: ({ - readonly height?: (number | null); - readonly uri: (string | null); - readonly width?: (number | null); - } | null); + readonly name?: string | null; + readonly profilePicture: { + readonly height?: number | null; + readonly uri: string | null; + readonly width?: number | null; + } | null; readonly " $fragmentSpreads": FragmentRefs<"SomeFragment">; - } | null); + } | null; readonly " $fragmentType": "InlineFragmentKitchenSink"; }; export type InlineFragmentKitchenSink$key = { @@ -110,14 +110,14 @@ export type InlineFragmentKitchenSink$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type InlineFragmentWithOverlappingFields$data = { - readonly hometown?: ({ + readonly hometown?: { readonly id: string; - readonly message?: ({ - readonly text: (string | null); - } | null); - readonly name: (string | null); - } | null); - readonly name?: (string | null); + readonly message?: { + readonly text: string | null; + } | null; + readonly name: string | null; + } | null; + readonly name?: string | null; readonly " $fragmentType": "InlineFragmentWithOverlappingFields"; }; export type InlineFragmentWithOverlappingFields$key = { @@ -126,7 +126,7 @@ export type InlineFragmentWithOverlappingFields$key = { }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type SomeFragment$data = ({ +export type SomeFragment$data = { readonly __typename: "User"; readonly " $fragmentType": "SomeFragment"; } | { @@ -134,7 +134,7 @@ export type SomeFragment$data = ({ // value in case none of the concrete values match. readonly __typename: "%other"; readonly " $fragmentType": "SomeFragment"; -}); +}; export type SomeFragment$key = { readonly " $data"?: SomeFragment$data; readonly " $fragmentSpreads": FragmentRefs<"SomeFragment">; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected index fe7a0c21c3ccb..e7d1d82c7ca8e 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/linked-field.expected @@ -29,14 +29,14 @@ query UnionTypeTest { ==================================== OUTPUT =================================== export type UnionTypeTest$variables = {}; export type UnionTypeTest$data = { - readonly neverNode: ({ + readonly neverNode: { readonly __typename: "FakeNode"; readonly id: string; } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly __typename: "%other"; - } | null); + } | null; }; export type UnionTypeTest = { response: UnionTypeTest$data; @@ -45,20 +45,20 @@ export type UnionTypeTest = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type LinkedField$data = { - readonly actor: ({ + readonly actor: { readonly id: string; - } | null); - readonly hometown: ({ + } | null; + readonly hometown: { readonly id: string; - readonly profilePicture: ({ - readonly uri: (string | null); - } | null); - } | null); - readonly profilePicture: ({ - readonly height: (number | null); - readonly uri: (string | null); - readonly width: (number | null); - } | null); + readonly profilePicture: { + readonly uri: string | null; + } | null; + } | null; + readonly profilePicture: { + readonly height: number | null; + readonly uri: string | null; + readonly width: number | null; + } | null; readonly " $fragmentType": "LinkedField"; }; export type LinkedField$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected index 4fc21c8bb21f2..5f6c893c76ef6 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field-in-query.expected @@ -26,13 +26,13 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { import { FragmentRefs } from "relay-runtime"; export type NameRendererQuery$variables = {}; export type NameRendererQuery$data = { - readonly me: ({ - readonly nameRenderer: ({ - readonly __fragmentPropName?: (string | null); - readonly __module_component?: (string | null); - readonly " $fragmentSpreads": FragmentRefs<("MarkdownUserNameRenderer_name" | "PlainUserNameRenderer_name")>; - } | null); - } | null); + readonly me: { + readonly nameRenderer: { + readonly __fragmentPropName?: string | null; + readonly __module_component?: string | null; + readonly " $fragmentSpreads": FragmentRefs<"MarkdownUserNameRenderer_name" | "PlainUserNameRenderer_name">; + } | null; + } | null; }; export type NameRendererQuery = { response: NameRendererQuery$data; @@ -41,10 +41,10 @@ export type NameRendererQuery = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type MarkdownUserNameRenderer_name$data = { - readonly data: ({ - readonly markup: (string | null); - } | null); - readonly markdown: (string | null); + readonly data: { + readonly markup: string | null; + } | null; + readonly markdown: string | null; readonly " $fragmentType": "MarkdownUserNameRenderer_name"; }; export type MarkdownUserNameRenderer_name$key = { @@ -54,10 +54,10 @@ export type MarkdownUserNameRenderer_name$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type PlainUserNameRenderer_name$data = { - readonly data: ({ - readonly text: (string | null); - } | null); - readonly plaintext: (string | null); + readonly data: { + readonly text: string | null; + } | null; + readonly plaintext: string | null; readonly " $fragmentType": "PlainUserNameRenderer_name"; }; export type PlainUserNameRenderer_name$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected index c00a5686df05b..5f09c34582ba6 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/match-field.expected @@ -24,10 +24,10 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; export type MarkdownUserNameRenderer_name$data = { - readonly data: ({ - readonly markup: (string | null); - } | null); - readonly markdown: (string | null); + readonly data: { + readonly markup: string | null; + } | null; + readonly markdown: string | null; readonly " $fragmentType": "MarkdownUserNameRenderer_name"; }; export type MarkdownUserNameRenderer_name$key = { @@ -38,11 +38,11 @@ export type MarkdownUserNameRenderer_name$key = { import { FragmentRefs } from "relay-runtime"; export type NameRendererFragment$data = { readonly id: string; - readonly nameRenderer: ({ - readonly __fragmentPropName?: (string | null); - readonly __module_component?: (string | null); - readonly " $fragmentSpreads": FragmentRefs<("MarkdownUserNameRenderer_name" | "PlainUserNameRenderer_name")>; - } | null); + readonly nameRenderer: { + readonly __fragmentPropName?: string | null; + readonly __module_component?: string | null; + readonly " $fragmentSpreads": FragmentRefs<"MarkdownUserNameRenderer_name" | "PlainUserNameRenderer_name">; + } | null; readonly " $fragmentType": "NameRendererFragment"; }; export type NameRendererFragment$key = { @@ -52,10 +52,10 @@ export type NameRendererFragment$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type PlainUserNameRenderer_name$data = { - readonly data: ({ - readonly text: (string | null); - } | null); - readonly plaintext: (string | null); + readonly data: { + readonly text: string | null; + } | null; + readonly plaintext: string | null; readonly " $fragmentType": "PlainUserNameRenderer_name"; }; export type PlainUserNameRenderer_name$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-input-has-array.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-input-has-array.expected index 83907b1f89e7a..c35ffc2703596 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-input-has-array.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-input-has-array.expected @@ -8,26 +8,26 @@ mutation InputHasArray($input: UpdateAllSeenStateInput) @raw_response_type { } ==================================== OUTPUT =================================== export type UpdateAllSeenStateInput = { - clientMutationId?: (string | null); - storyIds?: (ReadonlyArray<(string | null)> | null); + clientMutationId?: string | null; + storyIds?: ReadonlyArray | null; }; export type InputHasArray$variables = { - input?: (UpdateAllSeenStateInput | null); + input?: UpdateAllSeenStateInput | null; }; export type InputHasArray$data = { - readonly viewerNotificationsUpdateAllSeenState: ({ - readonly stories: (ReadonlyArray<({ - readonly actorCount: (number | null); - } | null)> | null); - } | null); + readonly viewerNotificationsUpdateAllSeenState: { + readonly stories: ReadonlyArray<{ + readonly actorCount: number | null; + } | null> | null; + } | null; }; export type InputHasArray$rawResponse = { - readonly viewerNotificationsUpdateAllSeenState: ({ - readonly stories: (ReadonlyArray<({ - readonly actorCount: (number | null); + readonly viewerNotificationsUpdateAllSeenState: { + readonly stories: ReadonlyArray<{ + readonly actorCount: number | null; readonly id: string; - } | null)> | null); - } | null); + } | null> | null; + } | null; }; export type InputHasArray = { rawResponse: InputHasArray$rawResponse; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-client-extension.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-client-extension.expected index 801da077786ba..293513bb02092 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-client-extension.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-client-extension.expected @@ -20,30 +20,30 @@ type Foo { } ==================================== OUTPUT =================================== export type UpdateAllSeenStateInput = { - clientMutationId?: (string | null); - storyIds?: (ReadonlyArray<(string | null)> | null); + clientMutationId?: string | null; + storyIds?: ReadonlyArray | null; }; export type Test$variables = { - input?: (UpdateAllSeenStateInput | null); + input?: UpdateAllSeenStateInput | null; }; export type Test$data = { - readonly viewerNotificationsUpdateAllSeenState: ({ - readonly stories: (ReadonlyArray<({ - readonly foos: (ReadonlyArray<({ - readonly bar: (string | null); - } | null)> | null); - } | null)> | null); - } | null); + readonly viewerNotificationsUpdateAllSeenState: { + readonly stories: ReadonlyArray<{ + readonly foos: ReadonlyArray<{ + readonly bar: string | null; + } | null> | null; + } | null> | null; + } | null; }; export type Test$rawResponse = { - readonly viewerNotificationsUpdateAllSeenState: ({ - readonly stories: (ReadonlyArray<({ - readonly foos?: (ReadonlyArray<({ - readonly bar: (string | null); - } | null)> | null); + readonly viewerNotificationsUpdateAllSeenState: { + readonly stories: ReadonlyArray<{ + readonly foos?: ReadonlyArray<{ + readonly bar: string | null; + } | null> | null; readonly id: string; - } | null)> | null); - } | null); + } | null> | null; + } | null; }; export type Test = { rawResponse: Test$rawResponse; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected index c97efb5f50c48..9ba78d515761d 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-enums-on-fragment.expected @@ -28,57 +28,57 @@ fragment FriendFragment on User { } ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; -export type TestEnums = ("mark" | "zuck" | "%future added value"); +export type TestEnums = "mark" | "zuck" | "%future added value"; export type CommentCreateInput = { - clientMutationId?: (string | null); - feedback?: (CommentfeedbackFeedback | null); - feedbackId?: (string | null); + clientMutationId?: string | null; + feedback?: CommentfeedbackFeedback | null; + feedbackId?: string | null; }; export type CommentfeedbackFeedback = { - comment?: (FeedbackcommentComment | null); + comment?: FeedbackcommentComment | null; }; export type FeedbackcommentComment = { - feedback?: (CommentfeedbackFeedback | null); + feedback?: CommentfeedbackFeedback | null; }; export type CommentCreateMutation$variables = { - first?: (number | null); + first?: number | null; input: CommentCreateInput; - orderBy?: (ReadonlyArray | null); + orderBy?: ReadonlyArray | null; }; export type CommentCreateMutation$data = { - readonly commentCreate: ({ - readonly comment: ({ - readonly friends: ({ - readonly edges: (ReadonlyArray<({ - readonly node: ({ + readonly commentCreate: { + readonly comment: { + readonly friends: { + readonly edges: ReadonlyArray<{ + readonly node: { readonly __typename: string; readonly id: string; readonly " $fragmentSpreads": FragmentRefs<"FriendFragment">; - } | null); - } | null)> | null); - } | null); - } | null); - } | null); + } | null; + } | null> | null; + } | null; + } | null; + } | null; }; export type CommentCreateMutation$rawResponse = { - readonly commentCreate: ({ - readonly comment: ({ - readonly friends: ({ - readonly edges: (ReadonlyArray<({ - readonly node: ({ + readonly commentCreate: { + readonly comment: { + readonly friends: { + readonly edges: ReadonlyArray<{ + readonly node: { readonly __typename: "User"; readonly id: string; - readonly lastName: (string | null); - readonly name: (string | null); - readonly profilePicture2: ({ - readonly test_enums: (TestEnums | null); - } | null); - } | null); - } | null)> | null); - } | null); + readonly lastName: string | null; + readonly name: string | null; + readonly profilePicture2: { + readonly test_enums: TestEnums | null; + } | null; + } | null; + } | null> | null; + } | null; readonly id: string; - } | null); - } | null); + } | null; + } | null; }; export type CommentCreateMutation = { rawResponse: CommentCreateMutation$rawResponse; @@ -86,14 +86,14 @@ export type CommentCreateMutation = { variables: CommentCreateMutation$variables; }; ------------------------------------------------------------------------------- -export type TestEnums = ("mark" | "zuck" | "%future added value"); +export type TestEnums = "mark" | "zuck" | "%future added value"; import { FragmentRefs } from "relay-runtime"; export type FriendFragment$data = { - readonly lastName: (string | null); - readonly name: (string | null); - readonly profilePicture2: ({ - readonly test_enums: (TestEnums | null); - } | null); + readonly lastName: string | null; + readonly name: string | null; + readonly profilePicture2: { + readonly test_enums: TestEnums | null; + } | null; readonly " $fragmentType": "FriendFragment"; }; export type FriendFragment$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected index ef655f9836fbf..35da9e0e7af3e 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-nested-fragments.expected @@ -33,54 +33,54 @@ fragment FeedbackFragment on Feedback { ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; export type CommentCreateInput = { - clientMutationId?: (string | null); - feedback?: (CommentfeedbackFeedback | null); - feedbackId?: (string | null); + clientMutationId?: string | null; + feedback?: CommentfeedbackFeedback | null; + feedbackId?: string | null; }; export type CommentfeedbackFeedback = { - comment?: (FeedbackcommentComment | null); + comment?: FeedbackcommentComment | null; }; export type FeedbackcommentComment = { - feedback?: (CommentfeedbackFeedback | null); + feedback?: CommentfeedbackFeedback | null; }; export type CommentCreateMutation$variables = { - first?: (number | null); + first?: number | null; input: CommentCreateInput; - orderBy?: (ReadonlyArray | null); + orderBy?: ReadonlyArray | null; }; export type CommentCreateMutation$data = { - readonly commentCreate: ({ - readonly comment: ({ - readonly friends: ({ - readonly edges: (ReadonlyArray<({ - readonly node: ({ - readonly lastName: (string | null); + readonly commentCreate: { + readonly comment: { + readonly friends: { + readonly edges: ReadonlyArray<{ + readonly node: { + readonly lastName: string | null; readonly " $fragmentSpreads": FragmentRefs<"FriendFragment">; - } | null); - } | null)> | null); - } | null); - } | null); - } | null); + } | null; + } | null> | null; + } | null; + } | null; + } | null; }; export type CommentCreateMutation$rawResponse = { - readonly commentCreate: ({ - readonly comment: ({ - readonly friends: ({ - readonly edges: (ReadonlyArray<({ - readonly node: ({ - readonly feedback: ({ + readonly commentCreate: { + readonly comment: { + readonly friends: { + readonly edges: ReadonlyArray<{ + readonly node: { + readonly feedback: { readonly id: string; - readonly name: (string | null); - } | null); + readonly name: string | null; + } | null; readonly id: string; - readonly lastName: (string | null); - readonly name: (string | null); - } | null); - } | null)> | null); - } | null); + readonly lastName: string | null; + readonly name: string | null; + } | null; + } | null> | null; + } | null; readonly id: string; - } | null); - } | null); + } | null; + } | null; }; export type CommentCreateMutation = { rawResponse: CommentCreateMutation$rawResponse; @@ -91,7 +91,7 @@ export type CommentCreateMutation = { import { FragmentRefs } from "relay-runtime"; export type FeedbackFragment$data = { readonly id: string; - readonly name: (string | null); + readonly name: string | null; readonly " $fragmentType": "FeedbackFragment"; }; export type FeedbackFragment$key = { @@ -101,11 +101,11 @@ export type FeedbackFragment$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type FriendFragment$data = { - readonly feedback: ({ + readonly feedback: { readonly " $fragmentSpreads": FragmentRefs<"FeedbackFragment">; - } | null); - readonly lastName: (string | null); - readonly name: (string | null); + } | null; + readonly lastName: string | null; + readonly name: string | null; readonly " $fragmentType": "FriendFragment"; }; export type FriendFragment$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected index 855e5f0a8b87c..43464bc8aa433 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation-with-response-on-inline-fragments.expected @@ -29,57 +29,57 @@ fragment InlineFragmentWithOverlappingFields on Actor { ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; export type CommentCreateInput = { - clientMutationId?: (string | null); - feedback?: (CommentfeedbackFeedback | null); - feedbackId?: (string | null); + clientMutationId?: string | null; + feedback?: CommentfeedbackFeedback | null; + feedbackId?: string | null; }; export type CommentfeedbackFeedback = { - comment?: (FeedbackcommentComment | null); + comment?: FeedbackcommentComment | null; }; export type FeedbackcommentComment = { - feedback?: (CommentfeedbackFeedback | null); + feedback?: CommentfeedbackFeedback | null; }; export type TestMutation$variables = { input: CommentCreateInput; }; export type TestMutation$data = { - readonly commentCreate: ({ - readonly viewer: ({ - readonly actor: ({ + readonly commentCreate: { + readonly viewer: { + readonly actor: { readonly " $fragmentSpreads": FragmentRefs<"InlineFragmentWithOverlappingFields">; - } | null); - } | null); - } | null); + } | null; + } | null; + } | null; }; export type TestMutation$rawResponse = { - readonly commentCreate: ({ - readonly viewer: ({ - readonly actor: ({ + readonly commentCreate: { + readonly viewer: { + readonly actor: { readonly __isActor: "User"; readonly __typename: "User"; - readonly hometown: ({ + readonly hometown: { readonly id: string; - readonly name: (string | null); - } | null); + readonly name: string | null; + } | null; readonly id: string; } | { readonly __isActor: "Page"; readonly __typename: "Page"; - readonly hometown: ({ + readonly hometown: { readonly id: string; - readonly message: ({ - readonly text: (string | null); - } | null); - } | null); + readonly message: { + readonly text: string | null; + } | null; + } | null; readonly id: string; - readonly name: (string | null); + readonly name: string | null; } | { readonly __isActor: string; readonly __typename: string; readonly id: string; - } | null); - } | null); - } | null); + } | null; + } | null; + } | null; }; export type TestMutation = { rawResponse: TestMutation$rawResponse; @@ -89,14 +89,14 @@ export type TestMutation = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type InlineFragmentWithOverlappingFields$data = { - readonly hometown?: ({ + readonly hometown?: { readonly id: string; - readonly message?: ({ - readonly text: (string | null); - } | null); - readonly name: (string | null); - } | null); - readonly name?: (string | null); + readonly message?: { + readonly text: string | null; + } | null; + readonly name: string | null; + } | null; + readonly name?: string | null; readonly " $fragmentType": "InlineFragmentWithOverlappingFields"; }; export type InlineFragmentWithOverlappingFields$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation.expected index 20ebcf30e794f..4b00f7700b5fa 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/mutation.expected @@ -16,31 +16,31 @@ mutation CommentCreateMutation( } ==================================== OUTPUT =================================== export type CommentCreateInput = { - clientMutationId?: (string | null); - feedback?: (CommentfeedbackFeedback | null); - feedbackId?: (string | null); + clientMutationId?: string | null; + feedback?: CommentfeedbackFeedback | null; + feedbackId?: string | null; }; export type CommentfeedbackFeedback = { - comment?: (FeedbackcommentComment | null); + comment?: FeedbackcommentComment | null; }; export type FeedbackcommentComment = { - feedback?: (CommentfeedbackFeedback | null); + feedback?: CommentfeedbackFeedback | null; }; export type CommentCreateMutation$variables = { - first?: (number | null); + first?: number | null; input: CommentCreateInput; - orderBy?: (ReadonlyArray | null); + orderBy?: ReadonlyArray | null; }; export type CommentCreateMutation$data = { - readonly commentCreate: ({ - readonly comment: ({ - readonly friends: ({ - readonly count: (number | null); - } | null); + readonly commentCreate: { + readonly comment: { + readonly friends: { + readonly count: number | null; + } | null; readonly id: string; - readonly name: (string | null); - } | null); - } | null); + readonly name: string | null; + } | null; + } | null; }; export type CommentCreateMutation = { response: CommentCreateMutation$data; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-handles.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-handles.expected index 12f704155007a..76c3074aee3b0 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-handles.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-handles.expected @@ -21,23 +21,23 @@ export type LinkedHandleField$variables = { id: string; }; export type LinkedHandleField$data = { - readonly node: ({ - readonly friends?: ({ - readonly count: (number | null); - } | null); - } | null); + readonly node: { + readonly friends?: { + readonly count: number | null; + } | null; + } | null; }; export type LinkedHandleField$rawResponse = { - readonly node: ({ + readonly node: { readonly __typename: "User"; - readonly friends: ({ - readonly count: (number | null); - } | null); + readonly friends: { + readonly count: number | null; + } | null; readonly id: string; } | { readonly __typename: string; readonly id: string; - } | null); + } | null; }; export type LinkedHandleField = { rawResponse: LinkedHandleField$rawResponse; @@ -49,19 +49,19 @@ export type ScalarHandleField$variables = { id: string; }; export type ScalarHandleField$data = { - readonly node: ({ - readonly name?: (string | null); - } | null); + readonly node: { + readonly name?: string | null; + } | null; }; export type ScalarHandleField$rawResponse = { - readonly node: ({ + readonly node: { readonly __typename: "User"; readonly id: string; - readonly name: (string | null); + readonly name: string | null; } | { readonly __typename: string; readonly id: string; - } | null); + } | null; }; export type ScalarHandleField = { rawResponse: ScalarHandleField$rawResponse; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected index 375dea70eca9c..53e95e2a6e5ac 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-match-fields.expected @@ -31,47 +31,47 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { import { FragmentRefs, Local3DPayload } from "relay-runtime"; export type Test$variables = {}; export type Test$data = { - readonly node: ({ + readonly node: { readonly " $fragmentSpreads": FragmentRefs<"NameRendererFragment">; - } | null); + } | null; }; export type PlainUserNameRenderer_name = { - readonly data: ({ - readonly id: (string | null); - readonly text: (string | null); - } | null); - readonly plaintext: (string | null); + readonly data: { + readonly id: string | null; + readonly text: string | null; + } | null; + readonly plaintext: string | null; }; export type MarkdownUserNameRenderer_name = { - readonly data: ({ - readonly id: (string | null); - readonly markup: (string | null); - } | null); - readonly markdown: (string | null); + readonly data: { + readonly id: string | null; + readonly markup: string | null; + } | null; + readonly markdown: string | null; }; export type Test$rawResponse = { - readonly node: ({ + readonly node: { readonly __typename: "User"; readonly id: string; - readonly nameRenderer: ({ - readonly __module_component_NameRendererFragment: (any | null); - readonly __module_operation_NameRendererFragment: (any | null); + readonly nameRenderer: { + readonly __module_component_NameRendererFragment: any | null; + readonly __module_operation_NameRendererFragment: any | null; readonly __typename: "PlainUserNameRenderer"; } | Local3DPayload<"NameRendererFragment", { readonly __typename: "PlainUserNameRenderer"; }> | { - readonly __module_component_NameRendererFragment: (any | null); - readonly __module_operation_NameRendererFragment: (any | null); + readonly __module_component_NameRendererFragment: any | null; + readonly __module_operation_NameRendererFragment: any | null; readonly __typename: "MarkdownUserNameRenderer"; } | Local3DPayload<"NameRendererFragment", { readonly __typename: "MarkdownUserNameRenderer"; }> | { readonly __typename: string; - } | null); + } | null; } | { readonly __typename: string; readonly id: string; - } | null); + } | null; }; export type Test = { rawResponse: Test$rawResponse; @@ -81,10 +81,10 @@ export type Test = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type MarkdownUserNameRenderer_name$data = { - readonly data: ({ - readonly markup: (string | null); - } | null); - readonly markdown: (string | null); + readonly data: { + readonly markup: string | null; + } | null; + readonly markdown: string | null; readonly " $fragmentType": "MarkdownUserNameRenderer_name"; }; export type MarkdownUserNameRenderer_name$key = { @@ -95,11 +95,11 @@ export type MarkdownUserNameRenderer_name$key = { import { FragmentRefs } from "relay-runtime"; export type NameRendererFragment$data = { readonly id: string; - readonly nameRenderer: ({ - readonly __fragmentPropName?: (string | null); - readonly __module_component?: (string | null); - readonly " $fragmentSpreads": FragmentRefs<("MarkdownUserNameRenderer_name" | "PlainUserNameRenderer_name")>; - } | null); + readonly nameRenderer: { + readonly __fragmentPropName?: string | null; + readonly __module_component?: string | null; + readonly " $fragmentSpreads": FragmentRefs<"MarkdownUserNameRenderer_name" | "PlainUserNameRenderer_name">; + } | null; readonly " $fragmentType": "NameRendererFragment"; }; export type NameRendererFragment$key = { @@ -109,10 +109,10 @@ export type NameRendererFragment$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type PlainUserNameRenderer_name$data = { - readonly data: ({ - readonly text: (string | null); - } | null); - readonly plaintext: (string | null); + readonly data: { + readonly text: string | null; + } | null; + readonly plaintext: string | null; readonly " $fragmentType": "PlainUserNameRenderer_name"; }; export type PlainUserNameRenderer_name$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected index fc4603e2a282b..449ee581f8ce8 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected @@ -20,28 +20,28 @@ fragment Test_userRenderer on PlainUserRenderer { import { FragmentRefs, Local3DPayload } from "relay-runtime"; export type Test$variables = {}; export type Test$data = { - readonly node: ({ + readonly node: { readonly " $fragmentSpreads": FragmentRefs<"Test_user">; - } | null); + } | null; }; export type Test_userRenderer = { - readonly user: ({ + readonly user: { readonly id: string; - readonly username: (string | null); - } | null); + readonly username: string | null; + } | null; }; export type Test$rawResponse = { - readonly node: ({ + readonly node: { readonly __typename: "User"; readonly id: string; - readonly plainUserRenderer: ({ - readonly __module_component_Test_user: (any | null); - readonly __module_operation_Test_user: (any | null); - } | Local3DPayload<"Test_user", {}> | null); + readonly plainUserRenderer: { + readonly __module_component_Test_user: any | null; + readonly __module_operation_Test_user: any | null; + } | Local3DPayload<"Test_user", {}> | null; } | { readonly __typename: string; readonly id: string; - } | null); + } | null; }; export type Test = { rawResponse: Test$rawResponse; @@ -51,11 +51,11 @@ export type Test = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type Test_user$data = { - readonly plainUserRenderer: ({ - readonly __fragmentPropName: (string | null); - readonly __module_component: (string | null); + readonly plainUserRenderer: { + readonly __fragmentPropName: string | null; + readonly __module_component: string | null; readonly " $fragmentSpreads": FragmentRefs<"Test_userRenderer">; - } | null); + } | null; readonly " $fragmentType": "Test_user"; }; export type Test_user$key = { @@ -65,9 +65,9 @@ export type Test_user$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type Test_userRenderer$data = { - readonly user: ({ - readonly username: (string | null); - } | null); + readonly user: { + readonly username: string | null; + } | null; readonly " $fragmentType": "Test_userRenderer"; }; export type Test_userRenderer$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected index 532483808c69a..ff69d297e6608 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected @@ -51,80 +51,80 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer { import { FragmentRefs, Local3DPayload } from "relay-runtime"; export type Test$variables = {}; export type Test$data = { - readonly node: ({ - readonly username?: (string | null); + readonly node: { + readonly username?: string | null; readonly " $fragmentSpreads": FragmentRefs<"NameRendererFragment">; - } | null); - readonly viewer: ({ - readonly actor: ({ - readonly name?: (string | null); + } | null; + readonly viewer: { + readonly actor: { + readonly name?: string | null; readonly " $fragmentSpreads": FragmentRefs<"AnotherNameRendererFragment">; - } | null); - } | null); + } | null; + } | null; }; export type PlainUserNameRenderer_name = { - readonly data: ({ - readonly id: (string | null); - readonly text: (string | null); - } | null); - readonly plaintext: (string | null); + readonly data: { + readonly id: string | null; + readonly text: string | null; + } | null; + readonly plaintext: string | null; }; export type MarkdownUserNameRenderer_name = { - readonly data: ({ - readonly id: (string | null); - readonly markup: (string | null); - } | null); - readonly markdown: (string | null); + readonly data: { + readonly id: string | null; + readonly markup: string | null; + } | null; + readonly markdown: string | null; }; export type Test$rawResponse = { - readonly node: ({ + readonly node: { readonly __typename: "User"; readonly id: string; - readonly nameRenderer: ({ - readonly __module_component_NameRendererFragment: (any | null); - readonly __module_operation_NameRendererFragment: (any | null); + readonly nameRenderer: { + readonly __module_component_NameRendererFragment: any | null; + readonly __module_operation_NameRendererFragment: any | null; readonly __typename: "PlainUserNameRenderer"; } | Local3DPayload<"NameRendererFragment", { readonly __typename: "PlainUserNameRenderer"; }> | { - readonly __module_component_NameRendererFragment: (any | null); - readonly __module_operation_NameRendererFragment: (any | null); + readonly __module_component_NameRendererFragment: any | null; + readonly __module_operation_NameRendererFragment: any | null; readonly __typename: "MarkdownUserNameRenderer"; } | Local3DPayload<"NameRendererFragment", { readonly __typename: "MarkdownUserNameRenderer"; }> | { readonly __typename: string; - } | null); - readonly username: (string | null); + } | null; + readonly username: string | null; } | { readonly __typename: string; readonly id: string; - } | null); - readonly viewer: ({ - readonly actor: ({ + } | null; + readonly viewer: { + readonly actor: { readonly __typename: "User"; readonly id: string; - readonly name: (string | null); - readonly nameRenderer: ({ - readonly __module_component_AnotherNameRendererFragment: (any | null); - readonly __module_operation_AnotherNameRendererFragment: (any | null); + readonly name: string | null; + readonly nameRenderer: { + readonly __module_component_AnotherNameRendererFragment: any | null; + readonly __module_operation_AnotherNameRendererFragment: any | null; readonly __typename: "PlainUserNameRenderer"; } | Local3DPayload<"AnotherNameRendererFragment", { readonly __typename: "PlainUserNameRenderer"; }> | { - readonly __module_component_AnotherNameRendererFragment: (any | null); - readonly __module_operation_AnotherNameRendererFragment: (any | null); + readonly __module_component_AnotherNameRendererFragment: any | null; + readonly __module_operation_AnotherNameRendererFragment: any | null; readonly __typename: "MarkdownUserNameRenderer"; } | Local3DPayload<"AnotherNameRendererFragment", { readonly __typename: "MarkdownUserNameRenderer"; }> | { readonly __typename: string; - } | null); + } | null; } | { readonly __typename: string; readonly id: string; - } | null); - } | null); + } | null; + } | null; }; export type Test = { rawResponse: Test$rawResponse; @@ -134,12 +134,12 @@ export type Test = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type AnotherNameRendererFragment$data = { - readonly name: (string | null); - readonly nameRenderer: ({ - readonly __fragmentPropName?: (string | null); - readonly __module_component?: (string | null); - readonly " $fragmentSpreads": FragmentRefs<("MarkdownUserNameRenderer_name" | "PlainUserNameRenderer_name")>; - } | null); + readonly name: string | null; + readonly nameRenderer: { + readonly __fragmentPropName?: string | null; + readonly __module_component?: string | null; + readonly " $fragmentSpreads": FragmentRefs<"MarkdownUserNameRenderer_name" | "PlainUserNameRenderer_name">; + } | null; readonly " $fragmentType": "AnotherNameRendererFragment"; }; export type AnotherNameRendererFragment$key = { @@ -149,10 +149,10 @@ export type AnotherNameRendererFragment$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type MarkdownUserNameRenderer_name$data = { - readonly data: ({ - readonly markup: (string | null); - } | null); - readonly markdown: (string | null); + readonly data: { + readonly markup: string | null; + } | null; + readonly markdown: string | null; readonly " $fragmentType": "MarkdownUserNameRenderer_name"; }; export type MarkdownUserNameRenderer_name$key = { @@ -163,11 +163,11 @@ export type MarkdownUserNameRenderer_name$key = { import { FragmentRefs } from "relay-runtime"; export type NameRendererFragment$data = { readonly id: string; - readonly nameRenderer: ({ - readonly __fragmentPropName?: (string | null); - readonly __module_component?: (string | null); - readonly " $fragmentSpreads": FragmentRefs<("MarkdownUserNameRenderer_name" | "PlainUserNameRenderer_name")>; - } | null); + readonly nameRenderer: { + readonly __fragmentPropName?: string | null; + readonly __module_component?: string | null; + readonly " $fragmentSpreads": FragmentRefs<"MarkdownUserNameRenderer_name" | "PlainUserNameRenderer_name">; + } | null; readonly " $fragmentType": "NameRendererFragment"; }; export type NameRendererFragment$key = { @@ -177,10 +177,10 @@ export type NameRendererFragment$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type PlainUserNameRenderer_name$data = { - readonly data: ({ - readonly text: (string | null); - } | null); - readonly plaintext: (string | null); + readonly data: { + readonly text: string | null; + } | null; + readonly plaintext: string | null; readonly " $fragmentType": "PlainUserNameRenderer_name"; }; export type PlainUserNameRenderer_name$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected index 074564f83ef3c..258883e076701 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected @@ -22,24 +22,24 @@ export type ExampleQuery$variables = { id: string; }; export type ExampleQuery$data = { - readonly node: ({ + readonly node: { readonly " $fragmentSpreads": FragmentRefs<"FriendFragment">; - } | null); + } | null; }; export type ExampleQuery$rawResponse = { - readonly node: ({ + readonly node: { readonly __typename: "User"; - readonly feedback: ({ + readonly feedback: { readonly id: string; - readonly name: (string | null); - } | null); + readonly name: string | null; + } | null; readonly id: string; - readonly lastName: (string | null); - readonly name: (string | null); + readonly lastName: string | null; + readonly name: string | null; } | { readonly __typename: string; readonly id: string; - } | null); + } | null; }; export type ExampleQuery = { rawResponse: ExampleQuery$rawResponse; @@ -49,12 +49,12 @@ export type ExampleQuery = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type FriendFragment$data = { - readonly feedback?: ({ + readonly feedback?: { readonly id: string; - readonly name: (string | null); - } | null); - readonly lastName?: (string | null); - readonly name?: (string | null); + readonly name: string | null; + } | null; + readonly lastName?: string | null; + readonly name?: string | null; readonly " $fragmentType": "FriendFragment"; }; export type FriendFragment$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected index 70aadab8195c8..d1d6ab5c14d2e 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-literal-conditional.expected @@ -27,20 +27,20 @@ export type ExampleQuery$variables = { id: string; }; export type ExampleQuery$data = { - readonly node: ({ - readonly friends?: ({ - readonly count: (number | null); - } | null); - readonly username: (string | null); + readonly node: { + readonly friends?: { + readonly count: number | null; + } | null; + readonly username: string | null; readonly " $fragmentSpreads": FragmentRefs<"FriendFragment">; - } | null); + } | null; }; export type ExampleQuery$rawResponse = { - readonly node: ({ + readonly node: { readonly __typename: string; readonly id: string; - readonly username: (string | null); - } | null); + readonly username: string | null; + } | null; }; export type ExampleQuery = { rawResponse: ExampleQuery$rawResponse; @@ -50,12 +50,12 @@ export type ExampleQuery = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type FriendFragment$data = { - readonly feedback?: ({ + readonly feedback?: { readonly id: string; - readonly name: (string | null); - } | null); - readonly lastName?: (string | null); - readonly name?: (string | null); + readonly name: string | null; + } | null; + readonly lastName?: string | null; + readonly name?: string | null; readonly " $fragmentType": "FriendFragment"; }; export type FriendFragment$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream-connection.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream-connection.expected index e0d92c0aeec17..0bac05ea84f3d 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream-connection.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream-connection.expected @@ -19,46 +19,46 @@ query TestDefer @raw_response_type { ==================================== OUTPUT =================================== export type TestDefer$variables = {}; export type TestDefer$data = { - readonly node: ({ - readonly friends?: ({ - readonly edges: (ReadonlyArray<({ - readonly node: ({ - readonly actor: ({ - readonly name: (string | null); - } | null); - } | null); - } | null)> | null); - } | null); - readonly name?: (string | null); - } | null); + readonly node: { + readonly friends?: { + readonly edges: ReadonlyArray<{ + readonly node: { + readonly actor: { + readonly name: string | null; + } | null; + } | null; + } | null> | null; + } | null; + readonly name?: string | null; + } | null; }; export type TestDefer$rawResponse = { - readonly node: ({ + readonly node: { readonly __typename: "User"; - readonly friends: ({ - readonly edges: (ReadonlyArray<({ - readonly cursor: (string | null); - readonly node: ({ + readonly friends: { + readonly edges: ReadonlyArray<{ + readonly cursor: string | null; + readonly node: { readonly __typename: "User"; - readonly actor: ({ + readonly actor: { readonly __typename: string; readonly id: string; - readonly name: (string | null); - } | null); + readonly name: string | null; + } | null; readonly id: string; - } | null); - } | null)> | null); - readonly pageInfo: ({ - readonly endCursor: (string | null); - readonly hasNextPage: (boolean | null); - } | null); - } | null); + } | null; + } | null> | null; + readonly pageInfo: { + readonly endCursor: string | null; + readonly hasNextPage: boolean | null; + } | null; + } | null; readonly id: string; - readonly name: (string | null); + readonly name: string | null; } | { readonly __typename: string; readonly id: string; - } | null); + } | null; }; export type TestDefer = { rawResponse: TestDefer$rawResponse; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream.expected index 93be9bfaf13e8..6fcf8a530242b 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream.expected @@ -20,39 +20,39 @@ query TestStream @raw_response_type { ==================================== OUTPUT =================================== export type TestStream$variables = {}; export type TestStream$data = { - readonly node: ({ - readonly friends?: ({ - readonly edges: (ReadonlyArray<({ - readonly node: ({ + readonly node: { + readonly friends?: { + readonly edges: ReadonlyArray<{ + readonly node: { readonly id: string; - } | null); - } | null)> | null); - } | null); - readonly name?: (string | null); - } | null); + } | null; + } | null> | null; + } | null; + readonly name?: string | null; + } | null; }; export type TestStream$rawResponse = { - readonly node: ({ + readonly node: { readonly __typename: "User"; - readonly friends: ({ - readonly edges: (ReadonlyArray<({ - readonly cursor: (string | null); - readonly node: ({ + readonly friends: { + readonly edges: ReadonlyArray<{ + readonly cursor: string | null; + readonly node: { readonly __typename: "User"; readonly id: string; - } | null); - } | null)> | null); - readonly pageInfo: ({ - readonly endCursor: (string | null); - readonly hasNextPage: (boolean | null); - } | null); - } | null); + } | null; + } | null> | null; + readonly pageInfo: { + readonly endCursor: string | null; + readonly hasNextPage: boolean | null; + } | null; + } | null; readonly id: string; - readonly name: (string | null); + readonly name: string | null; } | { readonly __typename: string; readonly id: string; - } | null); + } | null; }; export type TestStream = { rawResponse: TestStream$rawResponse; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected index 5706df721a0a5..560edd1993dc9 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable-fragment.expected @@ -12,9 +12,9 @@ export type RefetchableFragmentQuery$variables = { id: string; }; export type RefetchableFragmentQuery$data = { - readonly node: ({ + readonly node: { readonly " $fragmentSpreads": FragmentRefs<"RefetchableFragment">; - } | null); + } | null; }; export type RefetchableFragmentQuery = { response: RefetchableFragmentQuery$data; @@ -23,9 +23,9 @@ export type RefetchableFragmentQuery = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type RefetchableFragment$data = { - readonly fragAndField: ({ - readonly uri: (string | null); - } | null); + readonly fragAndField: { + readonly uri: string | null; + } | null; readonly id: string; readonly " $fragmentType": "RefetchableFragment"; }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected index 952db31861e15..7d3074e25d8f4 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/refetchable.expected @@ -12,9 +12,9 @@ export type FlowRefetchableFragmentQuery$variables = { id: string; }; export type FlowRefetchableFragmentQuery$data = { - readonly node: ({ + readonly node: { readonly " $fragmentSpreads": FragmentRefs<"FlowRefetchableFragment">; - } | null); + } | null; }; export type FlowRefetchableFragmentQuery = { response: FlowRefetchableFragmentQuery$data; @@ -24,7 +24,7 @@ export type FlowRefetchableFragmentQuery = { import { FragmentRefs } from "relay-runtime"; export type FlowRefetchableFragment$data = { readonly id: string; - readonly name?: (string | null); + readonly name?: string | null; readonly " $fragmentType": "FlowRefetchableFragment"; }; export type FlowRefetchableFragment$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected index e625279876da6..62dda3f6f56bc 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected @@ -32,25 +32,25 @@ export type RelayClientIDFieldQuery$variables = { }; export type RelayClientIDFieldQuery$data = { readonly __id: string; - readonly me: ({ + readonly me: { readonly __id: string; readonly __typename: string; readonly id: string; - } | null); - readonly node: ({ + } | null; + readonly node: { readonly __id: string; readonly __typename: string; - readonly commentBody?: ({ + readonly commentBody?: { readonly __id: string; readonly __typename: string; - readonly text?: ({ + readonly text?: { readonly __id: string; readonly __typename: string; - readonly text: (string | null); - } | null); - } | null); + readonly text: string | null; + } | null; + } | null; readonly id: string; - } | null); + } | null; }; export type RelayClientIDFieldQuery = { response: RelayClientIDFieldQuery$data; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected index 2fc76f98bdbdf..1f35e3a18c6f2 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected @@ -9,7 +9,7 @@ fragment Foo on Node { } ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; -export type Foo$data = ({ +export type Foo$data = { readonly __typename: "User"; readonly name: string; readonly " $fragmentType": "Foo"; @@ -18,7 +18,7 @@ export type Foo$data = ({ // value in case none of the concrete values match. readonly __typename: "%other"; readonly " $fragmentType": "Foo"; -} | null); +} | null; export type Foo$key = { readonly " $data"?: Foo$data; readonly " $fragmentSpreads": FragmentRefs<"Foo">; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-fragment.expected index 32749004a6b83..f9b05c336f7e9 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-fragment.expected @@ -5,11 +5,11 @@ fragment NonNullFragment on User { } ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; -export type NonNullFragment$data = ({ - readonly firstName: (string | null); +export type NonNullFragment$data = { + readonly firstName: string | null; readonly lastName: string; readonly " $fragmentType": "NonNullFragment"; -} | null); +} | null; export type NonNullFragment$key = { readonly " $data"?: NonNullFragment$data; readonly " $fragmentSpreads": FragmentRefs<"NonNullFragment">; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected index e7c4b32a9b240..b425616c395ac 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-item-in-plural-field.expected @@ -9,11 +9,11 @@ fragment NonNullFragment on User { ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; export type NonNullFragment$data = { - readonly firstName: (string | null); - readonly screennames: (ReadonlyArray<({ - readonly name: (string | null); + readonly firstName: string | null; + readonly screennames: ReadonlyArray<{ + readonly name: string | null; readonly service: string; - } | null)> | null); + } | null> | null; readonly " $fragmentType": "NonNullFragment"; }; export type NonNullFragment$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-query.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-query.expected index 055aa8fd236d1..c7ad970e126c4 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-query.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-to-query.expected @@ -7,12 +7,12 @@ query FooQuery { } ==================================== OUTPUT =================================== export type FooQuery$variables = {}; -export type FooQuery$data = ({ +export type FooQuery$data = { readonly me: { - readonly firstName: (string | null); + readonly firstName: string | null; readonly lastName: string; }; -} | null); +} | null; export type FooQuery = { response: FooQuery$data; variables: FooQuery$variables; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-up-to-mutation-response.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-up-to-mutation-response.expected index 9c7fc150331b2..f327c0dfc6819 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-up-to-mutation-response.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-up-to-mutation-response.expected @@ -8,26 +8,26 @@ mutation CommentCreateMutation($input: CommentCreateInput!) { } ==================================== OUTPUT =================================== export type CommentCreateInput = { - clientMutationId?: (string | null); - feedback?: (CommentfeedbackFeedback | null); - feedbackId?: (string | null); + clientMutationId?: string | null; + feedback?: CommentfeedbackFeedback | null; + feedbackId?: string | null; }; export type CommentfeedbackFeedback = { - comment?: (FeedbackcommentComment | null); + comment?: FeedbackcommentComment | null; }; export type FeedbackcommentComment = { - feedback?: (CommentfeedbackFeedback | null); + feedback?: CommentfeedbackFeedback | null; }; export type CommentCreateMutation$variables = { input: CommentCreateInput; }; -export type CommentCreateMutation$data = ({ +export type CommentCreateMutation$data = { readonly commentCreate: { readonly comment: { readonly id: string; }; }; -} | null); +} | null; export type CommentCreateMutation = { response: CommentCreateMutation$data; variables: CommentCreateMutation$variables; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected index 74f4cd75eaf6e..b5e72cbaf19c2 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected @@ -29,35 +29,35 @@ fragment Foo on Node { } ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; -export type Bar$data = ({ - readonly body?: ({ - readonly text: (string | null); - } | null); +export type Bar$data = { + readonly body?: { + readonly text: string | null; + } | null; readonly name?: string; readonly " $fragmentType": "Bar"; -} | null); +} | null; export type Bar$key = { readonly " $data"?: Bar$data; readonly " $fragmentSpreads": FragmentRefs<"Bar">; }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type Foo$data = ({ +export type Foo$data = { readonly __typename: "User"; readonly name: string; readonly " $fragmentType": "Foo"; } | { readonly __typename: "Comment"; - readonly body: ({ - readonly text: (string | null); - } | null); + readonly body: { + readonly text: string | null; + } | null; readonly " $fragmentType": "Foo"; } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly __typename: "%other"; readonly " $fragmentType": "Foo"; -} | null); +} | null; export type Foo$key = { readonly " $data"?: Foo$data; readonly " $fragmentSpreads": FragmentRefs<"Foo">; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-raw-response-type.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-raw-response-type.expected index b9026fa3495a3..f5d5a426c1e3c 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-raw-response-type.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-raw-response-type.expected @@ -7,17 +7,17 @@ query MyQuery @raw_response_type { } ==================================== OUTPUT =================================== export type MyQuery$variables = {}; -export type MyQuery$data = ({ +export type MyQuery$data = { readonly me: { readonly id: string; readonly name: string; }; -} | null); +} | null; export type MyQuery$rawResponse = { - readonly me: ({ + readonly me: { readonly id: string; - readonly name: (string | null); - } | null); + readonly name: string | null; + } | null; }; export type MyQuery = { rawResponse: MyQuery$rawResponse; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected index f0a86b3a63dc6..a3f8eacc5264e 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-fragment.expected @@ -6,7 +6,7 @@ fragment NonNullFragment on User { ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; export type NonNullFragment$data = { - readonly firstName: (string | null); + readonly firstName: string | null; readonly lastName: string; readonly " $fragmentType": "NonNullFragment"; }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-query.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-query.expected index ca605064b605a..e0dddc98dfa25 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-query.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throw-doesnt-bubbles-to-query.expected @@ -9,8 +9,8 @@ query FooQuery { export type FooQuery$variables = {}; export type FooQuery$data = { readonly me: { - readonly firstName: (string | null); - readonly lastName: (string | null); + readonly firstName: string | null; + readonly lastName: string | null; }; }; export type FooQuery = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throws-nested.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throws-nested.expected index 98113e8fbf876..6c602d0fcfdfe 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throws-nested.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-throws-nested.expected @@ -8,10 +8,10 @@ query FooQuery { ==================================== OUTPUT =================================== export type FooQuery$variables = {}; export type FooQuery$data = { - readonly me: ({ - readonly firstName: (string | null); + readonly me: { + readonly firstName: string | null; readonly lastName: string; - } | null); + } | null; }; export type FooQuery = { response: FooQuery$data; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required.expected index 6c960c8adfb53..febb24d387312 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required.expected @@ -8,10 +8,10 @@ query FooQuery { ==================================== OUTPUT =================================== export type FooQuery$variables = {}; export type FooQuery$data = { - readonly me: ({ - readonly firstName: (string | null); + readonly me: { + readonly firstName: string | null; readonly lastName: string; - } | null); + } | null; }; export type FooQuery = { response: FooQuery$data; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected index f838a70863a51..6f969da70a31c 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/roots.expected @@ -29,9 +29,9 @@ export type ExampleQuery$variables = { id: string; }; export type ExampleQuery$data = { - readonly node: ({ + readonly node: { readonly id: string; - } | null); + } | null; }; export type ExampleQuery = { response: ExampleQuery$data; @@ -39,25 +39,25 @@ export type ExampleQuery = { }; ------------------------------------------------------------------------------- export type CommentCreateInput = { - clientMutationId?: (string | null); - feedback?: (CommentfeedbackFeedback | null); - feedbackId?: (string | null); + clientMutationId?: string | null; + feedback?: CommentfeedbackFeedback | null; + feedbackId?: string | null; }; export type CommentfeedbackFeedback = { - comment?: (FeedbackcommentComment | null); + comment?: FeedbackcommentComment | null; }; export type FeedbackcommentComment = { - feedback?: (CommentfeedbackFeedback | null); + feedback?: CommentfeedbackFeedback | null; }; export type TestMutation$variables = { input: CommentCreateInput; }; export type TestMutation$data = { - readonly commentCreate: ({ - readonly comment: ({ + readonly commentCreate: { + readonly comment: { readonly id: string; - } | null); - } | null); + } | null; + } | null; }; export type TestMutation = { response: TestMutation$data; @@ -65,18 +65,18 @@ export type TestMutation = { }; ------------------------------------------------------------------------------- export type FeedbackLikeInput = { - clientMutationId?: (string | null); - feedbackId?: (string | null); + clientMutationId?: string | null; + feedbackId?: string | null; }; export type TestSubscription$variables = { - input?: (FeedbackLikeInput | null); + input?: FeedbackLikeInput | null; }; export type TestSubscription$data = { - readonly feedbackLikeSubscribe: ({ - readonly feedback: ({ + readonly feedbackLikeSubscribe: { + readonly feedback: { readonly id: string; - } | null); - } | null); + } | null; + } | null; }; export type TestSubscription = { response: TestSubscription$data; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/scalar-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/scalar-field.expected index 82237c66ee515..637736a3fa527 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/scalar-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/scalar-field.expected @@ -13,20 +13,20 @@ fragment ScalarField on User { } } ==================================== OUTPUT =================================== -export type PersonalityTraits = ("CHEERFUL" | "DERISIVE" | "HELPFUL" | "SNARKY" | "%future added value"); +export type PersonalityTraits = "CHEERFUL" | "DERISIVE" | "HELPFUL" | "SNARKY" | "%future added value"; import { FragmentRefs } from "relay-runtime"; export type ScalarField$data = { - readonly aliasedLinkedField: ({ - readonly aliasedField: (number | null); - } | null); + readonly aliasedLinkedField: { + readonly aliasedField: number | null; + } | null; readonly id: string; - readonly name: (string | null); - readonly screennames: (ReadonlyArray<({ - readonly name: (string | null); - readonly service: (string | null); - } | null)> | null); - readonly traits: (ReadonlyArray<(PersonalityTraits | null)> | null); - readonly websites: (ReadonlyArray<(string | null)> | null); + readonly name: string | null; + readonly screennames: ReadonlyArray<{ + readonly name: string | null; + readonly service: string | null; + } | null> | null; + readonly traits: ReadonlyArray | null; + readonly websites: ReadonlyArray | null; readonly " $fragmentType": "ScalarField"; }; export type ScalarField$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/simple.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/simple.expected index b9470b7070726..80bf7da3fc268 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/simple.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/simple.expected @@ -10,12 +10,12 @@ fragment LinkedField on User { ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; export type LinkedField$data = { - readonly name: (string | null); - readonly profilePicture: ({ - readonly height: (number | null); - readonly uri: (string | null); - readonly width: (number | null); - } | null); + readonly name: string | null; + readonly profilePicture: { + readonly height: number | null; + readonly uri: string | null; + readonly width: number | null; + } | null; readonly " $fragmentType": "LinkedField"; }; export type LinkedField$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected index bfe3cfd692705..023c13577e336 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-inside-with-overlapping-fields.expected @@ -18,22 +18,22 @@ fragment TypenameInsideWithOverlappingFields on Viewer { ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; export type TypenameInsideWithOverlappingFields$data = { - readonly actor: ({ + readonly actor: { readonly __typename: "Page"; readonly id: string; - readonly name: (string | null); + readonly name: string | null; } | { readonly __typename: "User"; readonly id: string; - readonly name: (string | null); - readonly profile_picture: ({ - readonly uri: (string | null); - } | null); + readonly name: string | null; + readonly profile_picture: { + readonly uri: string | null; + } | null; } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly __typename: "%other"; - } | null); + } | null; readonly " $fragmentType": "TypenameInsideWithOverlappingFields"; }; export type TypenameInsideWithOverlappingFields$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected index 65506f9385c2b..4df10506f2c10 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected @@ -81,35 +81,35 @@ fragment TypenameAliases on Actor { } ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; -export type TypenameAlias$data = ({ +export type TypenameAlias$data = { readonly _typeAlias: "User"; - readonly firstName: (string | null); + readonly firstName: string | null; readonly " $fragmentType": "TypenameAlias"; } | { readonly _typeAlias: "Page"; - readonly username: (string | null); + readonly username: string | null; readonly " $fragmentType": "TypenameAlias"; } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly _typeAlias: "%other"; readonly " $fragmentType": "TypenameAlias"; -}); +}; export type TypenameAlias$key = { readonly " $data"?: TypenameAlias$data; readonly " $fragmentSpreads": FragmentRefs<"TypenameAlias">; }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type TypenameAliases$data = ({ +export type TypenameAliases$data = { readonly _typeAlias1: "User"; readonly _typeAlias2: "User"; - readonly firstName: (string | null); + readonly firstName: string | null; readonly " $fragmentType": "TypenameAliases"; } | { readonly _typeAlias1: "Page"; readonly _typeAlias2: "Page"; - readonly username: (string | null); + readonly username: string | null; readonly " $fragmentType": "TypenameAliases"; } | { // This will never be '%other', but we need some @@ -119,47 +119,47 @@ export type TypenameAliases$data = ({ // value in case none of the concrete values match. readonly _typeAlias2: "%other"; readonly " $fragmentType": "TypenameAliases"; -}); +}; export type TypenameAliases$key = { readonly " $data"?: TypenameAliases$data; readonly " $fragmentSpreads": FragmentRefs<"TypenameAliases">; }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type TypenameInside$data = ({ +export type TypenameInside$data = { readonly __typename: "User"; - readonly firstName: (string | null); + readonly firstName: string | null; readonly " $fragmentType": "TypenameInside"; } | { readonly __typename: "Page"; - readonly username: (string | null); + readonly username: string | null; readonly " $fragmentType": "TypenameInside"; } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly __typename: "%other"; readonly " $fragmentType": "TypenameInside"; -}); +}; export type TypenameInside$key = { readonly " $data"?: TypenameInside$data; readonly " $fragmentSpreads": FragmentRefs<"TypenameInside">; }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type TypenameOutside$data = ({ +export type TypenameOutside$data = { readonly __typename: "User"; - readonly firstName: (string | null); + readonly firstName: string | null; readonly " $fragmentType": "TypenameOutside"; } | { readonly __typename: "Page"; - readonly username: (string | null); + readonly username: string | null; readonly " $fragmentType": "TypenameOutside"; } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly __typename: "%other"; readonly " $fragmentType": "TypenameOutside"; -}); +}; export type TypenameOutside$key = { readonly " $data"?: TypenameOutside$data; readonly " $fragmentSpreads": FragmentRefs<"TypenameOutside">; @@ -168,13 +168,13 @@ export type TypenameOutside$key = { import { FragmentRefs } from "relay-runtime"; export type TypenameOutsideWithAbstractType$data = { readonly __typename: string; - readonly address?: ({ - readonly city: (string | null); - readonly country: (string | null); - readonly street?: (string | null); - } | null); - readonly firstName?: (string | null); - readonly username?: (string | null); + readonly address?: { + readonly city: string | null; + readonly country: string | null; + readonly street?: string | null; + } | null; + readonly firstName?: string | null; + readonly username?: string | null; readonly " $fragmentType": "TypenameOutsideWithAbstractType"; }; export type TypenameOutsideWithAbstractType$key = { @@ -185,9 +185,9 @@ export type TypenameOutsideWithAbstractType$key = { import { FragmentRefs } from "relay-runtime"; export type TypenameWithCommonSelections$data = { readonly __typename: string; - readonly firstName?: (string | null); - readonly name: (string | null); - readonly username?: (string | null); + readonly firstName?: string | null; + readonly name: string | null; + readonly username?: string | null; readonly " $fragmentType": "TypenameWithCommonSelections"; }; export type TypenameWithCommonSelections$key = { @@ -198,7 +198,7 @@ export type TypenameWithCommonSelections$key = { import { FragmentRefs } from "relay-runtime"; export type TypenameWithoutSpreads$data = { readonly __typename: "User"; - readonly firstName: (string | null); + readonly firstName: string | null; readonly " $fragmentType": "TypenameWithoutSpreads"; }; export type TypenameWithoutSpreads$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected index 5242032b13727..795c86daf8409 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/unmasked-fragment-spreads.expected @@ -28,8 +28,8 @@ fragment AnotherRecursiveFragment on Image { ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; export type AnotherRecursiveFragment$data = { - readonly height: (number | null); - readonly uri: (string | null); + readonly height: number | null; + readonly uri: string | null; readonly " $fragmentType": "AnotherRecursiveFragment"; }; export type AnotherRecursiveFragment$key = { @@ -39,8 +39,8 @@ export type AnotherRecursiveFragment$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type PhotoFragment$data = { - readonly uri: (string | null); - readonly width: (number | null); + readonly uri: string | null; + readonly width: number | null; readonly " $fragmentType": "PhotoFragment"; }; export type PhotoFragment$key = { @@ -50,8 +50,8 @@ export type PhotoFragment$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type RecursiveFragment$data = { - readonly uri: (string | null); - readonly width: (number | null); + readonly uri: string | null; + readonly width: number | null; }; export type RecursiveFragment$key = { readonly " $data"?: RecursiveFragment$data; @@ -60,12 +60,12 @@ export type RecursiveFragment$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type UserProfile$data = { - readonly profilePicture: ({ - readonly height: (number | null); - readonly uri: (string | null); - readonly width: (number | null); + readonly profilePicture: { + readonly height: number | null; + readonly uri: string | null; + readonly width: number | null; readonly " $fragmentSpreads": FragmentRefs<"PhotoFragment">; - } | null); + } | null; readonly " $fragmentType": "UserProfile"; }; export type UserProfile$key = { From dbbfc3f2e361b049db9ed11917c1f558e13e20c9 Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Wed, 2 Mar 2022 15:42:59 +0100 Subject: [PATCH 39/41] Impl Ord for AST in typegen, sort all unions and intersections. --- compiler/crates/relay-typegen/src/flow.rs | 13 +-- compiler/crates/relay-typegen/src/lib.rs | 53 +++++---- .../crates/relay-typegen/src/typescript.rs | 102 +++++++++++------- compiler/crates/relay-typegen/src/writer.rs | 50 +++++++-- ...with-response-on-inline-fragments.expected | 16 +-- .../fixtures/query-with-handles.expected | 12 +-- .../fixtures/query-with-match-fields.expected | 26 ++--- .../fixtures/query-with-module-field.expected | 14 +-- .../query-with-multiple-match-fields.expected | 52 ++++----- ...-with-raw-response-on-conditional.expected | 6 +- .../query-with-stream-connection.expected | 6 +- .../fixtures/query-with-stream.expected | 6 +- ...solates-concrete-inline-fragments.expected | 8 +- .../fixtures/typename-on-union.expected | 34 +++--- ...gnable-fragments-within-narrowing.expected | 12 +-- ...ion-multiple-assignable-fragments.expected | 8 +- ...with-response-on-inline-fragments.expected | 16 +-- .../fixtures/query-with-handles.expected | 12 +-- .../fixtures/query-with-match-fields.expected | 22 ++-- .../fixtures/query-with-module-field.expected | 10 +- .../query-with-multiple-match-fields.expected | 44 ++++---- ...-with-raw-response-on-conditional.expected | 6 +- .../query-with-stream-connection.expected | 6 +- .../fixtures/query-with-stream.expected | 6 +- ...solates-concrete-inline-fragments.expected | 8 +- .../fixtures/typename-on-union.expected | 34 +++--- 26 files changed, 324 insertions(+), 258 deletions(-) diff --git a/compiler/crates/relay-typegen/src/flow.rs b/compiler/crates/relay-typegen/src/flow.rs index c571b7ab38776..d0fa236ddb8e6 100644 --- a/compiler/crates/relay-typegen/src/flow.rs +++ b/compiler/crates/relay-typegen/src/flow.rs @@ -340,6 +340,7 @@ mod tests { use crate::writer::{ExactObject, InexactObject, KeyValuePairProp}; use super::*; + use crate::AstList; use intern::string_key::Intern; fn print_type(ast: &AST) -> String { @@ -358,7 +359,7 @@ mod tests { #[test] fn union_type() { assert_eq!( - print_type(&AST::Union(vec![AST::String, AST::Number])), + print_type(&AST::Union(AstList::sorted(vec![AST::String, AST::Number]))), "(string | number)".to_string() ); } @@ -379,10 +380,10 @@ mod tests { ); assert_eq!( - print_type(&AST::Nullable(Box::new(AST::Union(vec![ + print_type(&AST::Nullable(Box::new(AST::Union(AstList::sorted(vec![ AST::String, AST::Number, - ])))), + ]))))), "?(string | number)" ) } @@ -395,10 +396,10 @@ mod tests { key: "key".intern(), optional: false, read_only: false, - value: AST::Intersection(vec![ - AST::Union(vec![AST::String, AST::Number]), + value: AST::Intersection(AstList::sorted(vec![ + AST::Union(AstList::sorted(vec![AST::String, AST::Number])), AST::Boolean - ]) + ])) })], true ))), diff --git a/compiler/crates/relay-typegen/src/lib.rs b/compiler/crates/relay-typegen/src/lib.rs index 2ffd072c30c6f..b9b29032844d7 100644 --- a/compiler/crates/relay-typegen/src/lib.rs +++ b/compiler/crates/relay-typegen/src/lib.rs @@ -13,6 +13,7 @@ mod flow; mod typescript; mod writer; +use crate::writer::AstList; use ::intern::{ intern, string_key::{Intern, StringKey}, @@ -228,6 +229,7 @@ impl<'a> TypeGenerator<'a> { TypegenLanguage::TypeScript => Box::new(TypeScriptPrinter::new( typegen_config, should_sort_typegen_items, + should_sort_typegen_items, )), }, has_actor_change: false, @@ -979,7 +981,7 @@ impl<'a> TypeGenerator<'a> { types.push(selection_map_values); } - AST::Union( + AST::Union(AstList::new( types .into_iter() .map(|mut props: Vec| { @@ -1001,7 +1003,8 @@ impl<'a> TypeGenerator<'a> { } }) .collect(), - ) + self.should_sort_typegen_items, + )) } fn raw_response_selections_to_babel( @@ -1070,7 +1073,7 @@ impl<'a> TypeGenerator<'a> { self.append_local_3d_payload(&mut types, &base_fields, concrete_type); } - AST::Union(types) + AST::Union(AstList::new(types, self.should_sort_typegen_items)) } fn append_local_3d_payload( @@ -1139,7 +1142,7 @@ impl<'a> TypeGenerator<'a> { AST::RawType(intern!("null | void")) } } else { - let setter_parameter = AST::Union( + let setter_parameter = AST::Union(AstList::new( just_fragments .iter() .map(|fragment_spread| { @@ -1177,7 +1180,7 @@ impl<'a> TypeGenerator<'a> { client_id_field, ], self.should_sort_typegen_items)) }) - .collect(), + .collect(), self.should_sort_typegen_items) ); if linked_field.node_type.is_list() { AST::ReadOnlyArray(Box::new(setter_parameter)) @@ -1500,12 +1503,14 @@ impl<'a> TypeGenerator<'a> { self.writer.write_export_type( enum_type.name.lookup(), - &AST::Union( + &AST::Union(AstList::new( members .into_iter() .map(|key| AST::StringLiteral(key)) .collect(), - ), + // Sort above to always put FUTURE_ENUM_VALUE last. + false, + )), )?; } } @@ -1761,13 +1766,16 @@ impl<'a> TypeGenerator<'a> { ], self.should_sort_typegen_items, )); - let return_type = AST::Union(vec![ - AST::InexactObject(InexactObject::new( - vec![id_prop, fragment_spread_prop, return_value_discriminator], - self.should_sort_typegen_items, - )), - AST::RawType(intern!("false")), - ]); + let return_type = AST::Union(AstList::new( + vec![ + AST::InexactObject(InexactObject::new( + vec![id_prop, fragment_spread_prop, return_value_discriminator], + self.should_sort_typegen_items, + )), + AST::RawType(intern!("false")), + ], + false, + )); let (open_comment, close_comment) = match self.typegen_config.language { TypegenLanguage::Flow => ("/*", "*/"), @@ -1850,13 +1858,16 @@ impl<'a> TypeGenerator<'a> { ], self.should_sort_typegen_items, )); - let return_type = AST::Union(vec![ - AST::InexactObject(InexactObject::new( - vec![id_prop, fragment_spread_prop, return_value_discriminator], - self.should_sort_typegen_items, - )), - AST::RawType(intern!("false")), - ]); + let return_type = AST::Union(AstList::new( + vec![ + AST::InexactObject(InexactObject::new( + vec![id_prop, fragment_spread_prop, return_value_discriminator], + self.should_sort_typegen_items, + )), + AST::RawType(intern!("false")), + ], + false, + )); let (open_comment, close_comment) = match self.typegen_config.language { TypegenLanguage::Flow => ("/*", "*/"), diff --git a/compiler/crates/relay-typegen/src/typescript.rs b/compiler/crates/relay-typegen/src/typescript.rs index 1c4b2552d9b8d..0b9c0aada5d55 100644 --- a/compiler/crates/relay-typegen/src/typescript.rs +++ b/compiler/crates/relay-typegen/src/typescript.rs @@ -6,7 +6,7 @@ */ use crate::writer::{Prop, Writer, AST}; -use crate::TypegenConfig; +use crate::{AstList, TypegenConfig}; use crate::{KEY_DATA, KEY_FRAGMENT_SPREADS, KEY_FRAGMENT_TYPE}; use intern::string_key::{Intern, StringKey}; use itertools::Itertools; @@ -14,6 +14,7 @@ use std::fmt::{Result as FmtResult, Write}; pub struct TypeScriptPrinter { result: String, + should_sort_typegen_items: bool, use_import_type_syntax: bool, indentation: usize, should_wrap_unions_in_parentheses: bool, @@ -92,11 +93,16 @@ impl Writer for TypeScriptPrinter { } impl TypeScriptPrinter { - pub fn new(config: &TypegenConfig, should_wrap_unions_in_parentheses: bool) -> Self { + pub fn new( + config: &TypegenConfig, + should_sort_typegen_items: bool, + should_wrap_unions_in_parentheses: bool, + ) -> Self { Self { result: String::new(), indentation: 0, use_import_type_syntax: config.use_import_type_syntax, + should_sort_typegen_items, should_wrap_unions_in_parentheses, } } @@ -282,12 +288,13 @@ impl TypeScriptPrinter { fn write_fragment_references(&mut self, fragments: &[StringKey]) -> FmtResult { write!(&mut self.result, "FragmentRefs<")?; self.write_ast( - &AST::Union( + &AST::Union(AstList::new( fragments .iter() .map(|key| AST::StringLiteral(*key)) .collect(), - ), + self.should_sort_typegen_items, + )), false, )?; write!(&mut self.result, ">") @@ -309,7 +316,7 @@ impl TypeScriptPrinter { #[cfg(test)] mod tests { - use crate::writer::{ExactObject, InexactObject, KeyValuePairProp}; + use crate::writer::{AstList, ExactObject, InexactObject, KeyValuePairProp}; use super::*; use intern::string_key::Intern; @@ -319,7 +326,7 @@ mod tests { } fn print_type_with_config(ast: &AST, config: &TypegenConfig) -> String { - let mut printer = Box::new(TypeScriptPrinter::new(config, true)); + let mut printer = Box::new(TypeScriptPrinter::new(config, true, true)); printer.write(ast).unwrap(); printer.into_string() } @@ -334,7 +341,10 @@ mod tests { #[test] fn union_type() { assert_eq!( - print_type(&AST::Union(vec![AST::String, AST::Number])), + print_type(&AST::Union(AstList::new( + vec![AST::String, AST::Number], + true + ))), "(string | number)".to_string() ); } @@ -355,10 +365,10 @@ mod tests { ); assert_eq!( - print_type(&AST::Nullable(Box::new(AST::Union(vec![ - AST::String, - AST::Number, - ])))), + print_type(&AST::Nullable(Box::new(AST::Union(AstList::new( + vec![AST::String, AST::Number,], + true + ))))), "(string | number | null)" ) } @@ -366,26 +376,29 @@ mod tests { #[test] fn intersections() { assert_eq!( - print_type(&AST::Intersection(vec![ - AST::ExactObject(ExactObject::new( - vec![Prop::KeyValuePair(KeyValuePairProp { - key: "first".intern(), - optional: false, - read_only: false, - value: AST::String - })], - true - )), - AST::ExactObject(ExactObject::new( - vec![Prop::KeyValuePair(KeyValuePairProp { - key: "second".intern(), - optional: false, - read_only: false, - value: AST::Number - })], - true - )), - ])), + print_type(&AST::Intersection(AstList::new( + vec![ + AST::ExactObject(ExactObject::new( + vec![Prop::KeyValuePair(KeyValuePairProp { + key: "first".intern(), + optional: false, + read_only: false, + value: AST::String + })], + true + )), + AST::ExactObject(ExactObject::new( + vec![Prop::KeyValuePair(KeyValuePairProp { + key: "second".intern(), + optional: false, + read_only: false, + value: AST::Number + })], + true + )), + ], + true + ))), r"({ first: string; } & { @@ -394,8 +407,8 @@ mod tests { ); assert_eq!( - print_type(&AST::Intersection(vec![ - AST::Union(vec![ + print_type(&AST::Intersection(AstList::sorted(vec![ + AST::Union(AstList::sorted(vec![ AST::ExactObject(ExactObject::new( vec![Prop::KeyValuePair(KeyValuePairProp { key: "first".intern(), @@ -414,7 +427,7 @@ mod tests { })], true )), - ]), + ],)), AST::ExactObject(ExactObject::new( vec![Prop::KeyValuePair(KeyValuePairProp { key: "third".intern(), @@ -424,7 +437,7 @@ mod tests { })], true )), - ],)), + ]),)), r"(({ first: string; } | { @@ -443,10 +456,10 @@ mod tests { key: "key".intern(), optional: false, read_only: false, - value: AST::Intersection(vec![ - AST::Union(vec![AST::String, AST::Number]), + value: AST::Intersection(AstList::sorted(vec![ + AST::Union(AstList::sorted(vec![AST::String, AST::Number])), AST::Boolean - ]) + ])) })], true ))), @@ -624,7 +637,11 @@ mod tests { #[test] fn import_type() { - let mut printer = Box::new(TypeScriptPrinter::new(&TypegenConfig::default(), true)); + let mut printer = Box::new(TypeScriptPrinter::new( + &TypegenConfig::default(), + true, + true, + )); printer.write_import_type(&["A", "B"], "module").unwrap(); assert_eq!(printer.into_string(), "import { A, B } from \"module\";\n"); @@ -634,6 +651,7 @@ mod tests { ..Default::default() }, true, + true, )); printer.write_import_type(&["C"], "./foo").unwrap(); assert_eq!(printer.into_string(), "import type { C } from \"./foo\";\n"); @@ -641,7 +659,11 @@ mod tests { #[test] fn import_module() { - let mut printer = Box::new(TypeScriptPrinter::new(&TypegenConfig::default(), true)); + let mut printer = Box::new(TypeScriptPrinter::new( + &TypegenConfig::default(), + true, + true, + )); printer.write_import_module_default("A", "module").unwrap(); assert_eq!(printer.into_string(), "import A from \"module\";\n"); } diff --git a/compiler/crates/relay-typegen/src/writer.rs b/compiler/crates/relay-typegen/src/writer.rs index 06f56de613478..d469617e6d42b 100644 --- a/compiler/crates/relay-typegen/src/writer.rs +++ b/compiler/crates/relay-typegen/src/writer.rs @@ -11,13 +11,13 @@ use std::{ ops::{Deref, DerefMut}, }; -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)] pub enum AST { - Union(Vec), + Union(AstList), // Intersection variant added in preparation for better support for abstract types. // See https://github.com/facebook/relay/pull/3280 #[allow(dead_code)] - Intersection(Vec), + Intersection(AstList), ReadOnlyArray(Box), Nullable(Box), NonNullable(Box), @@ -41,7 +41,39 @@ pub enum AST { ActorChangePoint(Box), } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)] +pub struct AstList(Vec); + +impl Deref for AstList { + type Target = Vec; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +impl DerefMut for AstList { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} + +impl AstList { + pub fn new(mut members: Vec, should_sort: bool) -> Self { + if should_sort { + members.sort(); + } + + Self(members) + } + + #[cfg(test)] + pub fn sorted(members: Vec) -> Self { + Self::new(members, true) + } +} + +#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)] pub struct ExactObject(Vec); impl Deref for ExactObject { @@ -67,7 +99,7 @@ impl ExactObject { } } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)] pub struct InexactObject(Vec); impl Deref for InexactObject { @@ -110,14 +142,14 @@ fn sort_props(props: &mut Vec) { }); } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)] pub enum Prop { KeyValuePair(KeyValuePairProp), Spread(SpreadProp), GetterSetterPair(GetterSetterPairProp), } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)] pub struct KeyValuePairProp { pub key: StringKey, pub value: AST, @@ -125,12 +157,12 @@ pub struct KeyValuePairProp { pub optional: bool, } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)] pub struct SpreadProp { pub value: StringKey, } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)] pub struct GetterSetterPairProp { pub key: StringKey, pub getter_return_value: AST, diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-response-on-inline-fragments.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-response-on-inline-fragments.expected index 63b30812c5c6c..f6e876363cb03 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-response-on-inline-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/mutation-with-response-on-inline-fragments.expected @@ -55,12 +55,8 @@ export type TestMutation$rawResponse = {| +commentCreate: ?{| +viewer: ?{| +actor: ?({| - +__isActor: "User", - +__typename: "User", - +hometown: ?{| - +id: string, - +name: ?string, - |}, + +__isActor: string, + +__typename: string, +id: string, |} | {| +__isActor: "Page", @@ -74,8 +70,12 @@ export type TestMutation$rawResponse = {| +id: string, +name: ?string, |} | {| - +__isActor: string, - +__typename: string, + +__isActor: "User", + +__typename: "User", + +hometown: ?{| + +id: string, + +name: ?string, + |}, +id: string, |}), |}, diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-handles.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-handles.expected index 1a26fc755d2f0..8649bc27a7c2d 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-handles.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-handles.expected @@ -29,14 +29,14 @@ export type LinkedHandleField$data = {| |}; export type LinkedHandleField$rawResponse = {| +node: ?({| + +__typename: string, + +id: string, + |} | {| +__typename: "User", +friends: ?{| +count: ?number, |}, +id: string, - |} | {| - +__typename: string, - +id: string, |}), |}; export type LinkedHandleField = {| @@ -55,12 +55,12 @@ export type ScalarHandleField$data = {| |}; export type ScalarHandleField$rawResponse = {| +node: ?({| - +__typename: "User", + +__typename: string, +id: string, - +name: ?string, |} | {| - +__typename: string, + +__typename: "User", +id: string, + +name: ?string, |}), |}; export type ScalarHandleField = {| diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-match-fields.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-match-fields.expected index bc41c7b1ef4b1..726ae5081cb4b 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-match-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-match-fields.expected @@ -46,14 +46,15 @@ export type MarkdownUserNameRenderer_name = {| |}; export type Test$rawResponse = {| +node: ?({| + +__typename: string, + +id: string, + |} | {| +__typename: "User", +id: string, - +nameRenderer: ?({| - +__module_component_NameRendererFragment: ?any, - +__module_operation_NameRendererFragment: ?any, - +__typename: "PlainUserNameRenderer", - ...PlainUserNameRenderer_name, - |} | Local3DPayload<"NameRendererFragment", {| + +nameRenderer: ?(Local3DPayload<"NameRendererFragment", {| + +__typename: "MarkdownUserNameRenderer", + ...MarkdownUserNameRenderer_name, + |}> | Local3DPayload<"NameRendererFragment", {| +__typename: "PlainUserNameRenderer", ...PlainUserNameRenderer_name, |}> | {| @@ -61,15 +62,14 @@ export type Test$rawResponse = {| +__module_operation_NameRendererFragment: ?any, +__typename: "MarkdownUserNameRenderer", ...MarkdownUserNameRenderer_name, - |} | Local3DPayload<"NameRendererFragment", {| - +__typename: "MarkdownUserNameRenderer", - ...MarkdownUserNameRenderer_name, - |}> | {| + |} | {| + +__module_component_NameRendererFragment: ?any, + +__module_operation_NameRendererFragment: ?any, + +__typename: "PlainUserNameRenderer", + ...PlainUserNameRenderer_name, + |} | {| +__typename: string, |}), - |} | {| - +__typename: string, - +id: string, |}), |}; export type Test = {| diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-module-field.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-module-field.expected index 96c1ada3cb09d..b813672532ad0 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-module-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-module-field.expected @@ -31,18 +31,18 @@ export type Test_userRenderer = {| |}; export type Test$rawResponse = {| +node: ?({| + +__typename: string, + +id: string, + |} | {| +__typename: "User", +id: string, - +plainUserRenderer: ?({| + +plainUserRenderer: ?(Local3DPayload<"Test_user", {| + ...Test_userRenderer, + |}> | {| +__module_component_Test_user: ?any, +__module_operation_Test_user: ?any, ...Test_userRenderer, - |} | Local3DPayload<"Test_user", {| - ...Test_userRenderer, - |}>), - |} | {| - +__typename: string, - +id: string, + |}), |}), |}; export type Test = {| diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-multiple-match-fields.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-multiple-match-fields.expected index 1c0b611469eba..4e60343797bde 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-multiple-match-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-multiple-match-fields.expected @@ -74,14 +74,15 @@ export type MarkdownUserNameRenderer_name = {| |}; export type Test$rawResponse = {| +node: ?({| + +__typename: string, + +id: string, + |} | {| +__typename: "User", +id: string, - +nameRenderer: ?({| - +__module_component_NameRendererFragment: ?any, - +__module_operation_NameRendererFragment: ?any, - +__typename: "PlainUserNameRenderer", - ...PlainUserNameRenderer_name, - |} | Local3DPayload<"NameRendererFragment", {| + +nameRenderer: ?(Local3DPayload<"NameRendererFragment", {| + +__typename: "MarkdownUserNameRenderer", + ...MarkdownUserNameRenderer_name, + |}> | Local3DPayload<"NameRendererFragment", {| +__typename: "PlainUserNameRenderer", ...PlainUserNameRenderer_name, |}> | {| @@ -89,28 +90,28 @@ export type Test$rawResponse = {| +__module_operation_NameRendererFragment: ?any, +__typename: "MarkdownUserNameRenderer", ...MarkdownUserNameRenderer_name, - |} | Local3DPayload<"NameRendererFragment", {| - +__typename: "MarkdownUserNameRenderer", - ...MarkdownUserNameRenderer_name, - |}> | {| + |} | {| + +__module_component_NameRendererFragment: ?any, + +__module_operation_NameRendererFragment: ?any, + +__typename: "PlainUserNameRenderer", + ...PlainUserNameRenderer_name, + |} | {| +__typename: string, |}), +username: ?string, - |} | {| - +__typename: string, - +id: string, |}), +viewer: ?{| +actor: ?({| + +__typename: string, + +id: string, + |} | {| +__typename: "User", +id: string, +name: ?string, - +nameRenderer: ?({| - +__module_component_AnotherNameRendererFragment: ?any, - +__module_operation_AnotherNameRendererFragment: ?any, - +__typename: "PlainUserNameRenderer", - ...PlainUserNameRenderer_name, - |} | Local3DPayload<"AnotherNameRendererFragment", {| + +nameRenderer: ?(Local3DPayload<"AnotherNameRendererFragment", {| + +__typename: "MarkdownUserNameRenderer", + ...MarkdownUserNameRenderer_name, + |}> | Local3DPayload<"AnotherNameRendererFragment", {| +__typename: "PlainUserNameRenderer", ...PlainUserNameRenderer_name, |}> | {| @@ -118,15 +119,14 @@ export type Test$rawResponse = {| +__module_operation_AnotherNameRendererFragment: ?any, +__typename: "MarkdownUserNameRenderer", ...MarkdownUserNameRenderer_name, - |} | Local3DPayload<"AnotherNameRendererFragment", {| - +__typename: "MarkdownUserNameRenderer", - ...MarkdownUserNameRenderer_name, - |}> | {| + |} | {| + +__module_component_AnotherNameRendererFragment: ?any, + +__module_operation_AnotherNameRendererFragment: ?any, + +__typename: "PlainUserNameRenderer", + ...PlainUserNameRenderer_name, + |} | {| +__typename: string, |}), - |} | {| - +__typename: string, - +id: string, |}), |}, |}; diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-conditional.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-conditional.expected index 445990cd1e0a7..b73f97f053b4c 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-raw-response-on-conditional.expected @@ -28,6 +28,9 @@ export type ExampleQuery$data = {| |}; export type ExampleQuery$rawResponse = {| +node: ?({| + +__typename: string, + +id: string, + |} | {| +__typename: "User", +feedback: ?{| +id: string, @@ -36,9 +39,6 @@ export type ExampleQuery$rawResponse = {| +id: string, +lastName: ?string, +name: ?string, - |} | {| - +__typename: string, - +id: string, |}), |}; export type ExampleQuery = {| diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-stream-connection.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-stream-connection.expected index c791bcac79438..e5e74b85620e3 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-stream-connection.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/query-with-stream-connection.expected @@ -34,6 +34,9 @@ export type TestDefer$data = {| |}; export type TestDefer$rawResponse = {| +node: ?({| + +__typename: string, + +id: string, + |} | {| +__typename: "User", +friends: ?{| +edges: ?$ReadOnlyArray | Local3DPayload<"NameRendererFragment", { readonly __typename: "PlainUserNameRenderer"; }> | { readonly __module_component_NameRendererFragment: any | null; readonly __module_operation_NameRendererFragment: any | null; readonly __typename: "MarkdownUserNameRenderer"; - } | Local3DPayload<"NameRendererFragment", { - readonly __typename: "MarkdownUserNameRenderer"; - }> | { + } | { + readonly __module_component_NameRendererFragment: any | null; + readonly __module_operation_NameRendererFragment: any | null; + readonly __typename: "PlainUserNameRenderer"; + } | { readonly __typename: string; } | null; - } | { - readonly __typename: string; - readonly id: string; } | null; }; export type Test = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected index 449ee581f8ce8..605c7e0e9f3bc 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-module-field.expected @@ -32,15 +32,15 @@ export type Test_userRenderer = { }; export type Test$rawResponse = { readonly node: { + readonly __typename: string; + readonly id: string; + } | { readonly __typename: "User"; readonly id: string; - readonly plainUserRenderer: { + readonly plainUserRenderer: Local3DPayload<"Test_user", {}> | { readonly __module_component_Test_user: any | null; readonly __module_operation_Test_user: any | null; - } | Local3DPayload<"Test_user", {}> | null; - } | { - readonly __typename: string; - readonly id: string; + } | null; } | null; }; export type Test = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected index ff69d297e6608..de9f8e0f30fd8 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-multiple-match-fields.expected @@ -78,51 +78,51 @@ export type MarkdownUserNameRenderer_name = { }; export type Test$rawResponse = { readonly node: { + readonly __typename: string; + readonly id: string; + } | { readonly __typename: "User"; readonly id: string; - readonly nameRenderer: { - readonly __module_component_NameRendererFragment: any | null; - readonly __module_operation_NameRendererFragment: any | null; - readonly __typename: "PlainUserNameRenderer"; - } | Local3DPayload<"NameRendererFragment", { + readonly nameRenderer: Local3DPayload<"NameRendererFragment", { + readonly __typename: "MarkdownUserNameRenderer"; + }> | Local3DPayload<"NameRendererFragment", { readonly __typename: "PlainUserNameRenderer"; }> | { readonly __module_component_NameRendererFragment: any | null; readonly __module_operation_NameRendererFragment: any | null; readonly __typename: "MarkdownUserNameRenderer"; - } | Local3DPayload<"NameRendererFragment", { - readonly __typename: "MarkdownUserNameRenderer"; - }> | { + } | { + readonly __module_component_NameRendererFragment: any | null; + readonly __module_operation_NameRendererFragment: any | null; + readonly __typename: "PlainUserNameRenderer"; + } | { readonly __typename: string; } | null; readonly username: string | null; - } | { - readonly __typename: string; - readonly id: string; } | null; readonly viewer: { readonly actor: { + readonly __typename: string; + readonly id: string; + } | { readonly __typename: "User"; readonly id: string; readonly name: string | null; - readonly nameRenderer: { - readonly __module_component_AnotherNameRendererFragment: any | null; - readonly __module_operation_AnotherNameRendererFragment: any | null; - readonly __typename: "PlainUserNameRenderer"; - } | Local3DPayload<"AnotherNameRendererFragment", { + readonly nameRenderer: Local3DPayload<"AnotherNameRendererFragment", { + readonly __typename: "MarkdownUserNameRenderer"; + }> | Local3DPayload<"AnotherNameRendererFragment", { readonly __typename: "PlainUserNameRenderer"; }> | { readonly __module_component_AnotherNameRendererFragment: any | null; readonly __module_operation_AnotherNameRendererFragment: any | null; readonly __typename: "MarkdownUserNameRenderer"; - } | Local3DPayload<"AnotherNameRendererFragment", { - readonly __typename: "MarkdownUserNameRenderer"; - }> | { + } | { + readonly __module_component_AnotherNameRendererFragment: any | null; + readonly __module_operation_AnotherNameRendererFragment: any | null; + readonly __typename: "PlainUserNameRenderer"; + } | { readonly __typename: string; } | null; - } | { - readonly __typename: string; - readonly id: string; } | null; } | null; }; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected index 258883e076701..6a458a2a80519 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-raw-response-on-conditional.expected @@ -28,6 +28,9 @@ export type ExampleQuery$data = { }; export type ExampleQuery$rawResponse = { readonly node: { + readonly __typename: string; + readonly id: string; + } | { readonly __typename: "User"; readonly feedback: { readonly id: string; @@ -36,9 +39,6 @@ export type ExampleQuery$rawResponse = { readonly id: string; readonly lastName: string | null; readonly name: string | null; - } | { - readonly __typename: string; - readonly id: string; } | null; }; export type ExampleQuery = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream-connection.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream-connection.expected index 0bac05ea84f3d..143f4a6f933c3 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream-connection.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream-connection.expected @@ -34,6 +34,9 @@ export type TestDefer$data = { }; export type TestDefer$rawResponse = { readonly node: { + readonly __typename: string; + readonly id: string; + } | { readonly __typename: "User"; readonly friends: { readonly edges: ReadonlyArray<{ @@ -55,9 +58,6 @@ export type TestDefer$rawResponse = { } | null; readonly id: string; readonly name: string | null; - } | { - readonly __typename: string; - readonly id: string; } | null; }; export type TestDefer = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream.expected index 6fcf8a530242b..04d7a63f9caa9 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/query-with-stream.expected @@ -33,6 +33,9 @@ export type TestStream$data = { }; export type TestStream$rawResponse = { readonly node: { + readonly __typename: string; + readonly id: string; + } | { readonly __typename: "User"; readonly friends: { readonly edges: ReadonlyArray<{ @@ -49,9 +52,6 @@ export type TestStream$rawResponse = { } | null; readonly id: string; readonly name: string | null; - } | { - readonly __typename: string; - readonly id: string; } | null; }; export type TestStream = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected index b5e72cbaf19c2..fb9094db3bec7 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected @@ -43,15 +43,15 @@ export type Bar$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type Foo$data = { - readonly __typename: "User"; - readonly name: string; - readonly " $fragmentType": "Foo"; -} | { readonly __typename: "Comment"; readonly body: { readonly text: string | null; } | null; readonly " $fragmentType": "Foo"; +} | { + readonly __typename: "User"; + readonly name: string; + readonly " $fragmentType": "Foo"; } | { // This will never be '%other', but we need some // value in case none of the concrete values match. diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected index 4df10506f2c10..cd4fee07b0840 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected @@ -82,13 +82,13 @@ fragment TypenameAliases on Actor { ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; export type TypenameAlias$data = { - readonly _typeAlias: "User"; - readonly firstName: string | null; - readonly " $fragmentType": "TypenameAlias"; -} | { readonly _typeAlias: "Page"; readonly username: string | null; readonly " $fragmentType": "TypenameAlias"; +} | { + readonly _typeAlias: "User"; + readonly firstName: string | null; + readonly " $fragmentType": "TypenameAlias"; } | { // This will never be '%other', but we need some // value in case none of the concrete values match. @@ -102,15 +102,15 @@ export type TypenameAlias$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type TypenameAliases$data = { - readonly _typeAlias1: "User"; - readonly _typeAlias2: "User"; - readonly firstName: string | null; - readonly " $fragmentType": "TypenameAliases"; -} | { readonly _typeAlias1: "Page"; readonly _typeAlias2: "Page"; readonly username: string | null; readonly " $fragmentType": "TypenameAliases"; +} | { + readonly _typeAlias1: "User"; + readonly _typeAlias2: "User"; + readonly firstName: string | null; + readonly " $fragmentType": "TypenameAliases"; } | { // This will never be '%other', but we need some // value in case none of the concrete values match. @@ -127,13 +127,13 @@ export type TypenameAliases$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type TypenameInside$data = { - readonly __typename: "User"; - readonly firstName: string | null; - readonly " $fragmentType": "TypenameInside"; -} | { readonly __typename: "Page"; readonly username: string | null; readonly " $fragmentType": "TypenameInside"; +} | { + readonly __typename: "User"; + readonly firstName: string | null; + readonly " $fragmentType": "TypenameInside"; } | { // This will never be '%other', but we need some // value in case none of the concrete values match. @@ -147,13 +147,13 @@ export type TypenameInside$key = { ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; export type TypenameOutside$data = { - readonly __typename: "User"; - readonly firstName: string | null; - readonly " $fragmentType": "TypenameOutside"; -} | { readonly __typename: "Page"; readonly username: string | null; readonly " $fragmentType": "TypenameOutside"; +} | { + readonly __typename: "User"; + readonly firstName: string | null; + readonly " $fragmentType": "TypenameOutside"; } | { // This will never be '%other', but we need some // value in case none of the concrete values match. From e2789907cbcdcb80ef678c11e11d494880274228 Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Tue, 8 Mar 2022 18:17:36 +0200 Subject: [PATCH 40/41] Fix impl Writer for TypeScript: supports_exact_objects is false. --- .../crates/relay-typegen/src/typescript.rs | 4 +++ .../fixtures/fragment-spread.expected | 16 +++++----- .../fixtures/inline-fragment.expected | 4 +-- .../fixtures/relay-client-id-field.expected | 8 ++--- ...ough-inline-fragments-to-fragment.expected | 4 +-- ...solates-concrete-inline-fragments.expected | 5 ++- .../fixtures/typename-on-node.expected | 10 +++--- .../fixtures/typename-on-node.graphql | 3 +- .../fixtures/typename-on-union.expected | 32 ++++++++----------- 9 files changed, 44 insertions(+), 42 deletions(-) diff --git a/compiler/crates/relay-typegen/src/typescript.rs b/compiler/crates/relay-typegen/src/typescript.rs index 13cf1bb4d5d86..c569fef4318ec 100644 --- a/compiler/crates/relay-typegen/src/typescript.rs +++ b/compiler/crates/relay-typegen/src/typescript.rs @@ -114,6 +114,10 @@ impl Writer for TypeScriptPrinter { ) -> FmtResult { Ok(()) } + + fn supports_exact_objects(&self) -> bool { + false + } } impl TypeScriptPrinter { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected index ed08428cc8424..134733202090e 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/fragment-spread.expected @@ -98,13 +98,13 @@ export type OtherFragment$key = { }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type PageFragment$data = { +export type PageFragment$data = ({ readonly __typename: "Page"; - readonly " $fragmentType": "PageFragment"; } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly __typename: "%other"; +}) & { readonly " $fragmentType": "PageFragment"; }; export type PageFragment$key = { @@ -113,13 +113,13 @@ export type PageFragment$key = { }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type PictureFragment$data = { +export type PictureFragment$data = ({ readonly __typename: "Image"; - readonly " $fragmentType": "PictureFragment"; } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly __typename: "%other"; +}) & { readonly " $fragmentType": "PictureFragment"; }; export type PictureFragment$key = { @@ -128,13 +128,13 @@ export type PictureFragment$key = { }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type UserFrag1$data = { +export type UserFrag1$data = ({ readonly __typename: "User"; - readonly " $fragmentType": "UserFrag1"; } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly __typename: "%other"; +}) & { readonly " $fragmentType": "UserFrag1"; }; export type UserFrag1$key = { @@ -143,13 +143,13 @@ export type UserFrag1$key = { }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type UserFrag2$data = { +export type UserFrag2$data = ({ readonly __typename: "User"; - readonly " $fragmentType": "UserFrag2"; } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly __typename: "%other"; +}) & { readonly " $fragmentType": "UserFrag2"; }; export type UserFrag2$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected index f5b5a538f0cd5..c68dc156b412c 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/inline-fragment.expected @@ -126,13 +126,13 @@ export type InlineFragmentWithOverlappingFields$key = { }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type SomeFragment$data = { +export type SomeFragment$data = ({ readonly __typename: "User"; - readonly " $fragmentType": "SomeFragment"; } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly __typename: "%other"; +}) & { readonly " $fragmentType": "SomeFragment"; }; export type SomeFragment$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected index ef8e75ec92b78..8fcb5e8b39b9b 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/relay-client-id-field.expected @@ -41,9 +41,9 @@ export type RelayClientIDFieldQuery$data = { readonly __typename: string; readonly id: string; } | null; - readonly node: { + readonly node: ({ readonly __typename: "Comment"; - readonly commentBody: { + readonly commentBody: ({ readonly __typename: "PlainCommentBody"; readonly __id: string; readonly text: { @@ -53,12 +53,12 @@ export type RelayClientIDFieldQuery$data = { } | null; } | { readonly __typename: "MarkdownCommentBody"; + }) & { readonly __id: string; } | null; - readonly __id: string; - readonly id: string; } | { readonly __typename: "Feedback" | "Page" | "PhotoStory" | "Story" | "User"; + }) & { readonly __id: string; readonly id: string; } | null; diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected index 94df425f2b640..8a21e081a8054 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-bubbles-through-inline-fragments-to-fragment.expected @@ -13,12 +13,12 @@ fragment Foo on Node { } ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; -export type Foo$data = { +export type Foo$data = ({ readonly __typename: "User"; readonly name: string; - readonly " $fragmentType": "Foo"; } | { readonly __typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story"; +}) & { readonly " $fragmentType": "Foo"; } | null; export type Foo$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected index de1a1fd3f26d6..3e4c05deea75f 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/required-isolates-concrete-inline-fragments.expected @@ -42,20 +42,19 @@ export type Bar$key = { }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type Foo$data = { +export type Foo$data = ({ readonly __typename: "User"; readonly name: string; - readonly " $fragmentType": "Foo"; } | { readonly __typename: "Comment"; readonly body: { readonly text: string | null; } | null; - readonly " $fragmentType": "Foo"; } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly __typename: "%other"; +}) & { readonly " $fragmentType": "Foo"; } | null; export type Foo$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-node.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-node.expected index b2e12197db340..e7107172f60b5 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-node.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-node.expected @@ -6,20 +6,22 @@ %%% fragment TypenameOnNode on Node { __typename + id ... on User { - id + firstName } } ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; -export type TypenameOnNode$data = { +export type TypenameOnNode$data = ({ readonly __typename: "User"; - readonly id: string; - readonly " $fragmentType": "TypenameOnNode"; + readonly firstName: string | null; } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly __typename: "%other"; +}) & { + readonly id: string; readonly " $fragmentType": "TypenameOnNode"; }; export type TypenameOnNode$key = { diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-node.graphql b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-node.graphql index 491c5c4b3c4b8..a9e5da2cf4be3 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-node.graphql +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-node.graphql @@ -5,7 +5,8 @@ %%% fragment TypenameOnNode on Node { __typename + id ... on User { - id + firstName } } diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected index 9fae3edf0aea7..5b59c02badd60 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/typename-on-union.expected @@ -85,13 +85,13 @@ fragment TypenameAliases on Actor { } ==================================== OUTPUT =================================== import { FragmentRefs } from "relay-runtime"; -export type TypenameAlias$data = { +export type TypenameAlias$data = ({ readonly _typeAlias: "User"; readonly firstName: string | null; - readonly " $fragmentType": "TypenameAlias"; } | { readonly _typeAlias: "Page"; readonly username: string | null; +}) & { readonly " $fragmentType": "TypenameAlias"; }; export type TypenameAlias$key = { @@ -100,15 +100,15 @@ export type TypenameAlias$key = { }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type TypenameAliases$data = { +export type TypenameAliases$data = ({ readonly _typeAlias1: "User"; readonly _typeAlias2: "User"; readonly firstName: string | null; - readonly " $fragmentType": "TypenameAliases"; } | { readonly _typeAlias1: "Page"; readonly _typeAlias2: "Page"; readonly username: string | null; +}) & { readonly " $fragmentType": "TypenameAliases"; }; export type TypenameAliases$key = { @@ -117,13 +117,13 @@ export type TypenameAliases$key = { }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type TypenameInside$data = { +export type TypenameInside$data = ({ readonly __typename: "User"; readonly firstName: string | null; - readonly " $fragmentType": "TypenameInside"; } | { readonly __typename: "Page"; readonly username: string | null; +}) & { readonly " $fragmentType": "TypenameInside"; }; export type TypenameInside$key = { @@ -132,13 +132,13 @@ export type TypenameInside$key = { }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type TypenameOutside$data = { +export type TypenameOutside$data = ({ readonly __typename: "User"; readonly firstName: string | null; - readonly " $fragmentType": "TypenameOutside"; } | { readonly __typename: "Page"; readonly username: string | null; +}) & { readonly " $fragmentType": "TypenameOutside"; }; export type TypenameOutside$key = { @@ -147,18 +147,16 @@ export type TypenameOutside$key = { }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type TypenameOutsideWithAbstractType$data = { +export type TypenameOutsideWithAbstractType$data = ({ readonly __typename: "User"; readonly firstName: string | null; readonly address: { readonly street: string | null; readonly city: string | null; - readonly country: string | null; } | null; - readonly username?: string | null; - readonly " $fragmentType": "TypenameOutsideWithAbstractType"; } | { readonly __typename: "Comment" | "Feedback" | "Page" | "PhotoStory" | "Story"; +}) & { readonly username?: string | null; readonly address?: { readonly city: string | null; @@ -172,14 +170,13 @@ export type TypenameOutsideWithAbstractType$key = { }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type TypenameWithCommonSelections$data = { +export type TypenameWithCommonSelections$data = ({ readonly __typename: "User"; readonly firstName: string | null; - readonly name: string | null; - readonly " $fragmentType": "TypenameWithCommonSelections"; } | { readonly __typename: "Page"; readonly username: string | null; +}) & { readonly name: string | null; readonly " $fragmentType": "TypenameWithCommonSelections"; }; @@ -189,14 +186,13 @@ export type TypenameWithCommonSelections$key = { }; ------------------------------------------------------------------------------- import { FragmentRefs } from "relay-runtime"; -export type TypenameWithoutSpreads$data = { +export type TypenameWithoutSpreads$data = ({ readonly __typename: "User"; - readonly firstName: string | null; - readonly " $fragmentType": "TypenameWithoutSpreads"; } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly __typename: "%other"; +}) & { readonly firstName: string | null; readonly " $fragmentType": "TypenameWithoutSpreads"; }; From b3f807264142215a35f15dd2b7dedbbbccf9ca11 Mon Sep 17 00:00:00 2001 From: Maarten Staa Date: Wed, 9 Mar 2022 09:23:58 +0200 Subject: [PATCH 41/41] Remove AST::Intersection from typegen, as it will not be needed. --- compiler/crates/relay-typegen/src/flow.rs | 24 +---- .../crates/relay-typegen/src/typescript.rs | 99 +------------------ compiler/crates/relay-typegen/src/writer.rs | 4 - 3 files changed, 4 insertions(+), 123 deletions(-) diff --git a/compiler/crates/relay-typegen/src/flow.rs b/compiler/crates/relay-typegen/src/flow.rs index d0fa236ddb8e6..d04f745b479e0 100644 --- a/compiler/crates/relay-typegen/src/flow.rs +++ b/compiler/crates/relay-typegen/src/flow.rs @@ -129,7 +129,6 @@ impl FlowPrinter { AST::Identifier(identifier) => write!(&mut self.result, "{}", identifier), AST::RawType(raw) => write!(&mut self.result, "{}", raw), AST::Union(members) => self.write_union(members, wrapping_required), - AST::Intersection(members) => self.write_intersection(members, wrapping_required), AST::ReadOnlyArray(of_type) => self.write_read_only_array(of_type), AST::Nullable(of_type) => self.write_nullable(of_type), AST::NonNullable(of_type) => self.write_non_nullable(of_type), @@ -180,25 +179,6 @@ impl FlowPrinter { Ok(()) } - fn write_intersection(&mut self, members: &[AST], wrapping_required: bool) -> FmtResult { - if members.len() > 1 && wrapping_required { - write!(&mut self.result, "(")?; - } - let mut first = true; - for member in members { - if first { - first = false; - } else { - write!(&mut self.result, " & ")?; - } - self.write(member)?; - } - if members.len() > 1 && wrapping_required { - write!(&mut self.result, ")")?; - } - Ok(()) - } - fn write_fragment_references(&mut self, fragments: &[StringKey]) -> FmtResult { let mut first = true; for fragment in fragments { @@ -396,7 +376,7 @@ mod tests { key: "key".intern(), optional: false, read_only: false, - value: AST::Intersection(AstList::sorted(vec![ + value: AST::Union(AstList::sorted(vec![ AST::Union(AstList::sorted(vec![AST::String, AST::Number])), AST::Boolean ])) @@ -404,7 +384,7 @@ mod tests { true ))), r"{| - key: (string | number) & boolean, + key: (string | number) | boolean, |}" .to_string() ); diff --git a/compiler/crates/relay-typegen/src/typescript.rs b/compiler/crates/relay-typegen/src/typescript.rs index 0b9c0aada5d55..497df22f93309 100644 --- a/compiler/crates/relay-typegen/src/typescript.rs +++ b/compiler/crates/relay-typegen/src/typescript.rs @@ -119,7 +119,6 @@ impl TypeScriptPrinter { AST::Identifier(identifier) => write!(&mut self.result, "{}", identifier), AST::RawType(raw) => write!(&mut self.result, "{}", raw), AST::Union(members) => self.write_union(members, wrapping_required), - AST::Intersection(members) => self.write_intersection(members, wrapping_required), AST::ReadOnlyArray(of_type) => self.write_read_only_array(of_type), AST::Nullable(of_type) => self.write_nullable(of_type, wrapping_required), AST::NonNullable(of_type) => self.write_non_nullable(of_type), @@ -168,25 +167,6 @@ impl TypeScriptPrinter { Ok(()) } - fn write_intersection(&mut self, members: &[AST], wrapping_required: bool) -> FmtResult { - if members.len() > 1 && wrapping_required { - write!(&mut self.result, "(")?; - } - let mut first = true; - for member in members { - if first { - first = false; - } else { - write!(&mut self.result, " & ")?; - } - self.write(member)?; - } - if members.len() > 1 && wrapping_required { - write!(&mut self.result, ")")?; - } - Ok(()) - } - fn write_read_only_array(&mut self, of_type: &AST) -> FmtResult { write!(&mut self.result, "ReadonlyArray<")?; self.write_ast(of_type, false)?; @@ -373,81 +353,6 @@ mod tests { ) } - #[test] - fn intersections() { - assert_eq!( - print_type(&AST::Intersection(AstList::new( - vec![ - AST::ExactObject(ExactObject::new( - vec![Prop::KeyValuePair(KeyValuePairProp { - key: "first".intern(), - optional: false, - read_only: false, - value: AST::String - })], - true - )), - AST::ExactObject(ExactObject::new( - vec![Prop::KeyValuePair(KeyValuePairProp { - key: "second".intern(), - optional: false, - read_only: false, - value: AST::Number - })], - true - )), - ], - true - ))), - r"({ - first: string; -} & { - second: number; -})" - ); - - assert_eq!( - print_type(&AST::Intersection(AstList::sorted(vec![ - AST::Union(AstList::sorted(vec![ - AST::ExactObject(ExactObject::new( - vec![Prop::KeyValuePair(KeyValuePairProp { - key: "first".intern(), - optional: false, - read_only: false, - value: AST::String - })], - true - )), - AST::ExactObject(ExactObject::new( - vec![Prop::KeyValuePair(KeyValuePairProp { - key: "second".intern(), - optional: false, - read_only: false, - value: AST::Number - })], - true - )), - ],)), - AST::ExactObject(ExactObject::new( - vec![Prop::KeyValuePair(KeyValuePairProp { - key: "third".intern(), - optional: false, - read_only: false, - value: AST::Number - })], - true - )), - ]),)), - r"(({ - first: string; -} | { - second: number; -}) & { - third: number; -})" - ); - } - #[test] fn wrapping() { assert_eq!( @@ -456,7 +361,7 @@ mod tests { key: "key".intern(), optional: false, read_only: false, - value: AST::Intersection(AstList::sorted(vec![ + value: AST::Union(AstList::sorted(vec![ AST::Union(AstList::sorted(vec![AST::String, AST::Number])), AST::Boolean ])) @@ -464,7 +369,7 @@ mod tests { true ))), r"{ - key: (string | number) & boolean; + key: (string | number) | boolean; }" .to_string() ); diff --git a/compiler/crates/relay-typegen/src/writer.rs b/compiler/crates/relay-typegen/src/writer.rs index d469617e6d42b..dd2fb2142d63c 100644 --- a/compiler/crates/relay-typegen/src/writer.rs +++ b/compiler/crates/relay-typegen/src/writer.rs @@ -14,10 +14,6 @@ use std::{ #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)] pub enum AST { Union(AstList), - // Intersection variant added in preparation for better support for abstract types. - // See https://github.com/facebook/relay/pull/3280 - #[allow(dead_code)] - Intersection(AstList), ReadOnlyArray(Box), Nullable(Box), NonNullable(Box),