Skip to content

One-To-Many non-doctrine entities  #2740

@CvekCoding

Description

@CvekCoding

Hello!
I think my question is common enough and was asked before, but I didnt find something similar.
So, if I have 2 not-doctrine entities:

/**
* ApiResource
*/
class Parent
{
/**
    /**
     * @ApiProperty(identifier=true)
     *
     * @var int
     */
    public $id;

    /**
     * @ApiSubresource()
     *
     * @var Child[]|null
     */
    public $childs = [];
}

/**
 * @ApiResource
 */
class Child
{  
    /**
     * @ApiProperty(identifier=true)
     *
     * @var int
     */
    public $id;
}

Then in GraphQl schema I see that both of these classes were recognized by SchemaBuilder, but Parent has no proper one-to-many link to Child - childs property has type Iterable instead of Child[].

What am I missing here?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions