Skip to content

Commit 4cad4e5

Browse files
author
Jeremiah VALERIE
committed
Revert shorthand type compilation
fixed #973
1 parent 05e4e6e commit 4cad4e5

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/Generator/TypeBuilder.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,10 +689,12 @@ public function buildField(array $fieldConfig, string $fieldname)
689689
// Convert to object for better readability
690690
$c = (object) $fieldConfig;
691691

692+
// TODO(any): modify `InputValidator` and `TypeDecoratorListener` to support it before re-enabling this
693+
// see https://github.com/overblog/GraphQLBundle/issues/973
692694
// If there is only 'type', use shorthand
693-
if (1 === count($fieldConfig) && isset($c->type)) {
695+
/*if (1 === count($fieldConfig) && isset($c->type)) {
694696
return $this->buildType($c->type);
695-
}
697+
}*/
696698

697699
$field = Collection::assoc()
698700
->addItem('type', $this->buildType($c->type));

tests/Functional/TypeShorthand/TypeShorthandTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,20 @@
44

55
namespace Overblog\GraphQLBundle\Tests\Functional\AutoConfigure;
66

7+
use Doctrine\Common\Annotations\Reader;
78
use Overblog\GraphQLBundle\Tests\Functional\TestCase;
9+
use Symfony\Component\Validator\Validation;
810

911
class TypeShorthandTest extends TestCase
1012
{
1113
protected function setUp(): void
1214
{
15+
if (!class_exists(Validation::class)) {
16+
$this->markTestSkipped('Symfony validator component is not installed');
17+
}
18+
if (!interface_exists(Reader::class)) {
19+
$this->markTestSkipped('Symfony validator component requires doctrine/annotations but it is not installed');
20+
}
1321
static::bootKernel(['test_case' => 'typeShorthand']);
1422
}
1523

0 commit comments

Comments
 (0)