From 56e91d008ee3e72d6409b3585508cdcdde78b2c0 Mon Sep 17 00:00:00 2001 From: Vladimir Razuvaev Date: Wed, 8 Aug 2018 15:07:08 +0700 Subject: [PATCH] Update printSchema for recent SDL change to `implements` --- src/Utils/SchemaPrinter.php | 2 +- tests/Utils/SchemaPrinterTest.php | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) 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 }