@@ -426,7 +426,7 @@ describe('optional arguments', () => {
426426 } ) ;
427427
428428 const stitchedSchema = stitchSchemas ( {
429- schemas : [ schema ] ,
429+ subschemas : [ schema ] ,
430430 } ) ;
431431
432432 it ( 'work with schema stitching' , async ( ) => {
@@ -1494,12 +1494,12 @@ describe('interface resolver inheritance', () => {
14941494
14951495 test ( 'copies resolvers from interface' , async ( ) => {
14961496 const stitchedSchema = stitchSchemas ( {
1497- schemas : [
1498- // pull in an executable schema just so mergeSchema doesn't complain
1497+ subschemas : [
1498+ // pull in an executable schema just so stitchSchemas doesn't complain
14991499 // about not finding default types (e.g. ID)
15001500 propertySchema ,
1501- testSchemaWithInterfaceResolvers ,
15021501 ] ,
1502+ typeDefs : testSchemaWithInterfaceResolvers ,
15031503 resolvers,
15041504 inheritResolversFromInterfaces : true ,
15051505 } ) ;
@@ -1517,12 +1517,12 @@ describe('interface resolver inheritance', () => {
15171517
15181518 test ( 'does not copy resolvers from interface when flag is false' , async ( ) => {
15191519 const stitchedSchema = stitchSchemas ( {
1520- schemas : [
1520+ subschemas : [
15211521 // pull in an executable schema just so mergeSchema doesn't complain
15221522 // about not finding default types (e.g. ID)
15231523 propertySchema ,
1524- testSchemaWithInterfaceResolvers ,
15251524 ] ,
1525+ typeDefs : testSchemaWithInterfaceResolvers ,
15261526 resolvers,
15271527 inheritResolversFromInterfaces : false ,
15281528 } ) ;
@@ -1537,12 +1537,12 @@ describe('interface resolver inheritance', () => {
15371537
15381538 test ( 'does not copy resolvers from interface when flag is not provided' , async ( ) => {
15391539 const stitchedSchema = stitchSchemas ( {
1540- schemas : [
1541- // pull in an executable schema just so mergeSchema doesn't complain
1540+ subschemas : [
1541+ // pull in an executable schema just so stitchSchemas doesn't complain
15421542 // about not finding default types (e.g. ID)
15431543 propertySchema ,
1544- testSchemaWithInterfaceResolvers ,
15451544 ] ,
1545+ typeDefs : testSchemaWithInterfaceResolvers ,
15461546 resolvers,
15471547 } ) ;
15481548 const query = '{ user { id name } }' ;
@@ -1573,7 +1573,7 @@ describe('stitchSchemas', () => {
15731573 } ,
15741574 } ) ;
15751575 const stitchedSchema = stitchSchemas ( {
1576- schemas : [ schema ] ,
1576+ subschemas : [ schema ] ,
15771577 } ) ;
15781578
15791579 const query = '{ test { field } }' ;
@@ -1599,7 +1599,7 @@ describe('stitchSchemas', () => {
15991599 } ,
16001600 } ) ;
16011601 const stitchedSchema = stitchSchemas ( {
1602- schemas : [ schema ] ,
1602+ subschemas : [ schema ] ,
16031603 } ) ;
16041604
16051605 const query = '{ getInput(input: {}) }' ;
@@ -1645,7 +1645,7 @@ type Query {
16451645 } ,
16461646 } ) ;
16471647 const stitchedSchema = stitchSchemas ( {
1648- schemas : [ schema ] ,
1648+ subschemas : [ schema ] ,
16491649 resolvers : {
16501650 TestScalar : new GraphQLScalarType ( {
16511651 name : 'TestScalar' ,
@@ -1685,7 +1685,7 @@ type Query {
16851685 } ,
16861686 } ) ;
16871687 const stitchedSchema = stitchSchemas ( {
1688- schemas : [ schema ] ,
1688+ subschemas : [ schema ] ,
16891689 resolvers : {
16901690 TestScalar : new GraphQLScalarType ( {
16911691 name : 'TestScalar' ,
@@ -1720,14 +1720,12 @@ type Query {
17201720 } ,
17211721 } ) ;
17221722 const stitchedSchema = stitchSchemas ( {
1723- schemas : [
1724- schema ,
1725- `
1726- type Query {
1727- get2: WrappingType
1728- }
1729- ` ,
1730- ] ,
1723+ subschemas : [ schema ] ,
1724+ typeDefs : `
1725+ type Query {
1726+ get2: WrappingType
1727+ }
1728+ ` ,
17311729 resolvers : {
17321730 Query : {
17331731 get2 : ( _root , _args , context , info ) =>
@@ -1766,7 +1764,7 @@ type Query {
17661764 } ) ;
17671765
17681766 const stitchedSchema = stitchSchemas ( {
1769- schemas : [ schema ] ,
1767+ subschemas : [ schema ] ,
17701768 resolvers : {
17711769 Query : {
17721770 wrappingObject : ( ) => ( {
@@ -1838,7 +1836,7 @@ describe('onTypeConflict', () => {
18381836
18391837 test ( 'by default takes last type' , async ( ) => {
18401838 const stitchedSchema = stitchSchemas ( {
1841- schemas : [ schema1 , schema2 ] ,
1839+ subschemas : [ schema1 , schema2 ] ,
18421840 } ) ;
18431841 const result1 = await graphql ( stitchedSchema , '{ test2 { fieldC } }' ) ;
18441842 expect ( result1 . data ?. test2 . fieldC ) . toBe ( 'C' ) ;
@@ -1848,7 +1846,7 @@ describe('onTypeConflict', () => {
18481846
18491847 test ( 'can use onTypeConflict to select last type' , async ( ) => {
18501848 const stitchedSchema = stitchSchemas ( {
1851- schemas : [ schema1 , schema2 ] ,
1849+ subschemas : [ schema1 , schema2 ] ,
18521850 onTypeConflict : ( _left , right ) => right ,
18531851 } ) ;
18541852 const result1 = await graphql ( stitchedSchema , '{ test2 { fieldC } }' ) ;
@@ -1859,7 +1857,7 @@ describe('onTypeConflict', () => {
18591857
18601858 test ( 'can use onTypeConflict to select first type' , async ( ) => {
18611859 const stitchedSchema = stitchSchemas ( {
1862- schemas : [ schema1 , schema2 ] ,
1860+ subschemas : [ schema1 , schema2 ] ,
18631861 onTypeConflict : ( left ) => left ,
18641862 } ) ;
18651863 const result1 = await graphql ( stitchedSchema , '{ test1 { fieldB } }' ) ;
0 commit comments