我正在研究graphql,如何将对象数组传递给graphql类型架构。 例如: 预期输出:
[
{
"color": "red",
"owners": [
{
"ownerName":"Rob",
"ownerOcupation": "teacher"
}
}
]
我的模式:
...
type Query {
allCars:[Car]}
type Car {
color:String
owners: [owner]
}
type owner {
ownerName: String
ownerOcupation: String
}
汽车实体:
@Column
private String color;
@OneToMany
private List <owner> owners;
owner entity:
@Column
private String ownerName;
@Column
private String ownerOcupation;
它没有按预期显示所有者部分。我应该如何将车主带入车内?