Hi, I have this error. Class ProductType does exist but is not a Type. Does it have Annotations and it's added to annotated function array. What did I miss?
<?php declare(strict_types=1);
use Siler\GraphQL\Annotation\Field;
use Siler\GraphQL\Annotation\ObjectType;
/**
* @ObjectType()
*/
class ProductType
{
/**
* @Field(type="Int", nullable=true)
*/
public $ID;
}
In my CollectionType I have this resolver
use Siler\GraphQL\Annotation\Field;
use Siler\GraphQL\Annotation\Args;
use Siler\GraphQL\Annotation\ObjectType;
/**
* @ObjectType()
*/
class CollectionType
{
/**
* @Field(listOf=ProductType::class) // **this line throws an error**
* @Args({
* @Field(name="ID", type="Int", nullable=true),
* @Field(name="OnSaleOnly", type="Boolean", nullable=true)
* })
* @return array
*/
public function Products($root, $args) : array
{
return [ProductType] // returns an array of ProductType
}
}
Hi, I have this error.
Class ProductType does exist but is not a Type. Does it have Annotations and it's added to annotated function array
. What did I miss?In my CollectionType I have this resolver
then in my controller action