@@ -90,6 +90,7 @@ fragment UserFrag1 on User {
90
90
fragment UserFrag2 on User {
91
91
__typename
92
92
}
93
+
93
94
~~~~~~~~~~ OUTPUT ~~~~~~~~~~
94
95
// FragmentSpread.graphql
95
96
import { FragmentRefs } from "relay-runtime";
@@ -613,6 +614,176 @@ export type MarkdownUserNameRenderer_name$key = {
613
614
614
615
` ;
615
616
617
+ exports [` Snapshot tests TypeScriptGenerator with a single artifact directory matches expected output: mutaion-with-client-extension.graphql 1` ] = `
618
+ ~~~~~~~~~~ INPUT ~~~~~~~~~~
619
+ mutation Test($input: UpdateAllSeenStateInput) @raw_response_type {
620
+ viewerNotificationsUpdateAllSeenState (input : $input ) {
621
+ stories {
622
+ foos {
623
+ bar
624
+ }
625
+ }
626
+ }
627
+ }
628
+
629
+ extend type Story {
630
+ foos : [Foo ]
631
+ }
632
+
633
+ type Foo {
634
+ bar : String
635
+ }
636
+
637
+ ~~~~~~~~~~ OUTPUT ~~~~~~~~~~
638
+ // Test.graphql
639
+ export type UpdateAllSeenStateInput = {
640
+ clientMutationId ?: string | null ;
641
+ storyIds ?: Array < string | null > | null ;
642
+ } ;
643
+ export type TestVariables = {
644
+ input ?: UpdateAllSeenStateInput | null ;
645
+ } ;
646
+ export type TestResponse = {
647
+ readonly viewerNotificationsUpdateAllSeenState : {
648
+ readonly stories: ReadonlyArray < {
649
+ readonly foos: ReadonlyArray < {
650
+ readonly bar: string | null ;
651
+ } | null > | null ;
652
+ } | null > | null ;
653
+ } | null ;
654
+ } ;
655
+ export type TestRawResponse = {
656
+ readonly viewerNotificationsUpdateAllSeenState : ({
657
+ readonly stories: ReadonlyArray < ({
658
+ readonly id: string ;
659
+ readonly foos ?: ReadonlyArray < ({
660
+ readonly bar: string | null ;
661
+ }) | null > | null ;
662
+ }) | null > | null ;
663
+ }) | null ;
664
+ } ;
665
+ export type Test = {
666
+ readonly response : TestResponse ;
667
+ readonly variables : TestVariables ;
668
+ readonly rawResponse : TestRawResponse ;
669
+ } ;
670
+
671
+ ` ;
672
+
673
+ exports [` Snapshot tests TypeScriptGenerator with a single artifact directory matches expected output: mutaion-with-response-on-inline-fragments.graphql 1` ] = `
674
+ ~~~~~~~~~~ INPUT ~~~~~~~~~~
675
+ mutation TestMutation($input: CommentCreateInput!) @raw_response_type {
676
+ commentCreate (input : $input ) {
677
+ viewer {
678
+ actor {
679
+ ... InlineFragmentWithOverlappingFields
680
+ }
681
+ }
682
+ }
683
+ }
684
+
685
+ fragment InlineFragmentWithOverlappingFields on Actor {
686
+ ... on User {
687
+ hometown {
688
+ id
689
+ name
690
+ }
691
+ }
692
+ ... on Page {
693
+ name
694
+ hometown {
695
+ id
696
+ message {
697
+ text
698
+ }
699
+ }
700
+ }
701
+ }
702
+
703
+ ~~~~~~~~~~ OUTPUT ~~~~~~~~~~
704
+ // TestMutation.graphql
705
+ import { FragmentRefs } from "relay-runtime";
706
+ export type CommentCreateInput = {
707
+ clientMutationId ?: string | null ;
708
+ feedbackId ?: string | null ;
709
+ feedback ?: CommentfeedbackFeedback | null ;
710
+ } ;
711
+ export type CommentfeedbackFeedback = {
712
+ comment ?: FeedbackcommentComment | null ;
713
+ } ;
714
+ export type FeedbackcommentComment = {
715
+ feedback ?: CommentfeedbackFeedback | null ;
716
+ } ;
717
+ export type TestMutationVariables = {
718
+ input : CommentCreateInput ;
719
+ } ;
720
+ export type TestMutationResponse = {
721
+ readonly commentCreate : {
722
+ readonly viewer: {
723
+ readonly actor: {
724
+ readonly " $fragmentRefs" : FragmentRefs < " InlineFragmentWithOverlappingFields" > ;
725
+ } | null ;
726
+ } | null ;
727
+ } | null ;
728
+ } ;
729
+ export type TestMutationRawResponse = {
730
+ readonly commentCreate : ({
731
+ readonly viewer: ({
732
+ readonly actor: ({
733
+ readonly __typename: " User" ;
734
+ readonly __isActor : " User" ;
735
+ readonly id : string ;
736
+ readonly hometown : ({
737
+ readonly id: string ;
738
+ readonly name : string | null ;
739
+ }) | null ;
740
+ } | {
741
+ readonly __typename: " Page" ;
742
+ readonly __isActor : " Page" ;
743
+ readonly id : string ;
744
+ readonly name : string | null ;
745
+ readonly hometown : ({
746
+ readonly id: string ;
747
+ readonly message : ({
748
+ readonly text: string | null ;
749
+ }) | null ;
750
+ }) | null ;
751
+ } | {
752
+ readonly __typename: string ;
753
+ readonly __isActor : string ;
754
+ readonly id : string ;
755
+ }) | null ;
756
+ }) | null ;
757
+ }) | null ;
758
+ } ;
759
+ export type TestMutation = {
760
+ readonly response : TestMutationResponse ;
761
+ readonly variables : TestMutationVariables ;
762
+ readonly rawResponse : TestMutationRawResponse ;
763
+ } ;
764
+
765
+
766
+ // InlineFragmentWithOverlappingFields.graphql
767
+ import { FragmentRefs } from "relay-runtime";
768
+ export type InlineFragmentWithOverlappingFields = {
769
+ readonly hometown ?: {
770
+ readonly id: string ;
771
+ readonly name : string | null ;
772
+ readonly message ?: {
773
+ readonly text: string | null ;
774
+ } | null ;
775
+ } | null ;
776
+ readonly name ?: string | null ;
777
+ readonly " $refType" : " InlineFragmentWithOverlappingFields" ;
778
+ } ;
779
+ export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields;
780
+ export type InlineFragmentWithOverlappingFields$key = {
781
+ readonly " $data" ?: InlineFragmentWithOverlappingFields$data ;
782
+ readonly " $fragmentRefs" : FragmentRefs < " InlineFragmentWithOverlappingFields" > ;
783
+ } ;
784
+
785
+ ` ;
786
+
616
787
exports [` Snapshot tests TypeScriptGenerator with a single artifact directory matches expected output: mutation.graphql 1` ] = `
617
788
~~~~~~~~~~ INPUT ~~~~~~~~~~
618
789
mutation CommentCreateMutation(
@@ -2453,6 +2624,7 @@ fragment UserFrag1 on User {
2453
2624
fragment UserFrag2 on User {
2454
2625
__typename
2455
2626
}
2627
+
2456
2628
~~~~~~~~~~ OUTPUT ~~~~~~~~~~
2457
2629
// FragmentSpread.graphql
2458
2630
import { FragmentRefs } from "relay-runtime";
@@ -2976,6 +3148,176 @@ export type MarkdownUserNameRenderer_name$key = {
2976
3148
2977
3149
`;
2978
3150
3151
+ exports[`Snapshot tests TypeScriptGenerator without a single artifact directory matches expected output: mutaion-with-client-extension.graphql 1`] = `
3152
+ ~~~~~~~~~~ INPUT ~~~~~~~~~~
3153
+ mutation Test($input: UpdateAllSeenStateInput) @raw_response_type {
3154
+ viewerNotificationsUpdateAllSeenState (input : $input ) {
3155
+ stories {
3156
+ foos {
3157
+ bar
3158
+ }
3159
+ }
3160
+ }
3161
+ }
3162
+
3163
+ extend type Story {
3164
+ foos : [Foo ]
3165
+ }
3166
+
3167
+ type Foo {
3168
+ bar : String
3169
+ }
3170
+
3171
+ ~~~~~~~~~~ OUTPUT ~~~~~~~~~~
3172
+ // Test.graphql
3173
+ export type UpdateAllSeenStateInput = {
3174
+ clientMutationId ?: string | null ;
3175
+ storyIds ?: Array < string | null > | null ;
3176
+ } ;
3177
+ export type TestVariables = {
3178
+ input ?: UpdateAllSeenStateInput | null ;
3179
+ } ;
3180
+ export type TestResponse = {
3181
+ readonly viewerNotificationsUpdateAllSeenState : {
3182
+ readonly stories: ReadonlyArray < {
3183
+ readonly foos: ReadonlyArray < {
3184
+ readonly bar: string | null ;
3185
+ } | null > | null ;
3186
+ } | null > | null ;
3187
+ } | null ;
3188
+ } ;
3189
+ export type TestRawResponse = {
3190
+ readonly viewerNotificationsUpdateAllSeenState : ({
3191
+ readonly stories: ReadonlyArray < ({
3192
+ readonly id: string ;
3193
+ readonly foos ?: ReadonlyArray < ({
3194
+ readonly bar: string | null ;
3195
+ }) | null > | null ;
3196
+ }) | null > | null ;
3197
+ }) | null ;
3198
+ } ;
3199
+ export type Test = {
3200
+ readonly response : TestResponse ;
3201
+ readonly variables : TestVariables ;
3202
+ readonly rawResponse : TestRawResponse ;
3203
+ } ;
3204
+
3205
+ `;
3206
+
3207
+ exports[`Snapshot tests TypeScriptGenerator without a single artifact directory matches expected output: mutaion-with-response-on-inline-fragments.graphql 1`] = `
3208
+ ~~~~~~~~~~ INPUT ~~~~~~~~~~
3209
+ mutation TestMutation($input: CommentCreateInput!) @raw_response_type {
3210
+ commentCreate (input : $input ) {
3211
+ viewer {
3212
+ actor {
3213
+ ... InlineFragmentWithOverlappingFields
3214
+ }
3215
+ }
3216
+ }
3217
+ }
3218
+
3219
+ fragment InlineFragmentWithOverlappingFields on Actor {
3220
+ ... on User {
3221
+ hometown {
3222
+ id
3223
+ name
3224
+ }
3225
+ }
3226
+ ... on Page {
3227
+ name
3228
+ hometown {
3229
+ id
3230
+ message {
3231
+ text
3232
+ }
3233
+ }
3234
+ }
3235
+ }
3236
+
3237
+ ~~~~~~~~~~ OUTPUT ~~~~~~~~~~
3238
+ // TestMutation.graphql
3239
+ import { FragmentRefs } from "relay-runtime";
3240
+ export type CommentCreateInput = {
3241
+ clientMutationId ?: string | null ;
3242
+ feedbackId ?: string | null ;
3243
+ feedback ?: CommentfeedbackFeedback | null ;
3244
+ } ;
3245
+ export type CommentfeedbackFeedback = {
3246
+ comment ?: FeedbackcommentComment | null ;
3247
+ } ;
3248
+ export type FeedbackcommentComment = {
3249
+ feedback ?: CommentfeedbackFeedback | null ;
3250
+ } ;
3251
+ export type TestMutationVariables = {
3252
+ input : CommentCreateInput ;
3253
+ } ;
3254
+ export type TestMutationResponse = {
3255
+ readonly commentCreate : {
3256
+ readonly viewer: {
3257
+ readonly actor: {
3258
+ readonly " $fragmentRefs" : FragmentRefs < " InlineFragmentWithOverlappingFields" > ;
3259
+ } | null ;
3260
+ } | null ;
3261
+ } | null ;
3262
+ } ;
3263
+ export type TestMutationRawResponse = {
3264
+ readonly commentCreate : ({
3265
+ readonly viewer: ({
3266
+ readonly actor: ({
3267
+ readonly __typename: " User" ;
3268
+ readonly __isActor : " User" ;
3269
+ readonly id : string ;
3270
+ readonly hometown : ({
3271
+ readonly id: string ;
3272
+ readonly name : string | null ;
3273
+ }) | null ;
3274
+ } | {
3275
+ readonly __typename: " Page" ;
3276
+ readonly __isActor : " Page" ;
3277
+ readonly id : string ;
3278
+ readonly name : string | null ;
3279
+ readonly hometown : ({
3280
+ readonly id: string ;
3281
+ readonly message : ({
3282
+ readonly text: string | null ;
3283
+ }) | null ;
3284
+ }) | null ;
3285
+ } | {
3286
+ readonly __typename: string ;
3287
+ readonly __isActor : string ;
3288
+ readonly id : string ;
3289
+ }) | null ;
3290
+ }) | null ;
3291
+ }) | null ;
3292
+ } ;
3293
+ export type TestMutation = {
3294
+ readonly response : TestMutationResponse ;
3295
+ readonly variables : TestMutationVariables ;
3296
+ readonly rawResponse : TestMutationRawResponse ;
3297
+ } ;
3298
+
3299
+
3300
+ // InlineFragmentWithOverlappingFields.graphql
3301
+ import { FragmentRefs } from "relay-runtime";
3302
+ export type InlineFragmentWithOverlappingFields = {
3303
+ readonly hometown ?: {
3304
+ readonly id: string ;
3305
+ readonly name : string | null ;
3306
+ readonly message ?: {
3307
+ readonly text: string | null ;
3308
+ } | null ;
3309
+ } | null ;
3310
+ readonly name ?: string | null ;
3311
+ readonly " $refType" : " InlineFragmentWithOverlappingFields" ;
3312
+ } ;
3313
+ export type InlineFragmentWithOverlappingFields$data = InlineFragmentWithOverlappingFields;
3314
+ export type InlineFragmentWithOverlappingFields$key = {
3315
+ readonly " $data" ?: InlineFragmentWithOverlappingFields$data ;
3316
+ readonly " $fragmentRefs" : FragmentRefs < " InlineFragmentWithOverlappingFields" > ;
3317
+ } ;
3318
+
3319
+ `;
3320
+
2979
3321
exports[`Snapshot tests TypeScriptGenerator without a single artifact directory matches expected output: mutation.graphql 1`] = `
2980
3322
~~~~~~~~~~ INPUT ~~~~~~~~~~
2981
3323
mutation CommentCreateMutation(
0 commit comments