diff --git a/src/TypeScriptGenerator.ts b/src/TypeScriptGenerator.ts index c5c8dffa..3c28b128 100644 --- a/src/TypeScriptGenerator.ts +++ b/src/TypeScriptGenerator.ts @@ -24,15 +24,15 @@ import { type Selection = { key: string; - schemaName?: string; - value?: any; - nodeType?: TypeID; - conditional?: boolean; - concreteType?: string; - ref?: string; - nodeSelections?: SelectionMap | null; - kind?: string; - documentName?: string; + schemaName?: string | undefined; + value?: any | undefined; + nodeType?: TypeID | undefined; + conditional?: boolean | undefined; + concreteType?: string | undefined; + ref?: string | undefined; + nodeSelections?: SelectionMap | null | undefined; + kind?: string | undefined; + documentName?: string | undefined; }; type SelectionMap = Map; @@ -309,10 +309,31 @@ function exactObjectTypeAnnotation( const idRegex = /^[$a-zA-Z_][$a-z0-9A-Z_]*$/; +// union optional types with undefined for compat with exactOptionalPropertyTypes +function createInexactOptionalType(type: ts.TypeNode): ts.TypeNode { + if (ts.isUnionTypeNode(type)) { + return ts.factory.updateUnionTypeNode( + type, + ts.factory.createNodeArray([ + ...type.types, + ts.factory.createKeywordTypeNode(ts.SyntaxKind.UndefinedKeyword), + ]) + ); + } else { + return ts.factory.createUnionTypeNode([ + type, + ts.factory.createKeywordTypeNode(ts.SyntaxKind.UndefinedKeyword), + ]); + } +} + function objectTypeProperty( propertyName: string, type: ts.TypeNode, - options: { readonly?: boolean; optional?: boolean } = {} + options: { + readonly?: boolean | undefined; + optional?: boolean | undefined; + } = {} ): ts.PropertySignature { const { optional, readonly = true } = options; const modifiers = readonly @@ -325,7 +346,7 @@ function objectTypeProperty( ? ts.factory.createIdentifier(propertyName) : ts.factory.createStringLiteral(propertyName), optional ? ts.factory.createToken(ts.SyntaxKind.QuestionToken) : undefined, - type + optional ? createInexactOptionalType(type) : type ); } diff --git a/src/TypeScriptTypeTransformers.ts b/src/TypeScriptTypeTransformers.ts index 248fc90f..595d12f7 100644 --- a/src/TypeScriptTypeTransformers.ts +++ b/src/TypeScriptTypeTransformers.ts @@ -9,7 +9,7 @@ export type ScalarTypeMapping = { export type State = { generatedFragments: Set; generatedInputObjectTypes: { - [name: string]: ts.TypeNode | "pending"; + [name: string]: ts.TypeLiteralNode | "pending"; }; matchFields: Map; runtimeImports: Set; @@ -37,9 +37,7 @@ export function transformScalarType( } else { return ts.factory.createUnionTypeNode([ transformNonNullableScalarType(schema, type, state, objectProps), - ts.factory.createLiteralTypeNode( - ts.factory.createToken(ts.SyntaxKind.NullKeyword) - ), + ts.factory.createLiteralTypeNode(ts.factory.createNull()), ]); } } @@ -115,20 +113,29 @@ function transformGraphQLEnumType( export function transformInputType( schema: Schema, type: TypeID, - state: State + state: State, + options: { + inputObjectProperty?: boolean | undefined; + } = {} ): ts.TypeNode { + const { inputObjectProperty } = options; if (schema.isNonNull(type)) { return transformNonNullableInputType( schema, schema.getNullableType(type), state ); + } else if (inputObjectProperty) { + return ts.factory.createUnionTypeNode([ + transformNonNullableInputType(schema, type, state), + ts.factory.createLiteralTypeNode(ts.factory.createNull()), + // add undefined to support exactOptionalPropertyTypes + ts.factory.createKeywordTypeNode(ts.SyntaxKind.UndefinedKeyword), + ]); } else { return ts.factory.createUnionTypeNode([ transformNonNullableInputType(schema, type, state), - ts.factory.createLiteralTypeNode( - ts.factory.createToken(ts.SyntaxKind.NullKeyword) - ), + ts.factory.createLiteralTypeNode(ts.factory.createNull()), ]); } } @@ -169,7 +176,9 @@ function transformNonNullableInputType( !schema.isNonNull(fieldType) ? ts.factory.createToken(ts.SyntaxKind.QuestionToken) : undefined, - transformInputType(schema, fieldType, state) + transformInputType(schema, fieldType, state, { + inputObjectProperty: true, + }) ); return property; diff --git a/test/__snapshots__/TypeScriptGenerator-test.ts.snap b/test/__snapshots__/TypeScriptGenerator-test.ts.snap index e8fa236a..9470b1dd 100644 --- a/test/__snapshots__/TypeScriptGenerator-test.ts.snap +++ b/test/__snapshots__/TypeScriptGenerator-test.ts.snap @@ -16,12 +16,12 @@ fragment NestedCondition on Node { // ConditionField.graphql import { FragmentRefs } from "relay-runtime"; export type ConditionField = { - readonly id?: string; + readonly id?: string | undefined; readonly " $refType": "ConditionField"; }; export type ConditionField$data = ConditionField; export type ConditionField$key = { - readonly " $data"?: ConditionField$data; + readonly " $data"?: ConditionField$data | undefined; readonly " $fragmentRefs": FragmentRefs<"ConditionField">; }; @@ -29,12 +29,12 @@ export type ConditionField$key = { // NestedCondition.graphql import { FragmentRefs } from "relay-runtime"; export type NestedCondition = { - readonly id?: string; + readonly id?: string | undefined; readonly " $refType": "NestedCondition"; }; export type NestedCondition$data = NestedCondition; export type NestedCondition$key = { - readonly " $data"?: NestedCondition$data; + readonly " $data"?: NestedCondition$data | undefined; readonly " $fragmentRefs": FragmentRefs<"NestedCondition">; }; @@ -108,7 +108,7 @@ export type FragmentSpread = { }; export type FragmentSpread$data = FragmentSpread; export type FragmentSpread$key = { - readonly " $data"?: FragmentSpread$data; + readonly " $data"?: FragmentSpread$data | undefined; readonly " $fragmentRefs": FragmentRefs<"FragmentSpread">; }; @@ -132,7 +132,7 @@ export type ConcreateTypes = { }; export type ConcreateTypes$data = ConcreateTypes; export type ConcreateTypes$key = { - readonly " $data"?: ConcreateTypes$data; + readonly " $data"?: ConcreateTypes$data | undefined; readonly " $fragmentRefs": FragmentRefs<"ConcreateTypes">; }; @@ -150,7 +150,7 @@ export type PictureFragment = { }; export type PictureFragment$data = PictureFragment; export type PictureFragment$key = { - readonly " $data"?: PictureFragment$data; + readonly " $data"?: PictureFragment$data | undefined; readonly " $fragmentRefs": FragmentRefs<"PictureFragment">; }; @@ -163,7 +163,7 @@ export type OtherFragment = { }; export type OtherFragment$data = OtherFragment; export type OtherFragment$key = { - readonly " $data"?: OtherFragment$data; + readonly " $data"?: OtherFragment$data | undefined; readonly " $fragmentRefs": FragmentRefs<"OtherFragment">; }; @@ -181,7 +181,7 @@ export type PageFragment = { }; export type PageFragment$data = PageFragment; export type PageFragment$key = { - readonly " $data"?: PageFragment$data; + readonly " $data"?: PageFragment$data | undefined; readonly " $fragmentRefs": FragmentRefs<"PageFragment">; }; @@ -199,7 +199,7 @@ export type UserFrag1 = { }; export type UserFrag1$data = UserFrag1; export type UserFrag1$key = { - readonly " $data"?: UserFrag1$data; + readonly " $data"?: UserFrag1$data | undefined; readonly " $fragmentRefs": FragmentRefs<"UserFrag1">; }; @@ -217,7 +217,7 @@ export type UserFrag2 = { }; export type UserFrag2$data = UserFrag2; export type UserFrag2$key = { - readonly " $data"?: UserFrag2$data; + readonly " $data"?: UserFrag2$data | undefined; readonly " $fragmentRefs": FragmentRefs<"UserFrag2">; }; @@ -295,15 +295,15 @@ fragment SomeFragment on User { import { FragmentRefs } from "relay-runtime"; export type InlineFragment = { readonly id: string; - readonly name?: string | null; + readonly name?: string | null | undefined; readonly message?: { readonly text: string | null; - } | null; + } | null | undefined; readonly " $refType": "InlineFragment"; }; export type InlineFragment$data = InlineFragment; export type InlineFragment$key = { - readonly " $data"?: InlineFragment$data; + readonly " $data"?: InlineFragment$data | undefined; readonly " $fragmentRefs": FragmentRefs<"InlineFragment">; }; @@ -316,14 +316,14 @@ export type InlineFragmentWithOverlappingFields = { readonly name: string | null; readonly message?: { readonly text: string | null; - } | null; - } | null; - readonly name?: string | null; + } | null | undefined; + } | null | undefined; + readonly name?: string | null | undefined; readonly " $refType": "InlineFragmentWithOverlappingFields"; }; export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; export type InlineFragmentWithOverlappingFields$key = { - readonly " $data"?: InlineFragmentWithOverlappingFields$data; + readonly " $data"?: InlineFragmentWithOverlappingFields$data | undefined; readonly " $fragmentRefs": FragmentRefs<"InlineFragmentWithOverlappingFields">; }; @@ -331,13 +331,13 @@ export type InlineFragmentWithOverlappingFields$key = { // InlineFragmentConditionalID.graphql import { FragmentRefs } from "relay-runtime"; export type InlineFragmentConditionalID = { - readonly id?: string; - readonly name?: string | null; + readonly id?: string | undefined; + readonly name?: string | null | undefined; readonly " $refType": "InlineFragmentConditionalID"; }; export type InlineFragmentConditionalID$data = InlineFragmentConditionalID; export type InlineFragmentConditionalID$key = { - readonly " $data"?: InlineFragmentConditionalID$data; + readonly " $data"?: InlineFragmentConditionalID$data | undefined; readonly " $fragmentRefs": FragmentRefs<"InlineFragmentConditionalID">; }; @@ -349,17 +349,17 @@ export type InlineFragmentKitchenSink = { readonly id: string; readonly profilePicture: { readonly uri: string | null; - readonly width?: number | null; - readonly height?: number | null; + readonly width?: number | null | undefined; + readonly height?: number | null | undefined; } | null; - readonly name?: string | null; + readonly name?: string | null | undefined; readonly " $fragmentRefs": FragmentRefs<"SomeFragment">; } | null; readonly " $refType": "InlineFragmentKitchenSink"; }; export type InlineFragmentKitchenSink$data = InlineFragmentKitchenSink; export type InlineFragmentKitchenSink$key = { - readonly " $data"?: InlineFragmentKitchenSink$data; + readonly " $data"?: InlineFragmentKitchenSink$data | undefined; readonly " $fragmentRefs": FragmentRefs<"InlineFragmentKitchenSink">; }; @@ -377,7 +377,7 @@ export type SomeFragment = { }; export type SomeFragment$data = SomeFragment; export type SomeFragment$key = { - readonly " $data"?: SomeFragment$data; + readonly " $data"?: SomeFragment$data | undefined; readonly " $fragmentRefs": FragmentRefs<"SomeFragment">; }; @@ -435,7 +435,7 @@ export type LinkedField = { }; export type LinkedField$data = LinkedField; export type LinkedField$key = { - readonly " $data"?: LinkedField$data; + readonly " $data"?: LinkedField$data | undefined; readonly " $fragmentRefs": FragmentRefs<"LinkedField">; }; @@ -490,15 +490,15 @@ import { FragmentRefs } from "relay-runtime"; export type NameRendererFragment = { readonly id: string; readonly nameRenderer: { - readonly __fragmentPropName?: string | null; - readonly __module_component?: string | null; + readonly __fragmentPropName?: string | null | undefined; + readonly __module_component?: string | null | undefined; readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">; } | null; readonly " $refType": "NameRendererFragment"; }; export type NameRendererFragment$data = NameRendererFragment; export type NameRendererFragment$key = { - readonly " $data"?: NameRendererFragment$data; + readonly " $data"?: NameRendererFragment$data | undefined; readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment">; }; @@ -514,7 +514,7 @@ 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 | undefined; readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">; }; @@ -530,7 +530,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 | undefined; readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">; }; @@ -569,8 +569,8 @@ export type NameRendererQueryVariables = {}; export type NameRendererQueryResponse = { readonly me: { readonly nameRenderer: { - readonly __fragmentPropName?: string | null; - readonly __module_component?: string | null; + readonly __fragmentPropName?: string | null | undefined; + readonly __module_component?: string | null | undefined; readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">; } | null; } | null; @@ -592,7 +592,7 @@ 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 | undefined; readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">; }; @@ -608,182 +608,12 @@ 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 | undefined; readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">; }; `; -exports[`Snapshot tests TypeScriptGenerator with a single artifact directory matches expected output: mutaion-with-client-extension.graphql 1`] = ` -~~~~~~~~~~ INPUT ~~~~~~~~~~ -mutation Test($input: UpdateAllSeenStateInput) @raw_response_type { - viewerNotificationsUpdateAllSeenState(input: $input) { - stories { - foos { - bar - } - } - } -} - -extend type Story { - foos: [Foo] -} - -type Foo { - bar: String -} - -~~~~~~~~~~ OUTPUT ~~~~~~~~~~ -// Test.graphql -export type UpdateAllSeenStateInput = { - clientMutationId?: string | null; - storyIds?: Array | 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 = { - readonly response: TestResponse; - readonly variables: TestVariables; - readonly rawResponse: TestRawResponse; -}; - -`; - -exports[`Snapshot tests TypeScriptGenerator with a single artifact directory matches expected output: mutaion-with-response-on-inline-fragments.graphql 1`] = ` -~~~~~~~~~~ INPUT ~~~~~~~~~~ -mutation TestMutation($input: CommentCreateInput!) @raw_response_type { - commentCreate(input: $input) { - viewer { - actor { - ...InlineFragmentWithOverlappingFields - } - } - } -} - -fragment InlineFragmentWithOverlappingFields on Actor { - ... on User { - hometown { - id - name - } - } - ... on Page { - name - hometown { - id - message { - text - } - } - } -} - -~~~~~~~~~~ OUTPUT ~~~~~~~~~~ -// TestMutation.graphql -import { FragmentRefs } from "relay-runtime"; -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 = { - readonly response: TestMutationResponse; - readonly variables: TestMutationVariables; - readonly rawResponse: TestMutationRawResponse; -}; - - -// InlineFragmentWithOverlappingFields.graphql -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": "InlineFragmentWithOverlappingFields"; -}; -export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; -export type InlineFragmentWithOverlappingFields$key = { - readonly " $data"?: InlineFragmentWithOverlappingFields$data; - readonly " $fragmentRefs": FragmentRefs<"InlineFragmentWithOverlappingFields">; -}; - -`; - exports[`Snapshot tests TypeScriptGenerator with a single artifact directory matches expected output: mutation.graphql 1`] = ` ~~~~~~~~~~ INPUT ~~~~~~~~~~ mutation CommentCreateMutation( @@ -805,20 +635,20 @@ mutation CommentCreateMutation( ~~~~~~~~~~ OUTPUT ~~~~~~~~~~ // CommentCreateMutation.graphql export type CommentCreateInput = { - clientMutationId?: string | null; - feedbackId?: string | null; - feedback?: CommentfeedbackFeedback | null; + clientMutationId?: string | null | undefined; + feedbackId?: string | null | undefined; + feedback?: CommentfeedbackFeedback | null | undefined; }; export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null; + comment?: FeedbackcommentComment | null | undefined; }; export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null; + feedback?: CommentfeedbackFeedback | null | undefined; }; export type CommentCreateMutationVariables = { input: CommentCreateInput; - first?: number | null; - orderBy?: Array | null; + first?: number | null | undefined; + orderBy?: Array | null | undefined; }; export type CommentCreateMutationResponse = { readonly commentCreate: { @@ -851,11 +681,11 @@ mutation InputHasArray($input: UpdateAllSeenStateInput) @raw_response_type { ~~~~~~~~~~ OUTPUT ~~~~~~~~~~ // InputHasArray.graphql export type UpdateAllSeenStateInput = { - clientMutationId?: string | null; - storyIds?: Array | null; + clientMutationId?: string | null | undefined; + storyIds?: Array | null | undefined; }; export type InputHasArrayVariables = { - input?: UpdateAllSeenStateInput | null; + input?: UpdateAllSeenStateInput | null | undefined; }; export type InputHasArrayResponse = { readonly viewerNotificationsUpdateAllSeenState: { @@ -913,15 +743,15 @@ mutation PrependEdgeMutation( ~~~~~~~~~~ OUTPUT ~~~~~~~~~~ // AppendEdgeMutation.graphql export type CommentCreateInput = { - clientMutationId?: string | null; - feedbackId?: string | null; - feedback?: CommentfeedbackFeedback | null; + clientMutationId?: string | null | undefined; + feedbackId?: string | null | undefined; + feedback?: CommentfeedbackFeedback | null | undefined; }; export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null; + comment?: FeedbackcommentComment | null | undefined; }; export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null; + feedback?: CommentfeedbackFeedback | null | undefined; }; export type AppendEdgeMutationVariables = { input: CommentCreateInput; @@ -945,15 +775,15 @@ export type AppendEdgeMutation = { // PrependEdgeMutation.graphql export type CommentCreateInput = { - clientMutationId?: string | null; - feedbackId?: string | null; - feedback?: CommentfeedbackFeedback | null; + clientMutationId?: string | null | undefined; + feedbackId?: string | null | undefined; + feedback?: CommentfeedbackFeedback | null | undefined; }; export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null; + comment?: FeedbackcommentComment | null | undefined; }; export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null; + feedback?: CommentfeedbackFeedback | null | undefined; }; export type PrependEdgeMutationVariables = { input: CommentCreateInput; @@ -998,11 +828,11 @@ type Foo { ~~~~~~~~~~ OUTPUT ~~~~~~~~~~ // Test.graphql export type UpdateAllSeenStateInput = { - clientMutationId?: string | null; - storyIds?: Array | null; + clientMutationId?: string | null | undefined; + storyIds?: Array | null | undefined; }; export type TestVariables = { - input?: UpdateAllSeenStateInput | null; + input?: UpdateAllSeenStateInput | null | undefined; }; export type TestResponse = { readonly viewerNotificationsUpdateAllSeenState: { @@ -1019,7 +849,7 @@ export type TestRawResponse = { readonly id: string; readonly foos?: ReadonlyArray<({ readonly bar: string | null; - }) | null> | null; + }) | null> | null | undefined; }) | null> | null; }) | null; }; @@ -1043,8 +873,8 @@ mutation DeleteRecordMutation( ~~~~~~~~~~ OUTPUT ~~~~~~~~~~ // DeleteRecordMutation.graphql export type CommentDeleteInput = { - clientMutationId?: string | null; - commentId?: string | null; + clientMutationId?: string | null | undefined; + commentId?: string | null | undefined; }; export type DeleteRecordMutationVariables = { input: CommentDeleteInput; @@ -1096,20 +926,20 @@ fragment FriendFragment on User { import { FragmentRefs } from "relay-runtime"; export type TestEnums = "mark" | "zuck" | "%future added value"; export type CommentCreateInput = { - clientMutationId?: string | null; - feedbackId?: string | null; - feedback?: CommentfeedbackFeedback | null; + clientMutationId?: string | null | undefined; + feedbackId?: string | null | undefined; + feedback?: CommentfeedbackFeedback | null | undefined; }; export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null; + comment?: FeedbackcommentComment | null | undefined; }; export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null; + feedback?: CommentfeedbackFeedback | null | undefined; }; export type CommentCreateMutationVariables = { input: CommentCreateInput; - first?: number | null; - orderBy?: Array | null; + first?: number | null | undefined; + orderBy?: Array | null | undefined; }; export type CommentCreateMutationResponse = { readonly commentCreate: { @@ -1166,7 +996,7 @@ export type FriendFragment = { }; export type FriendFragment$data = FriendFragment; export type FriendFragment$key = { - readonly " $data"?: FriendFragment$data; + readonly " $data"?: FriendFragment$data | undefined; readonly " $fragmentRefs": FragmentRefs<"FriendFragment">; }; @@ -1210,20 +1040,20 @@ fragment FeedbackFragment on Feedback { // CommentCreateMutation.graphql import { FragmentRefs } from "relay-runtime"; export type CommentCreateInput = { - clientMutationId?: string | null; - feedbackId?: string | null; - feedback?: CommentfeedbackFeedback | null; + clientMutationId?: string | null | undefined; + feedbackId?: string | null | undefined; + feedback?: CommentfeedbackFeedback | null | undefined; }; export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null; + comment?: FeedbackcommentComment | null | undefined; }; export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null; + feedback?: CommentfeedbackFeedback | null | undefined; }; export type CommentCreateMutationVariables = { input: CommentCreateInput; - first?: number | null; - orderBy?: Array | null; + first?: number | null | undefined; + orderBy?: Array | null | undefined; }; export type CommentCreateMutationResponse = { readonly commentCreate: { @@ -1278,7 +1108,7 @@ export type FriendFragment = { }; export type FriendFragment$data = FriendFragment; export type FriendFragment$key = { - readonly " $data"?: FriendFragment$data; + readonly " $data"?: FriendFragment$data | undefined; readonly " $fragmentRefs": FragmentRefs<"FriendFragment">; }; @@ -1292,7 +1122,7 @@ export type FeedbackFragment = { }; export type FeedbackFragment$data = FeedbackFragment; export type FeedbackFragment$key = { - readonly " $data"?: FeedbackFragment$data; + readonly " $data"?: FeedbackFragment$data | undefined; readonly " $fragmentRefs": FragmentRefs<"FeedbackFragment">; }; @@ -1331,15 +1161,15 @@ fragment InlineFragmentWithOverlappingFields on Actor { // TestMutation.graphql import { FragmentRefs } from "relay-runtime"; export type CommentCreateInput = { - clientMutationId?: string | null; - feedbackId?: string | null; - feedback?: CommentfeedbackFeedback | null; + clientMutationId?: string | null | undefined; + feedbackId?: string | null | undefined; + feedback?: CommentfeedbackFeedback | null | undefined; }; export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null; + comment?: FeedbackcommentComment | null | undefined; }; export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null; + feedback?: CommentfeedbackFeedback | null | undefined; }; export type TestMutationVariables = { input: CommentCreateInput; @@ -1398,14 +1228,14 @@ export type InlineFragmentWithOverlappingFields = { readonly name: string | null; readonly message?: { readonly text: string | null; - } | null; - } | null; - readonly name?: string | null; + } | null | undefined; + } | null | undefined; + readonly name?: string | null | undefined; readonly " $refType": "InlineFragmentWithOverlappingFields"; }; export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; export type InlineFragmentWithOverlappingFields$key = { - readonly " $data"?: InlineFragmentWithOverlappingFields$data; + readonly " $data"?: InlineFragmentWithOverlappingFields$data | undefined; readonly " $fragmentRefs": FragmentRefs<"InlineFragmentWithOverlappingFields">; }; @@ -1426,7 +1256,7 @@ export type PluralFragment = ReadonlyArray<{ }>; export type PluralFragment$data = PluralFragment; export type PluralFragment$key = ReadonlyArray<{ - readonly " $data"?: PluralFragment$data; + readonly " $data"?: PluralFragment$data | undefined; readonly " $fragmentRefs": FragmentRefs<"PluralFragment">; }>; @@ -1456,7 +1286,7 @@ query TestDefer @raw_response_type { export type TestDeferVariables = {}; export type TestDeferResponse = { readonly node: { - readonly name?: string | null; + readonly name?: string | null | undefined; readonly friends?: { readonly edges: ReadonlyArray<{ readonly node: { @@ -1465,7 +1295,7 @@ export type TestDeferResponse = { } | null; } | null; } | null> | null; - } | null; + } | null | undefined; } | null; }; export type TestDeferRawResponse = { @@ -1533,7 +1363,7 @@ export type LinkedHandleFieldResponse = { readonly node: { readonly friends?: { readonly count: number | null; - } | null; + } | null | undefined; } | null; }; export type LinkedHandleFieldRawResponse = { @@ -1561,7 +1391,7 @@ export type ScalarHandleFieldVariables = { }; export type ScalarHandleFieldResponse = { readonly node: { - readonly name?: string | null; + readonly name?: string | null | undefined; } | null; }; export type ScalarHandleFieldRawResponse = { @@ -1638,17 +1468,17 @@ export type ExampleQuery = { // FriendFragment.graphql import { FragmentRefs } from "relay-runtime"; export type FriendFragment = { - readonly name?: string | null; - readonly lastName?: string | null; + readonly name?: string | null | undefined; + readonly lastName?: string | null | undefined; readonly feedback?: { readonly id: string; readonly name: string | null; - } | null; + } | null | undefined; readonly " $refType": "FriendFragment"; }; export type FriendFragment$data = FriendFragment; export type FriendFragment$key = { - readonly " $data"?: FriendFragment$data; + readonly " $data"?: FriendFragment$data | undefined; readonly " $fragmentRefs": FragmentRefs<"FriendFragment">; }; @@ -1690,7 +1520,7 @@ export type ExampleQueryResponse = { readonly username: string | null; readonly friends?: { readonly count: number | null; - } | null; + } | null | undefined; readonly " $fragmentRefs": FragmentRefs<"FriendFragment">; } | null; }; @@ -1711,17 +1541,17 @@ export type ExampleQuery = { // FriendFragment.graphql import { FragmentRefs } from "relay-runtime"; export type FriendFragment = { - readonly name?: string | null; - readonly lastName?: string | null; + readonly name?: string | null | undefined; + readonly lastName?: string | null | undefined; readonly feedback?: { readonly id: string; readonly name: string | null; - } | null; + } | null | undefined; readonly " $refType": "FriendFragment"; }; export type FriendFragment$data = FriendFragment; export type FriendFragment$key = { - readonly " $data"?: FriendFragment$data; + readonly " $data"?: FriendFragment$data | undefined; readonly " $fragmentRefs": FragmentRefs<"FriendFragment">; }; @@ -1753,14 +1583,14 @@ query TestStream @raw_response_type { export type TestStreamVariables = {}; export type TestStreamResponse = { readonly node: { - readonly name?: string | null; + readonly name?: string | null | undefined; readonly friends?: { readonly edges: ReadonlyArray<{ readonly node: { readonly id: string; } | null; } | null> | null; - } | null; + } | null | undefined; } | null; }; export type TestStreamRawResponse = { @@ -1819,7 +1649,7 @@ query TestDefer @raw_response_type { export type TestDeferVariables = {}; export type TestDeferResponse = { readonly node: { - readonly name?: string | null; + readonly name?: string | null | undefined; readonly friends?: { readonly edges: ReadonlyArray<{ readonly node: { @@ -1828,7 +1658,7 @@ export type TestDeferResponse = { } | null; } | null; } | null> | null; - } | null; + } | null | undefined; } | null; }; export type TestDeferRawResponse = { @@ -1886,7 +1716,7 @@ export type FragmentSpread = { }; export type FragmentSpread$data = FragmentSpread; export type FragmentSpread$key = { - readonly " $data"?: FragmentSpread$data; + readonly " $data"?: FragmentSpread$data | undefined; readonly " $fragmentRefs": FragmentRefs<"FragmentSpread">; }; @@ -1914,7 +1744,7 @@ export type RefetchableFragment = { }; export type RefetchableFragment$data = RefetchableFragment; export type RefetchableFragment$key = { - readonly " $data"?: RefetchableFragment$data; + readonly " $data"?: RefetchableFragment$data | undefined; readonly " $fragmentRefs": FragmentRefs<"RefetchableFragment">; }; @@ -1989,8 +1819,8 @@ export type RelayClientIDFieldQueryResponse = { readonly __id: string; readonly __typename: string; readonly text: string | null; - } | null; - } | null; + } | null | undefined; + } | null | undefined; } | null; }; export type RelayClientIDFieldQuery = { @@ -2052,22 +1882,22 @@ export type ExampleFragment = { }; export type ExampleFragment$data = ExampleFragment; export type ExampleFragment$key = { - readonly " $data"?: ExampleFragment$data; + readonly " $data"?: ExampleFragment$data | undefined; readonly " $fragmentRefs": FragmentRefs<"ExampleFragment">; }; // TestMutation.graphql export type CommentCreateInput = { - clientMutationId?: string | null; - feedbackId?: string | null; - feedback?: CommentfeedbackFeedback | null; + clientMutationId?: string | null | undefined; + feedbackId?: string | null | undefined; + feedback?: CommentfeedbackFeedback | null | undefined; }; export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null; + comment?: FeedbackcommentComment | null | undefined; }; export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null; + feedback?: CommentfeedbackFeedback | null | undefined; }; export type TestMutationVariables = { input: CommentCreateInput; @@ -2087,11 +1917,11 @@ export type TestMutation = { // TestSubscription.graphql export type FeedbackLikeInput = { - clientMutationId?: string | null; - feedbackId?: string | null; + clientMutationId?: string | null | undefined; + feedbackId?: string | null | undefined; }; export type TestSubscriptionVariables = { - input?: FeedbackLikeInput | null; + input?: FeedbackLikeInput | null | undefined; }; export type TestSubscriptionResponse = { readonly feedbackLikeSubscribe: { @@ -2143,7 +1973,7 @@ export type ScalarField = { }; export type ScalarField$data = ScalarField; export type ScalarField$key = { - readonly " $data"?: ScalarField$data; + readonly " $data"?: ScalarField$data | undefined; readonly " $fragmentRefs": FragmentRefs<"ScalarField">; }; @@ -2192,7 +2022,7 @@ export type TypenameInsideWithOverlappingFields = { }; export type TypenameInsideWithOverlappingFields$data = TypenameInsideWithOverlappingFields; export type TypenameInsideWithOverlappingFields$key = { - readonly " $data"?: TypenameInsideWithOverlappingFields$data; + readonly " $data"?: TypenameInsideWithOverlappingFields$data | undefined; readonly " $fragmentRefs": FragmentRefs<"TypenameInsideWithOverlappingFields">; }; @@ -2300,7 +2130,7 @@ export type TypenameInside = { }; export type TypenameInside$data = TypenameInside; export type TypenameInside$key = { - readonly " $data"?: TypenameInside$data; + readonly " $data"?: TypenameInside$data | undefined; readonly " $fragmentRefs": FragmentRefs<"TypenameInside">; }; @@ -2323,7 +2153,7 @@ export type TypenameOutside = { }; export type TypenameOutside$data = TypenameOutside; export type TypenameOutside$key = { - readonly " $data"?: TypenameOutside$data; + readonly " $data"?: TypenameOutside$data | undefined; readonly " $fragmentRefs": FragmentRefs<"TypenameOutside">; }; @@ -2332,18 +2162,18 @@ export type TypenameOutside$key = { import { FragmentRefs } from "relay-runtime"; export type TypenameOutsideWithAbstractType = { readonly __typename: string; - readonly username?: string | null; + readonly username?: string | null | undefined; readonly address?: { readonly city: string | null; readonly country: string | null; - readonly street?: string | null; - } | null; - readonly firstName?: string | null; + readonly street?: string | null | undefined; + } | null | undefined; + readonly firstName?: string | null | undefined; readonly " $refType": "TypenameOutsideWithAbstractType"; }; export type TypenameOutsideWithAbstractType$data = TypenameOutsideWithAbstractType; export type TypenameOutsideWithAbstractType$key = { - readonly " $data"?: TypenameOutsideWithAbstractType$data; + readonly " $data"?: TypenameOutsideWithAbstractType$data | undefined; readonly " $fragmentRefs": FragmentRefs<"TypenameOutsideWithAbstractType">; }; @@ -2357,7 +2187,7 @@ export type TypenameWithoutSpreads = { }; export type TypenameWithoutSpreads$data = TypenameWithoutSpreads; export type TypenameWithoutSpreads$key = { - readonly " $data"?: TypenameWithoutSpreads$data; + readonly " $data"?: TypenameWithoutSpreads$data | undefined; readonly " $fragmentRefs": FragmentRefs<"TypenameWithoutSpreads">; }; @@ -2371,7 +2201,7 @@ export type TypenameWithoutSpreadsAbstractType = { }; export type TypenameWithoutSpreadsAbstractType$data = TypenameWithoutSpreadsAbstractType; export type TypenameWithoutSpreadsAbstractType$key = { - readonly " $data"?: TypenameWithoutSpreadsAbstractType$data; + readonly " $data"?: TypenameWithoutSpreadsAbstractType$data | undefined; readonly " $fragmentRefs": FragmentRefs<"TypenameWithoutSpreadsAbstractType">; }; @@ -2381,13 +2211,13 @@ import { FragmentRefs } from "relay-runtime"; export type TypenameWithCommonSelections = { readonly __typename: string; readonly name: string | null; - readonly firstName?: string | null; - readonly username?: string | null; + readonly firstName?: string | null | undefined; + readonly username?: string | null | undefined; readonly " $refType": "TypenameWithCommonSelections"; }; export type TypenameWithCommonSelections$data = TypenameWithCommonSelections; export type TypenameWithCommonSelections$key = { - readonly " $data"?: TypenameWithCommonSelections$data; + readonly " $data"?: TypenameWithCommonSelections$data | undefined; readonly " $fragmentRefs": FragmentRefs<"TypenameWithCommonSelections">; }; @@ -2410,7 +2240,7 @@ export type TypenameAlias = { }; export type TypenameAlias$data = TypenameAlias; export type TypenameAlias$key = { - readonly " $data"?: TypenameAlias$data; + readonly " $data"?: TypenameAlias$data | undefined; readonly " $fragmentRefs": FragmentRefs<"TypenameAlias">; }; @@ -2438,7 +2268,7 @@ export type TypenameAliases = { }; export type TypenameAliases$data = TypenameAliases; export type TypenameAliases$key = { - readonly " $data"?: TypenameAliases$data; + readonly " $data"?: TypenameAliases$data | undefined; readonly " $fragmentRefs": FragmentRefs<"TypenameAliases">; }; @@ -2487,7 +2317,7 @@ export type UserProfile = { }; export type UserProfile$data = UserProfile; export type UserProfile$key = { - readonly " $data"?: UserProfile$data; + readonly " $data"?: UserProfile$data | undefined; readonly " $fragmentRefs": FragmentRefs<"UserProfile">; }; @@ -2501,7 +2331,7 @@ export type PhotoFragment = { }; export type PhotoFragment$data = PhotoFragment; export type PhotoFragment$key = { - readonly " $data"?: PhotoFragment$data; + readonly " $data"?: PhotoFragment$data | undefined; readonly " $fragmentRefs": FragmentRefs<"PhotoFragment">; }; @@ -2514,7 +2344,7 @@ export type RecursiveFragment = { }; export type RecursiveFragment$data = RecursiveFragment; export type RecursiveFragment$key = { - readonly " $data"?: RecursiveFragment$data; + readonly " $data"?: RecursiveFragment$data | undefined; readonly " $fragmentRefs": FragmentRefs<"RecursiveFragment">; }; @@ -2528,7 +2358,7 @@ export type AnotherRecursiveFragment = { }; export type AnotherRecursiveFragment$data = AnotherRecursiveFragment; export type AnotherRecursiveFragment$key = { - readonly " $data"?: AnotherRecursiveFragment$data; + readonly " $data"?: AnotherRecursiveFragment$data | undefined; readonly " $fragmentRefs": FragmentRefs<"AnotherRecursiveFragment">; }; @@ -2550,12 +2380,12 @@ fragment NestedCondition on Node { // ConditionField.graphql import { FragmentRefs } from "relay-runtime"; export type ConditionField = { - readonly id?: string; + readonly id?: string | undefined; readonly " $refType": "ConditionField"; }; export type ConditionField$data = ConditionField; export type ConditionField$key = { - readonly " $data"?: ConditionField$data; + readonly " $data"?: ConditionField$data | undefined; readonly " $fragmentRefs": FragmentRefs<"ConditionField">; }; @@ -2563,12 +2393,12 @@ export type ConditionField$key = { // NestedCondition.graphql import { FragmentRefs } from "relay-runtime"; export type NestedCondition = { - readonly id?: string; + readonly id?: string | undefined; readonly " $refType": "NestedCondition"; }; export type NestedCondition$data = NestedCondition; export type NestedCondition$key = { - readonly " $data"?: NestedCondition$data; + readonly " $data"?: NestedCondition$data | undefined; readonly " $fragmentRefs": FragmentRefs<"NestedCondition">; }; @@ -2642,7 +2472,7 @@ export type FragmentSpread = { }; export type FragmentSpread$data = FragmentSpread; export type FragmentSpread$key = { - readonly " $data"?: FragmentSpread$data; + readonly " $data"?: FragmentSpread$data | undefined; readonly " $fragmentRefs": FragmentRefs<"FragmentSpread">; }; @@ -2666,7 +2496,7 @@ export type ConcreateTypes = { }; export type ConcreateTypes$data = ConcreateTypes; export type ConcreateTypes$key = { - readonly " $data"?: ConcreateTypes$data; + readonly " $data"?: ConcreateTypes$data | undefined; readonly " $fragmentRefs": FragmentRefs<"ConcreateTypes">; }; @@ -2684,7 +2514,7 @@ export type PictureFragment = { }; export type PictureFragment$data = PictureFragment; export type PictureFragment$key = { - readonly " $data"?: PictureFragment$data; + readonly " $data"?: PictureFragment$data | undefined; readonly " $fragmentRefs": FragmentRefs<"PictureFragment">; }; @@ -2697,7 +2527,7 @@ export type OtherFragment = { }; export type OtherFragment$data = OtherFragment; export type OtherFragment$key = { - readonly " $data"?: OtherFragment$data; + readonly " $data"?: OtherFragment$data | undefined; readonly " $fragmentRefs": FragmentRefs<"OtherFragment">; }; @@ -2715,7 +2545,7 @@ export type PageFragment = { }; export type PageFragment$data = PageFragment; export type PageFragment$key = { - readonly " $data"?: PageFragment$data; + readonly " $data"?: PageFragment$data | undefined; readonly " $fragmentRefs": FragmentRefs<"PageFragment">; }; @@ -2733,7 +2563,7 @@ export type UserFrag1 = { }; export type UserFrag1$data = UserFrag1; export type UserFrag1$key = { - readonly " $data"?: UserFrag1$data; + readonly " $data"?: UserFrag1$data | undefined; readonly " $fragmentRefs": FragmentRefs<"UserFrag1">; }; @@ -2751,7 +2581,7 @@ export type UserFrag2 = { }; export type UserFrag2$data = UserFrag2; export type UserFrag2$key = { - readonly " $data"?: UserFrag2$data; + readonly " $data"?: UserFrag2$data | undefined; readonly " $fragmentRefs": FragmentRefs<"UserFrag2">; }; @@ -2829,15 +2659,15 @@ fragment SomeFragment on User { import { FragmentRefs } from "relay-runtime"; export type InlineFragment = { readonly id: string; - readonly name?: string | null; + readonly name?: string | null | undefined; readonly message?: { readonly text: string | null; - } | null; + } | null | undefined; readonly " $refType": "InlineFragment"; }; export type InlineFragment$data = InlineFragment; export type InlineFragment$key = { - readonly " $data"?: InlineFragment$data; + readonly " $data"?: InlineFragment$data | undefined; readonly " $fragmentRefs": FragmentRefs<"InlineFragment">; }; @@ -2850,14 +2680,14 @@ export type InlineFragmentWithOverlappingFields = { readonly name: string | null; readonly message?: { readonly text: string | null; - } | null; - } | null; - readonly name?: string | null; + } | null | undefined; + } | null | undefined; + readonly name?: string | null | undefined; readonly " $refType": "InlineFragmentWithOverlappingFields"; }; export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; export type InlineFragmentWithOverlappingFields$key = { - readonly " $data"?: InlineFragmentWithOverlappingFields$data; + readonly " $data"?: InlineFragmentWithOverlappingFields$data | undefined; readonly " $fragmentRefs": FragmentRefs<"InlineFragmentWithOverlappingFields">; }; @@ -2865,13 +2695,13 @@ export type InlineFragmentWithOverlappingFields$key = { // InlineFragmentConditionalID.graphql import { FragmentRefs } from "relay-runtime"; export type InlineFragmentConditionalID = { - readonly id?: string; - readonly name?: string | null; + readonly id?: string | undefined; + readonly name?: string | null | undefined; readonly " $refType": "InlineFragmentConditionalID"; }; export type InlineFragmentConditionalID$data = InlineFragmentConditionalID; export type InlineFragmentConditionalID$key = { - readonly " $data"?: InlineFragmentConditionalID$data; + readonly " $data"?: InlineFragmentConditionalID$data | undefined; readonly " $fragmentRefs": FragmentRefs<"InlineFragmentConditionalID">; }; @@ -2883,17 +2713,17 @@ export type InlineFragmentKitchenSink = { readonly id: string; readonly profilePicture: { readonly uri: string | null; - readonly width?: number | null; - readonly height?: number | null; + readonly width?: number | null | undefined; + readonly height?: number | null | undefined; } | null; - readonly name?: string | null; + readonly name?: string | null | undefined; readonly " $fragmentRefs": FragmentRefs<"SomeFragment">; } | null; readonly " $refType": "InlineFragmentKitchenSink"; }; export type InlineFragmentKitchenSink$data = InlineFragmentKitchenSink; export type InlineFragmentKitchenSink$key = { - readonly " $data"?: InlineFragmentKitchenSink$data; + readonly " $data"?: InlineFragmentKitchenSink$data | undefined; readonly " $fragmentRefs": FragmentRefs<"InlineFragmentKitchenSink">; }; @@ -2911,7 +2741,7 @@ export type SomeFragment = { }; export type SomeFragment$data = SomeFragment; export type SomeFragment$key = { - readonly " $data"?: SomeFragment$data; + readonly " $data"?: SomeFragment$data | undefined; readonly " $fragmentRefs": FragmentRefs<"SomeFragment">; }; @@ -2969,7 +2799,7 @@ export type LinkedField = { }; export type LinkedField$data = LinkedField; export type LinkedField$key = { - readonly " $data"?: LinkedField$data; + readonly " $data"?: LinkedField$data | undefined; readonly " $fragmentRefs": FragmentRefs<"LinkedField">; }; @@ -3024,15 +2854,15 @@ import { FragmentRefs } from "relay-runtime"; export type NameRendererFragment = { readonly id: string; readonly nameRenderer: { - readonly __fragmentPropName?: string | null; - readonly __module_component?: string | null; + readonly __fragmentPropName?: string | null | undefined; + readonly __module_component?: string | null | undefined; readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">; } | null; readonly " $refType": "NameRendererFragment"; }; export type NameRendererFragment$data = NameRendererFragment; export type NameRendererFragment$key = { - readonly " $data"?: NameRendererFragment$data; + readonly " $data"?: NameRendererFragment$data | undefined; readonly " $fragmentRefs": FragmentRefs<"NameRendererFragment">; }; @@ -3048,7 +2878,7 @@ 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 | undefined; readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">; }; @@ -3064,7 +2894,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 | undefined; readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">; }; @@ -3103,8 +2933,8 @@ export type NameRendererQueryVariables = {}; export type NameRendererQueryResponse = { readonly me: { readonly nameRenderer: { - readonly __fragmentPropName?: string | null; - readonly __module_component?: string | null; + readonly __fragmentPropName?: string | null | undefined; + readonly __module_component?: string | null | undefined; readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name" | "MarkdownUserNameRenderer_name">; } | null; } | null; @@ -3126,7 +2956,7 @@ 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 | undefined; readonly " $fragmentRefs": FragmentRefs<"PlainUserNameRenderer_name">; }; @@ -3142,182 +2972,12 @@ 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 | undefined; readonly " $fragmentRefs": FragmentRefs<"MarkdownUserNameRenderer_name">; }; `; -exports[`Snapshot tests TypeScriptGenerator without a single artifact directory matches expected output: mutaion-with-client-extension.graphql 1`] = ` -~~~~~~~~~~ INPUT ~~~~~~~~~~ -mutation Test($input: UpdateAllSeenStateInput) @raw_response_type { - viewerNotificationsUpdateAllSeenState(input: $input) { - stories { - foos { - bar - } - } - } -} - -extend type Story { - foos: [Foo] -} - -type Foo { - bar: String -} - -~~~~~~~~~~ OUTPUT ~~~~~~~~~~ -// Test.graphql -export type UpdateAllSeenStateInput = { - clientMutationId?: string | null; - storyIds?: Array | 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 = { - readonly response: TestResponse; - readonly variables: TestVariables; - readonly rawResponse: TestRawResponse; -}; - -`; - -exports[`Snapshot tests TypeScriptGenerator without a single artifact directory matches expected output: mutaion-with-response-on-inline-fragments.graphql 1`] = ` -~~~~~~~~~~ INPUT ~~~~~~~~~~ -mutation TestMutation($input: CommentCreateInput!) @raw_response_type { - commentCreate(input: $input) { - viewer { - actor { - ...InlineFragmentWithOverlappingFields - } - } - } -} - -fragment InlineFragmentWithOverlappingFields on Actor { - ... on User { - hometown { - id - name - } - } - ... on Page { - name - hometown { - id - message { - text - } - } - } -} - -~~~~~~~~~~ OUTPUT ~~~~~~~~~~ -// TestMutation.graphql -import { FragmentRefs } from "relay-runtime"; -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 = { - readonly response: TestMutationResponse; - readonly variables: TestMutationVariables; - readonly rawResponse: TestMutationRawResponse; -}; - - -// InlineFragmentWithOverlappingFields.graphql -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": "InlineFragmentWithOverlappingFields"; -}; -export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; -export type InlineFragmentWithOverlappingFields$key = { - readonly " $data"?: InlineFragmentWithOverlappingFields$data; - readonly " $fragmentRefs": FragmentRefs<"InlineFragmentWithOverlappingFields">; -}; - -`; - exports[`Snapshot tests TypeScriptGenerator without a single artifact directory matches expected output: mutation.graphql 1`] = ` ~~~~~~~~~~ INPUT ~~~~~~~~~~ mutation CommentCreateMutation( @@ -3339,20 +2999,20 @@ mutation CommentCreateMutation( ~~~~~~~~~~ OUTPUT ~~~~~~~~~~ // CommentCreateMutation.graphql export type CommentCreateInput = { - clientMutationId?: string | null; - feedbackId?: string | null; - feedback?: CommentfeedbackFeedback | null; + clientMutationId?: string | null | undefined; + feedbackId?: string | null | undefined; + feedback?: CommentfeedbackFeedback | null | undefined; }; export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null; + comment?: FeedbackcommentComment | null | undefined; }; export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null; + feedback?: CommentfeedbackFeedback | null | undefined; }; export type CommentCreateMutationVariables = { input: CommentCreateInput; - first?: number | null; - orderBy?: Array | null; + first?: number | null | undefined; + orderBy?: Array | null | undefined; }; export type CommentCreateMutationResponse = { readonly commentCreate: { @@ -3385,11 +3045,11 @@ mutation InputHasArray($input: UpdateAllSeenStateInput) @raw_response_type { ~~~~~~~~~~ OUTPUT ~~~~~~~~~~ // InputHasArray.graphql export type UpdateAllSeenStateInput = { - clientMutationId?: string | null; - storyIds?: Array | null; + clientMutationId?: string | null | undefined; + storyIds?: Array | null | undefined; }; export type InputHasArrayVariables = { - input?: UpdateAllSeenStateInput | null; + input?: UpdateAllSeenStateInput | null | undefined; }; export type InputHasArrayResponse = { readonly viewerNotificationsUpdateAllSeenState: { @@ -3447,15 +3107,15 @@ mutation PrependEdgeMutation( ~~~~~~~~~~ OUTPUT ~~~~~~~~~~ // AppendEdgeMutation.graphql export type CommentCreateInput = { - clientMutationId?: string | null; - feedbackId?: string | null; - feedback?: CommentfeedbackFeedback | null; + clientMutationId?: string | null | undefined; + feedbackId?: string | null | undefined; + feedback?: CommentfeedbackFeedback | null | undefined; }; export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null; + comment?: FeedbackcommentComment | null | undefined; }; export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null; + feedback?: CommentfeedbackFeedback | null | undefined; }; export type AppendEdgeMutationVariables = { input: CommentCreateInput; @@ -3479,15 +3139,15 @@ export type AppendEdgeMutation = { // PrependEdgeMutation.graphql export type CommentCreateInput = { - clientMutationId?: string | null; - feedbackId?: string | null; - feedback?: CommentfeedbackFeedback | null; + clientMutationId?: string | null | undefined; + feedbackId?: string | null | undefined; + feedback?: CommentfeedbackFeedback | null | undefined; }; export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null; + comment?: FeedbackcommentComment | null | undefined; }; export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null; + feedback?: CommentfeedbackFeedback | null | undefined; }; export type PrependEdgeMutationVariables = { input: CommentCreateInput; @@ -3532,11 +3192,11 @@ type Foo { ~~~~~~~~~~ OUTPUT ~~~~~~~~~~ // Test.graphql export type UpdateAllSeenStateInput = { - clientMutationId?: string | null; - storyIds?: Array | null; + clientMutationId?: string | null | undefined; + storyIds?: Array | null | undefined; }; export type TestVariables = { - input?: UpdateAllSeenStateInput | null; + input?: UpdateAllSeenStateInput | null | undefined; }; export type TestResponse = { readonly viewerNotificationsUpdateAllSeenState: { @@ -3553,7 +3213,7 @@ export type TestRawResponse = { readonly id: string; readonly foos?: ReadonlyArray<({ readonly bar: string | null; - }) | null> | null; + }) | null> | null | undefined; }) | null> | null; }) | null; }; @@ -3577,8 +3237,8 @@ mutation DeleteRecordMutation( ~~~~~~~~~~ OUTPUT ~~~~~~~~~~ // DeleteRecordMutation.graphql export type CommentDeleteInput = { - clientMutationId?: string | null; - commentId?: string | null; + clientMutationId?: string | null | undefined; + commentId?: string | null | undefined; }; export type DeleteRecordMutationVariables = { input: CommentDeleteInput; @@ -3630,20 +3290,20 @@ fragment FriendFragment on User { import { FragmentRefs } from "relay-runtime"; export type TestEnums = "mark" | "zuck" | "%future added value"; export type CommentCreateInput = { - clientMutationId?: string | null; - feedbackId?: string | null; - feedback?: CommentfeedbackFeedback | null; + clientMutationId?: string | null | undefined; + feedbackId?: string | null | undefined; + feedback?: CommentfeedbackFeedback | null | undefined; }; export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null; + comment?: FeedbackcommentComment | null | undefined; }; export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null; + feedback?: CommentfeedbackFeedback | null | undefined; }; export type CommentCreateMutationVariables = { input: CommentCreateInput; - first?: number | null; - orderBy?: Array | null; + first?: number | null | undefined; + orderBy?: Array | null | undefined; }; export type CommentCreateMutationResponse = { readonly commentCreate: { @@ -3700,7 +3360,7 @@ export type FriendFragment = { }; export type FriendFragment$data = FriendFragment; export type FriendFragment$key = { - readonly " $data"?: FriendFragment$data; + readonly " $data"?: FriendFragment$data | undefined; readonly " $fragmentRefs": FragmentRefs<"FriendFragment">; }; @@ -3744,20 +3404,20 @@ fragment FeedbackFragment on Feedback { // CommentCreateMutation.graphql import { FragmentRefs } from "relay-runtime"; export type CommentCreateInput = { - clientMutationId?: string | null; - feedbackId?: string | null; - feedback?: CommentfeedbackFeedback | null; + clientMutationId?: string | null | undefined; + feedbackId?: string | null | undefined; + feedback?: CommentfeedbackFeedback | null | undefined; }; export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null; + comment?: FeedbackcommentComment | null | undefined; }; export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null; + feedback?: CommentfeedbackFeedback | null | undefined; }; export type CommentCreateMutationVariables = { input: CommentCreateInput; - first?: number | null; - orderBy?: Array | null; + first?: number | null | undefined; + orderBy?: Array | null | undefined; }; export type CommentCreateMutationResponse = { readonly commentCreate: { @@ -3812,7 +3472,7 @@ export type FriendFragment = { }; export type FriendFragment$data = FriendFragment; export type FriendFragment$key = { - readonly " $data"?: FriendFragment$data; + readonly " $data"?: FriendFragment$data | undefined; readonly " $fragmentRefs": FragmentRefs<"FriendFragment">; }; @@ -3826,7 +3486,7 @@ export type FeedbackFragment = { }; export type FeedbackFragment$data = FeedbackFragment; export type FeedbackFragment$key = { - readonly " $data"?: FeedbackFragment$data; + readonly " $data"?: FeedbackFragment$data | undefined; readonly " $fragmentRefs": FragmentRefs<"FeedbackFragment">; }; @@ -3865,15 +3525,15 @@ fragment InlineFragmentWithOverlappingFields on Actor { // TestMutation.graphql import { FragmentRefs } from "relay-runtime"; export type CommentCreateInput = { - clientMutationId?: string | null; - feedbackId?: string | null; - feedback?: CommentfeedbackFeedback | null; + clientMutationId?: string | null | undefined; + feedbackId?: string | null | undefined; + feedback?: CommentfeedbackFeedback | null | undefined; }; export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null; + comment?: FeedbackcommentComment | null | undefined; }; export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null; + feedback?: CommentfeedbackFeedback | null | undefined; }; export type TestMutationVariables = { input: CommentCreateInput; @@ -3932,14 +3592,14 @@ export type InlineFragmentWithOverlappingFields = { readonly name: string | null; readonly message?: { readonly text: string | null; - } | null; - } | null; - readonly name?: string | null; + } | null | undefined; + } | null | undefined; + readonly name?: string | null | undefined; readonly " $refType": "InlineFragmentWithOverlappingFields"; }; export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields; export type InlineFragmentWithOverlappingFields$key = { - readonly " $data"?: InlineFragmentWithOverlappingFields$data; + readonly " $data"?: InlineFragmentWithOverlappingFields$data | undefined; readonly " $fragmentRefs": FragmentRefs<"InlineFragmentWithOverlappingFields">; }; @@ -3960,7 +3620,7 @@ export type PluralFragment = ReadonlyArray<{ }>; export type PluralFragment$data = PluralFragment; export type PluralFragment$key = ReadonlyArray<{ - readonly " $data"?: PluralFragment$data; + readonly " $data"?: PluralFragment$data | undefined; readonly " $fragmentRefs": FragmentRefs<"PluralFragment">; }>; @@ -3990,7 +3650,7 @@ query TestDefer @raw_response_type { export type TestDeferVariables = {}; export type TestDeferResponse = { readonly node: { - readonly name?: string | null; + readonly name?: string | null | undefined; readonly friends?: { readonly edges: ReadonlyArray<{ readonly node: { @@ -3999,7 +3659,7 @@ export type TestDeferResponse = { } | null; } | null; } | null> | null; - } | null; + } | null | undefined; } | null; }; export type TestDeferRawResponse = { @@ -4067,7 +3727,7 @@ export type LinkedHandleFieldResponse = { readonly node: { readonly friends?: { readonly count: number | null; - } | null; + } | null | undefined; } | null; }; export type LinkedHandleFieldRawResponse = { @@ -4095,7 +3755,7 @@ export type ScalarHandleFieldVariables = { }; export type ScalarHandleFieldResponse = { readonly node: { - readonly name?: string | null; + readonly name?: string | null | undefined; } | null; }; export type ScalarHandleFieldRawResponse = { @@ -4172,17 +3832,17 @@ export type ExampleQuery = { // FriendFragment.graphql import { FragmentRefs } from "relay-runtime"; export type FriendFragment = { - readonly name?: string | null; - readonly lastName?: string | null; + readonly name?: string | null | undefined; + readonly lastName?: string | null | undefined; readonly feedback?: { readonly id: string; readonly name: string | null; - } | null; + } | null | undefined; readonly " $refType": "FriendFragment"; }; export type FriendFragment$data = FriendFragment; export type FriendFragment$key = { - readonly " $data"?: FriendFragment$data; + readonly " $data"?: FriendFragment$data | undefined; readonly " $fragmentRefs": FragmentRefs<"FriendFragment">; }; @@ -4224,7 +3884,7 @@ export type ExampleQueryResponse = { readonly username: string | null; readonly friends?: { readonly count: number | null; - } | null; + } | null | undefined; readonly " $fragmentRefs": FragmentRefs<"FriendFragment">; } | null; }; @@ -4245,17 +3905,17 @@ export type ExampleQuery = { // FriendFragment.graphql import { FragmentRefs } from "relay-runtime"; export type FriendFragment = { - readonly name?: string | null; - readonly lastName?: string | null; + readonly name?: string | null | undefined; + readonly lastName?: string | null | undefined; readonly feedback?: { readonly id: string; readonly name: string | null; - } | null; + } | null | undefined; readonly " $refType": "FriendFragment"; }; export type FriendFragment$data = FriendFragment; export type FriendFragment$key = { - readonly " $data"?: FriendFragment$data; + readonly " $data"?: FriendFragment$data | undefined; readonly " $fragmentRefs": FragmentRefs<"FriendFragment">; }; @@ -4287,14 +3947,14 @@ query TestStream @raw_response_type { export type TestStreamVariables = {}; export type TestStreamResponse = { readonly node: { - readonly name?: string | null; + readonly name?: string | null | undefined; readonly friends?: { readonly edges: ReadonlyArray<{ readonly node: { readonly id: string; } | null; } | null> | null; - } | null; + } | null | undefined; } | null; }; export type TestStreamRawResponse = { @@ -4353,7 +4013,7 @@ query TestDefer @raw_response_type { export type TestDeferVariables = {}; export type TestDeferResponse = { readonly node: { - readonly name?: string | null; + readonly name?: string | null | undefined; readonly friends?: { readonly edges: ReadonlyArray<{ readonly node: { @@ -4362,7 +4022,7 @@ export type TestDeferResponse = { } | null; } | null; } | null> | null; - } | null; + } | null | undefined; } | null; }; export type TestDeferRawResponse = { @@ -4420,7 +4080,7 @@ export type FragmentSpread = { }; export type FragmentSpread$data = FragmentSpread; export type FragmentSpread$key = { - readonly " $data"?: FragmentSpread$data; + readonly " $data"?: FragmentSpread$data | undefined; readonly " $fragmentRefs": FragmentRefs<"FragmentSpread">; }; @@ -4448,7 +4108,7 @@ export type RefetchableFragment = { }; export type RefetchableFragment$data = RefetchableFragment; export type RefetchableFragment$key = { - readonly " $data"?: RefetchableFragment$data; + readonly " $data"?: RefetchableFragment$data | undefined; readonly " $fragmentRefs": FragmentRefs<"RefetchableFragment">; }; @@ -4523,8 +4183,8 @@ export type RelayClientIDFieldQueryResponse = { readonly __id: string; readonly __typename: string; readonly text: string | null; - } | null; - } | null; + } | null | undefined; + } | null | undefined; } | null; }; export type RelayClientIDFieldQuery = { @@ -4586,22 +4246,22 @@ export type ExampleFragment = { }; export type ExampleFragment$data = ExampleFragment; export type ExampleFragment$key = { - readonly " $data"?: ExampleFragment$data; + readonly " $data"?: ExampleFragment$data | undefined; readonly " $fragmentRefs": FragmentRefs<"ExampleFragment">; }; // TestMutation.graphql export type CommentCreateInput = { - clientMutationId?: string | null; - feedbackId?: string | null; - feedback?: CommentfeedbackFeedback | null; + clientMutationId?: string | null | undefined; + feedbackId?: string | null | undefined; + feedback?: CommentfeedbackFeedback | null | undefined; }; export type CommentfeedbackFeedback = { - comment?: FeedbackcommentComment | null; + comment?: FeedbackcommentComment | null | undefined; }; export type FeedbackcommentComment = { - feedback?: CommentfeedbackFeedback | null; + feedback?: CommentfeedbackFeedback | null | undefined; }; export type TestMutationVariables = { input: CommentCreateInput; @@ -4621,11 +4281,11 @@ export type TestMutation = { // TestSubscription.graphql export type FeedbackLikeInput = { - clientMutationId?: string | null; - feedbackId?: string | null; + clientMutationId?: string | null | undefined; + feedbackId?: string | null | undefined; }; export type TestSubscriptionVariables = { - input?: FeedbackLikeInput | null; + input?: FeedbackLikeInput | null | undefined; }; export type TestSubscriptionResponse = { readonly feedbackLikeSubscribe: { @@ -4677,7 +4337,7 @@ export type ScalarField = { }; export type ScalarField$data = ScalarField; export type ScalarField$key = { - readonly " $data"?: ScalarField$data; + readonly " $data"?: ScalarField$data | undefined; readonly " $fragmentRefs": FragmentRefs<"ScalarField">; }; @@ -4726,7 +4386,7 @@ export type TypenameInsideWithOverlappingFields = { }; export type TypenameInsideWithOverlappingFields$data = TypenameInsideWithOverlappingFields; export type TypenameInsideWithOverlappingFields$key = { - readonly " $data"?: TypenameInsideWithOverlappingFields$data; + readonly " $data"?: TypenameInsideWithOverlappingFields$data | undefined; readonly " $fragmentRefs": FragmentRefs<"TypenameInsideWithOverlappingFields">; }; @@ -4834,7 +4494,7 @@ export type TypenameInside = { }; export type TypenameInside$data = TypenameInside; export type TypenameInside$key = { - readonly " $data"?: TypenameInside$data; + readonly " $data"?: TypenameInside$data | undefined; readonly " $fragmentRefs": FragmentRefs<"TypenameInside">; }; @@ -4857,7 +4517,7 @@ export type TypenameOutside = { }; export type TypenameOutside$data = TypenameOutside; export type TypenameOutside$key = { - readonly " $data"?: TypenameOutside$data; + readonly " $data"?: TypenameOutside$data | undefined; readonly " $fragmentRefs": FragmentRefs<"TypenameOutside">; }; @@ -4866,18 +4526,18 @@ export type TypenameOutside$key = { import { FragmentRefs } from "relay-runtime"; export type TypenameOutsideWithAbstractType = { readonly __typename: string; - readonly username?: string | null; + readonly username?: string | null | undefined; readonly address?: { readonly city: string | null; readonly country: string | null; - readonly street?: string | null; - } | null; - readonly firstName?: string | null; + readonly street?: string | null | undefined; + } | null | undefined; + readonly firstName?: string | null | undefined; readonly " $refType": "TypenameOutsideWithAbstractType"; }; export type TypenameOutsideWithAbstractType$data = TypenameOutsideWithAbstractType; export type TypenameOutsideWithAbstractType$key = { - readonly " $data"?: TypenameOutsideWithAbstractType$data; + readonly " $data"?: TypenameOutsideWithAbstractType$data | undefined; readonly " $fragmentRefs": FragmentRefs<"TypenameOutsideWithAbstractType">; }; @@ -4891,7 +4551,7 @@ export type TypenameWithoutSpreads = { }; export type TypenameWithoutSpreads$data = TypenameWithoutSpreads; export type TypenameWithoutSpreads$key = { - readonly " $data"?: TypenameWithoutSpreads$data; + readonly " $data"?: TypenameWithoutSpreads$data | undefined; readonly " $fragmentRefs": FragmentRefs<"TypenameWithoutSpreads">; }; @@ -4905,7 +4565,7 @@ export type TypenameWithoutSpreadsAbstractType = { }; export type TypenameWithoutSpreadsAbstractType$data = TypenameWithoutSpreadsAbstractType; export type TypenameWithoutSpreadsAbstractType$key = { - readonly " $data"?: TypenameWithoutSpreadsAbstractType$data; + readonly " $data"?: TypenameWithoutSpreadsAbstractType$data | undefined; readonly " $fragmentRefs": FragmentRefs<"TypenameWithoutSpreadsAbstractType">; }; @@ -4915,13 +4575,13 @@ import { FragmentRefs } from "relay-runtime"; export type TypenameWithCommonSelections = { readonly __typename: string; readonly name: string | null; - readonly firstName?: string | null; - readonly username?: string | null; + readonly firstName?: string | null | undefined; + readonly username?: string | null | undefined; readonly " $refType": "TypenameWithCommonSelections"; }; export type TypenameWithCommonSelections$data = TypenameWithCommonSelections; export type TypenameWithCommonSelections$key = { - readonly " $data"?: TypenameWithCommonSelections$data; + readonly " $data"?: TypenameWithCommonSelections$data | undefined; readonly " $fragmentRefs": FragmentRefs<"TypenameWithCommonSelections">; }; @@ -4944,7 +4604,7 @@ export type TypenameAlias = { }; export type TypenameAlias$data = TypenameAlias; export type TypenameAlias$key = { - readonly " $data"?: TypenameAlias$data; + readonly " $data"?: TypenameAlias$data | undefined; readonly " $fragmentRefs": FragmentRefs<"TypenameAlias">; }; @@ -4972,7 +4632,7 @@ export type TypenameAliases = { }; export type TypenameAliases$data = TypenameAliases; export type TypenameAliases$key = { - readonly " $data"?: TypenameAliases$data; + readonly " $data"?: TypenameAliases$data | undefined; readonly " $fragmentRefs": FragmentRefs<"TypenameAliases">; }; @@ -5021,7 +4681,7 @@ export type UserProfile = { }; export type UserProfile$data = UserProfile; export type UserProfile$key = { - readonly " $data"?: UserProfile$data; + readonly " $data"?: UserProfile$data | undefined; readonly " $fragmentRefs": FragmentRefs<"UserProfile">; }; @@ -5035,7 +4695,7 @@ export type PhotoFragment = { }; export type PhotoFragment$data = PhotoFragment; export type PhotoFragment$key = { - readonly " $data"?: PhotoFragment$data; + readonly " $data"?: PhotoFragment$data | undefined; readonly " $fragmentRefs": FragmentRefs<"PhotoFragment">; }; @@ -5048,7 +4708,7 @@ export type RecursiveFragment = { }; export type RecursiveFragment$data = RecursiveFragment; export type RecursiveFragment$key = { - readonly " $data"?: RecursiveFragment$data; + readonly " $data"?: RecursiveFragment$data | undefined; readonly " $fragmentRefs": FragmentRefs<"RecursiveFragment">; }; @@ -5062,7 +4722,7 @@ export type AnotherRecursiveFragment = { }; export type AnotherRecursiveFragment$data = AnotherRecursiveFragment; export type AnotherRecursiveFragment$key = { - readonly " $data"?: AnotherRecursiveFragment$data; + readonly " $data"?: AnotherRecursiveFragment$data | undefined; readonly " $fragmentRefs": FragmentRefs<"AnotherRecursiveFragment">; }; diff --git a/test/fixtures/type-generator/mutaion-with-client-extension.graphql b/test/fixtures/type-generator/mutaion-with-client-extension.graphql deleted file mode 100644 index 51c8910f..00000000 --- a/test/fixtures/type-generator/mutaion-with-client-extension.graphql +++ /dev/null @@ -1,17 +0,0 @@ -mutation Test($input: UpdateAllSeenStateInput) @raw_response_type { - viewerNotificationsUpdateAllSeenState(input: $input) { - stories { - foos { - bar - } - } - } -} - -extend type Story { - foos: [Foo] -} - -type Foo { - bar: String -} diff --git a/test/fixtures/type-generator/mutaion-with-response-on-inline-fragments.graphql b/test/fixtures/type-generator/mutaion-with-response-on-inline-fragments.graphql deleted file mode 100644 index 031b989f..00000000 --- a/test/fixtures/type-generator/mutaion-with-response-on-inline-fragments.graphql +++ /dev/null @@ -1,27 +0,0 @@ -mutation TestMutation($input: CommentCreateInput!) @raw_response_type { - commentCreate(input: $input) { - viewer { - actor { - ...InlineFragmentWithOverlappingFields - } - } - } -} - -fragment InlineFragmentWithOverlappingFields on Actor { - ... on User { - hometown { - id - name - } - } - ... on Page { - name - hometown { - id - message { - text - } - } - } -} diff --git a/tsconfig.json b/tsconfig.json index fffeb892..ce645c5a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -33,6 +33,7 @@ // "noUnusedParameters": true, /* Report errors on unused parameters. */ // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + "exactOptionalPropertyTypes": true, /* Module Resolution Options */ // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ "baseUrl": "./" /* Base directory to resolve non-absolute module names. */,