update<collection>
Our collections for the above schema are named "post" and "author", so we can apply an update to each collection type using the 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"}}}}
© TinaCMS 2019–2024