File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -197,6 +197,34 @@ describe('topologicalSortAST', () => {
197197 expect ( sortedSchema ) . toBe ( expectedSortedSchema ) ;
198198 } ) ;
199199
200+ it ( 'should place interface definitions before types that depend on them' , ( ) => {
201+ const schema = /* GraphQL */ `
202+ type A {
203+ id: ID!
204+ node: Node
205+ }
206+
207+ interface Node {
208+ id: ID!
209+ }
210+ ` ;
211+
212+ const sortedSchema = getSortedSchema ( schema ) ;
213+
214+ const expectedSortedSchema = dedent /* GraphQL */ `
215+ interface Node {
216+ id: ID!
217+ }
218+
219+ type A {
220+ id: ID!
221+ node: Node
222+ }
223+ ` ;
224+
225+ expect ( sortedSchema ) . toBe ( expectedSortedSchema ) ;
226+ } ) ;
227+
200228 it ( 'should correctly handle schema with circular dependencies' , ( ) => {
201229 const schema = /* GraphQL */ `
202230 input A {
You can’t perform that action at this time.
0 commit comments