【发布时间】:2017-04-25 00:24:53
【问题描述】:
如何在作者没有必填字段的情况下创建帖子和作者?
类似:
mutation {
createPost(
text: "This is a post!"
author: {
// ???
}
) {
id
author {
id
}
}
}
【问题讨论】:
标签: graphql
如何在作者没有必填字段的情况下创建帖子和作者?
类似:
mutation {
createPost(
text: "This is a post!"
author: {
// ???
}
) {
id
author {
id
}
}
}
【问题讨论】:
标签: graphql
你可以转nested mutation:
mutation {
createUser(posts: [{
text: "This is a post!"
}]) {
id
}
}
我假设它是一个一对多关系,并且字段被称为posts。
【讨论】: