0
如何创建帖子和作者,而作者没有必填字段?如何在GraphQL中为空子项创建嵌套变异
喜欢的东西:
mutation {
createPost(
text: "This is a post!"
author: {
// ???
}
) {
id
author {
id
}
}
}
如何创建帖子和作者,而作者没有必填字段?如何在GraphQL中为空子项创建嵌套变异
喜欢的东西:
mutation {
createPost(
text: "This is a post!"
author: {
// ???
}
) {
id
author {
id
}
}
}
您可以打开nested mutation各地:
mutation {
createUser(posts: [{
text: "This is a post!"
}]) {
id
}
}
我以为这是一个一个一对多关系和领域被称为posts
。