@@ -666,15 +666,15 @@ describe('extendSchema', () => {
666
666
667
667
expect ( validateSchema ( extendedSchema ) ) . to . deep . equal ( [ ] ) ;
668
668
expect ( printSchemaChanges ( schema , extendedSchema ) ) . to . equal ( dedent `
669
+ type SomeObject {
670
+ newField(arg1: String, arg2: NewInputObj!): String
671
+ }
672
+
669
673
input NewInputObj {
670
674
field1: Int
671
675
field2: [Float]
672
676
field3: String!
673
677
}
674
-
675
- type SomeObject {
676
- newField(arg1: String, arg2: NewInputObj!): String
677
- }
678
678
` ) ;
679
679
} ) ;
680
680
@@ -754,8 +754,7 @@ describe('extendSchema', () => {
754
754
755
755
scalar NewScalar
756
756
757
- union NewUnion = NewObject
758
- ` ;
757
+ union NewUnion = NewObject` ;
759
758
const extendAST = parse ( `
760
759
${ newTypesSDL }
761
760
extend type SomeObject {
@@ -771,7 +770,6 @@ describe('extendSchema', () => {
771
770
772
771
expect ( validateSchema ( extendedSchema ) ) . to . deep . equal ( [ ] ) ;
773
772
expect ( printSchemaChanges ( schema , extendedSchema ) ) . to . equal ( dedent `
774
- ${ newTypesSDL }
775
773
type SomeObject {
776
774
oldField: String
777
775
newObject: NewObject
@@ -781,6 +779,8 @@ describe('extendSchema', () => {
781
779
newEnum: NewEnum
782
780
newTree: [SomeObject]!
783
781
}
782
+
783
+ ${ newTypesSDL }
784
784
` ) ;
785
785
} ) ;
786
786
@@ -811,12 +811,12 @@ describe('extendSchema', () => {
811
811
812
812
expect ( validateSchema ( extendedSchema ) ) . to . deep . equal ( [ ] ) ;
813
813
expect ( printSchemaChanges ( schema , extendedSchema ) ) . to . equal ( dedent `
814
- interface NewInterface {
814
+ type SomeObject implements OldInterface & NewInterface {
815
+ oldField: String
815
816
newField: String
816
817
}
817
818
818
- type SomeObject implements OldInterface & NewInterface {
819
- oldField: String
819
+ interface NewInterface {
820
820
newField: String
821
821
}
822
822
` ) ;
@@ -864,8 +864,7 @@ describe('extendSchema', () => {
864
864
865
865
type NewObject {
866
866
foo: String
867
- }
868
- ` ;
867
+ }` ;
869
868
const extendAST = parse ( `
870
869
${ newTypesSDL }
871
870
extend type SomeObject implements NewInterface {
@@ -900,26 +899,27 @@ describe('extendSchema', () => {
900
899
901
900
expect ( validateSchema ( extendedSchema ) ) . to . deep . equal ( [ ] ) ;
902
901
expect ( printSchemaChanges ( schema , extendedSchema ) ) . to . equal ( dedent `
903
- ${ newTypesSDL }
902
+ type SomeObject implements SomeInterface & NewInterface & AnotherNewInterface {
903
+ oldField: String
904
+ newField: String
905
+ anotherNewField: String
906
+ }
907
+
904
908
enum SomeEnum {
905
909
OLD_VALUE
906
910
NEW_VALUE
907
911
ANOTHER_NEW_VALUE
908
912
}
909
913
910
- input SomeInput {
911
- oldField: String
912
- newField: String
913
- anotherNewField: String
914
- }
914
+ union SomeUnion = SomeObject | NewObject | AnotherNewObject
915
915
916
- type SomeObject implements SomeInterface & NewInterface & AnotherNewInterface {
916
+ input SomeInput {
917
917
oldField: String
918
918
newField: String
919
919
anotherNewField: String
920
920
}
921
921
922
- union SomeUnion = SomeObject | NewObject | AnotherNewObject
922
+ ${ newTypesSDL }
923
923
` ) ;
924
924
} ) ;
925
925
@@ -958,12 +958,12 @@ describe('extendSchema', () => {
958
958
959
959
expect ( validateSchema ( extendedSchema ) ) . to . deep . equal ( [ ] ) ;
960
960
expect ( printSchemaChanges ( schema , extendedSchema ) ) . to . equal ( dedent `
961
- interface AnotherInterface implements SomeInterface {
961
+ interface SomeInterface {
962
962
oldField: String
963
963
newField: String
964
964
}
965
965
966
- interface SomeInterface {
966
+ interface AnotherInterface implements SomeInterface {
967
967
oldField: String
968
968
newField: String
969
969
}
@@ -1015,12 +1015,12 @@ describe('extendSchema', () => {
1015
1015
newField: String
1016
1016
}
1017
1017
1018
- interface NewInterface {
1018
+ type SomeObject implements SomeInterface & AnotherInterface & NewInterface {
1019
+ oldField: String
1019
1020
newField: String
1020
1021
}
1021
1022
1022
- type SomeObject implements SomeInterface & AnotherInterface & NewInterface {
1023
- oldField: String
1023
+ interface NewInterface {
1024
1024
newField: String
1025
1025
}
1026
1026
` ) ;
@@ -1120,16 +1120,16 @@ describe('extendSchema', () => {
1120
1120
expect ( extendedSchema ) . to . not . equal ( mutationSchema ) ;
1121
1121
expect ( printSchema ( mutationSchema ) ) . to . equal ( originalPrint ) ;
1122
1122
expect ( printSchema ( extendedSchema ) ) . to . equal ( dedent `
1123
- type Mutation {
1124
- mutationField: String
1125
- newMutationField: Int
1126
- }
1127
-
1128
1123
type Query {
1129
1124
queryField: String
1130
1125
newQueryField: Int
1131
1126
}
1132
1127
1128
+ type Mutation {
1129
+ mutationField: String
1130
+ newMutationField: Int
1131
+ }
1132
+
1133
1133
type Subscription {
1134
1134
subscriptionField: String
1135
1135
newSubscriptionField: Int
0 commit comments