diff --git a/DependencyInjection/GraphqliteCompilerPass.php b/DependencyInjection/GraphqliteCompilerPass.php index f4490ee..e7298aa 100644 --- a/DependencyInjection/GraphqliteCompilerPass.php +++ b/DependencyInjection/GraphqliteCompilerPass.php @@ -90,7 +90,11 @@ public function process(ContainerBuilder $container) //$definition->addTag('graphql.annotated.type'); // Set the types public $reflectionClass = new ReflectionClass($class); - if ($this->getAnnotationReader()->getTypeAnnotation($reflectionClass) !== null || $this->getAnnotationReader()->getExtendTypeAnnotation($reflectionClass) !== null) { + $typeAnnotation = $this->getAnnotationReader()->getTypeAnnotation($reflectionClass); + if ($typeAnnotation !== null && $typeAnnotation->isSelfType()) { + continue; + } + if ($typeAnnotation !== null || $this->getAnnotationReader()->getExtendTypeAnnotation($reflectionClass) !== null) { $definition->setPublic(true); } else { foreach ($reflectionClass->getMethods() as $method) {