public function testConflictingReturnTypesWhichPotentiallyOverlap()
{
// This is invalid since an object could potentially be both the Object
// type IntBox and the interface type NonNullStringBox1. While that
// condition does not exist in the current schema, the schema could
// expand in the future to allow this. Thus it is invalid.
$this->expectFailsRuleWithSchema($this->getTestSchema(), new OverlappingFieldsCanBeMerged(), '
{
someBox {
...on IntBox {
scalar
}
...on NonNullStringBox1 {
scalar
}
}
}
', [FormattedError::create(OverlappingFieldsCanBeMerged::fieldsConflictMessage('scalar', 'they return conflicting types Int and String!'), [new SourceLocation(5, 15), new SourceLocation(8, 15)])]);
}