diff --git a/src/Utils/SchemaPrinter.php b/src/Utils/SchemaPrinter.php index 1c56648..3eed8fa 100644 --- a/src/Utils/SchemaPrinter.php +++ b/src/Utils/SchemaPrinter.php @@ -159,7 +159,7 @@ class SchemaPrinter { $interfaces = $type->getInterfaces(); $implementedInterfaces = !empty($interfaces) ? - ' implements ' . implode(', ', array_map(function($i) { + ' implements ' . implode(' & ', array_map(function($i) { return $i->name; }, $interfaces)) : ''; return self::printDescription($options, $type) . diff --git a/tests/Utils/SchemaPrinterTest.php b/tests/Utils/SchemaPrinterTest.php index db09452..a6f543a 100644 --- a/tests/Utils/SchemaPrinterTest.php +++ b/tests/Utils/SchemaPrinterTest.php @@ -21,7 +21,9 @@ class SchemaPrinterTest extends TestCase private function printForTest($schema) { - return "\n" . SchemaPrinter::doPrint($schema); + $schemaText = SchemaPrinter::doPrint($schema); + $this->assertEquals($schemaText, SchemaPrinter::doPrint(BuildSchema::build($schemaText))); + return "\n" . $schemaText; } private function printSingleFieldSchema($fieldConfig) @@ -464,7 +466,7 @@ interface Baaz { int: Int } -type Bar implements Foo, Baaz { +type Bar implements Foo & Baaz { str: String int: Int }