File tree 1 file changed +74
-0
lines changed
1 file changed +74
-0
lines changed Original file line number Diff line number Diff line change @@ -501,3 +501,77 @@ query User {
501
501
query-fn (get-in query-map [:query :user ])]
502
502
(is (= (str/trim inline-nested-fragment-result)
503
503
(get-in (query-fn ) [:graphql :query ])))))
504
+
505
+
506
+ (def fragment-nesting-on-same-type "
507
+
508
+ mutation validateOrderPersonalInformation($input: ValidateOrderPersonalInformationInput!) {
509
+ validateOrderPersonalInformation(input: $input) {
510
+ ...validateOrderPersonalInformationPayloadFields
511
+ }
512
+ }
513
+
514
+ fragment validateOrderPersonalInformationPayloadFields on ValidateOrderPersonalInformationPayload {
515
+ clientMutationId
516
+ errors {
517
+ ...errorFields
518
+ }
519
+ valid
520
+ }
521
+
522
+ fragment errorFields on Error {
523
+ ...innerErrorFields
524
+ suberrors {
525
+ ...innerErrorFields
526
+ suberrors {
527
+ ...innerErrorFields
528
+ suberrors {
529
+ ...innerErrorFields
530
+ }
531
+ }
532
+ }
533
+ }
534
+
535
+ fragment innerErrorFields on Error {
536
+ index
537
+ key
538
+ messages
539
+ }
540
+ " )
541
+
542
+ (def fragment-nesting-on-same-type-result
543
+ "
544
+ mutation validateOrderPersonalInformation($input: ValidateOrderPersonalInformationInput!) {
545
+ validateOrderPersonalInformation(input: $input) {
546
+ clientMutationId
547
+ errors {
548
+ index
549
+ key
550
+ messages
551
+ suberrors {
552
+ index
553
+ key
554
+ messages
555
+ suberrors {
556
+ index
557
+ key
558
+ messages
559
+ suberrors {
560
+ index
561
+ key
562
+ messages
563
+ }
564
+ }
565
+ }
566
+ }
567
+ valid
568
+ }
569
+ }
570
+ " )
571
+
572
+
573
+ (deftest fragment-nesting-on-same-type-test
574
+ (let [query-map (core/query-map (parse fragment-nesting-on-same-type) {:inline-fragments true })
575
+ query-fn (get-in query-map [:mutation :validate-order-personal-information ])]
576
+ (is (= (str/trim fragment-nesting-on-same-type-result)
577
+ (get-in (query-fn ) [:graphql :query ])))))
You can’t perform that action at this time.
0 commit comments