How to pass an object array to graphql

How to pass an object array to graphql

I am working on graphql, how to pass an array of object to the graphql type schema.
for example:
expect output:
[
{
“color”: “red”,
“owners”: [
{
“ownerName”:”Rob”,
“ownerOcupation”: “teacher”
}
}

]
my schema:

type Query {
allCars:[Car]}

type Car {
color:String
owners: [owner]
}

type owner {
ownerName: String
ownerOcupation: String
}

car entity:
@Column
private String color;
@OneToMany
private List owners;

owner entity:
@Column
private String ownerName;
@Column
private String ownerOcupation;

it doesn’t display the owners section as expected. How should I pass the owner into the owners in the car?

Solutions/Answers:

References

Related:  how to fix graphql mutations typename errors