说我有一个https://lighthouse-php.com/4.11/eloquent/nested-mutations.html#storing-pivot-data的架构,如下所示:
type Movie {
id: ID!
pivot: UserMoviePivot
}
type UserMoviePivot {
"How well did the user like the movie?"
rating: String
}
以及随后的查询:
{
id
seenMovies {
id
pivot {
rating
}
}
}
产生如下所示的内容:
"seenMovies": [
{
"id": 6,
"pivot": {
"rating": "A perfect 5/7"
}
}
]
有什么方法可以将数据透视表带入父级以产生类似的结果?
"seenMovies": [
{
"id": 6,
"rating": "A perfect 5/7"
}
]