@@ -36,21 +36,35 @@ def should_detect_if_a_type_was_removed_or_not():
36
36
def should_detect_if_a_type_changed_its_type ():
37
37
old_schema = build_schema (
38
38
"""
39
- interface Type1
39
+ scalar TypeWasScalarBecomesEnum
40
+ interface TypeWasInterfaceBecomesUnion
41
+ type TypeWasObjectBecomesInputObject
40
42
"""
41
43
)
42
44
43
45
new_schema = build_schema (
44
46
"""
45
- union Type1
47
+ enum TypeWasScalarBecomesEnum
48
+ union TypeWasInterfaceBecomesUnion
49
+ input TypeWasObjectBecomesInputObject
46
50
"""
47
51
)
48
52
49
53
assert find_breaking_changes (old_schema , new_schema ) == [
50
54
(
51
55
BreakingChangeType .TYPE_CHANGED_KIND ,
52
- "Type1 changed from an Interface type to a Union type." ,
53
- )
56
+ "TypeWasScalarBecomesEnum changed from a Scalar type to an Enum type." ,
57
+ ),
58
+ (
59
+ BreakingChangeType .TYPE_CHANGED_KIND ,
60
+ "TypeWasInterfaceBecomesUnion changed"
61
+ " from an Interface type to a Union type." ,
62
+ ),
63
+ (
64
+ BreakingChangeType .TYPE_CHANGED_KIND ,
65
+ "TypeWasObjectBecomesInputObject changed"
66
+ " from an Object type to an Input type." ,
67
+ ),
54
68
]
55
69
56
70
def should_detect_if_a_field_on_type_was_deleted_or_changed_type ():
@@ -564,6 +578,27 @@ def should_detect_interfaces_removed_from_types():
564
578
)
565
579
]
566
580
581
+ def should_ignore_changes_in_order_of_interfaces ():
582
+ old_schema = build_schema (
583
+ """
584
+ interface FirstInterface
585
+ interface SecondInterface
586
+
587
+ type Type1 implements FirstInterface & SecondInterface
588
+ """
589
+ )
590
+
591
+ new_schema = build_schema (
592
+ """
593
+ interface FirstInterface
594
+ interface SecondInterface
595
+
596
+ type Type1 implements SecondInterface & FirstInterface
597
+ """
598
+ )
599
+
600
+ assert find_breaking_changes (old_schema , new_schema ) == []
601
+
567
602
def should_detect_all_breaking_changes ():
568
603
old_schema = build_schema (
569
604
"""
@@ -839,22 +874,26 @@ def should_detect_if_a_value_was_added_to_an_enum_type():
839
874
def should_detect_interfaces_added_to_types ():
840
875
old_schema = build_schema (
841
876
"""
842
- type Type1
877
+ interface OldInterface
878
+ interface NewInterface
879
+
880
+ type Type1 implements OldInterface
843
881
"""
844
882
)
845
883
846
884
new_schema = build_schema (
847
885
"""
848
- interface Interface1
886
+ interface OldInterface
887
+ interface NewInterface
849
888
850
- type Type1 implements Interface1
889
+ type Type1 implements OldInterface & NewInterface
851
890
"""
852
891
)
853
892
854
893
assert find_dangerous_changes (old_schema , new_schema ) == [
855
894
(
856
895
DangerousChangeType .INTERFACE_ADDED_TO_OBJECT ,
857
- "Interface1 added to interfaces implemented by Type1." ,
896
+ "NewInterface added to interfaces implemented by Type1." ,
858
897
)
859
898
]
860
899
0 commit comments