update<collection>
更新文档我们为上述模式定义的集合命名为“post”和“author”,因此我们可以使用 updatePost
和 updateAuthor
对每种集合类型应用更新。
mutation {updateAuthor(relativePath: "napolean.json", params: {name: "Napolean", avatar: "https://path.to/my-avatar.jpg"}) {nameavatar}}
{"data": {"updateAuthor": {"name": "Napolean","avatar": "https://path.to/my-avatar.jpg"}}}
mutation {updatePost(relativePath: "voteForPedro.json", params: {title: "Vote For Napolean Instead", category: "politics", author: "content/authors/napolean.json"}) {titlecategoryauthor {... on Author {id}}}}
{"data": {"updatePost": {"title": "Vote For Napolean Instead","category": "politics","author": {"id": "content/authors/napolean.json"}}}}