@@ -1555,21 +1555,21 @@ describe('Introspection', () => {
15551555
15561556 const source = `
15571557 {
1558- a : __type(name: "SomeInputObject") {
1558+ oneOfInputObject : __type(name: "SomeInputObject") {
15591559 isOneOf
15601560 }
1561- b : __type(name: "AnotherInputObject") {
1561+ inputObject : __type(name: "AnotherInputObject") {
15621562 isOneOf
15631563 }
15641564 }
15651565 ` ;
15661566
15671567 expect ( graphqlSync ( { schema, source } ) ) . to . deep . equal ( {
15681568 data : {
1569- a : {
1569+ oneOfInputObject : {
15701570 isOneOf : true ,
15711571 } ,
1572- b : {
1572+ inputObject : {
15731573 isOneOf : false ,
15741574 } ,
15751575 } ,
@@ -1578,59 +1578,49 @@ describe('Introspection', () => {
15781578
15791579 it ( 'returns null for oneOf for other types' , ( ) => {
15801580 const schema = buildSchema ( `
1581- type A implements I {
1582- a : String
1581+ type SomeObject implements SomeInterface {
1582+ fieldA : String
15831583 }
1584- enum E {
1585- A
1584+ enum SomeEnum {
1585+ SomeObject
15861586 }
1587- interface I {
1588- a : String
1587+ interface SomeInterface {
1588+ fieldA : String
15891589 }
1590- union U = A
1590+ union SomeUnion = SomeObject
15911591 type Query {
1592- someField(e: E ): U
1593- anotherField(e: E ): I
1592+ someField(enum: SomeEnum ): SomeUnion
1593+ anotherField(enum: SomeEnum ): SomeInterface
15941594 }
15951595 ` ) ;
15961596
15971597 const source = `
15981598 {
1599- a : __type(name: "A ") {
1599+ object : __type(name: "SomeObject ") {
16001600 isOneOf
16011601 }
1602- e : __type(name: "E ") {
1602+ enum : __type(name: "SomeEnum ") {
16031603 isOneOf
16041604 }
1605- i : __type(name: "I ") {
1605+ interface : __type(name: "SomeInterface ") {
16061606 isOneOf
16071607 }
1608- o : __type(name: "String") {
1608+ scalar : __type(name: "String") {
16091609 isOneOf
16101610 }
1611- u : __type(name: "U ") {
1611+ union : __type(name: "SomeUnion ") {
16121612 isOneOf
16131613 }
16141614 }
16151615 ` ;
16161616
16171617 expect ( graphqlSync ( { schema, source } ) ) . to . deep . equal ( {
16181618 data : {
1619- a : {
1620- isOneOf : null ,
1621- } ,
1622- e : {
1623- isOneOf : null ,
1624- } ,
1625- i : {
1626- isOneOf : null ,
1627- } ,
1628- o : {
1629- isOneOf : null ,
1630- } ,
1631- u : {
1632- isOneOf : null ,
1633- } ,
1619+ object : { isOneOf : null } ,
1620+ enum : { isOneOf : null } ,
1621+ interface : { isOneOf : null } ,
1622+ scalar : { isOneOf : null } ,
1623+ union : { isOneOf : null } ,
16341624 } ,
16351625 } ) ;
16361626 } ) ;
0 commit comments