Added support for GraphQL mutations!
Through mutations, you are now able to modify data through your GraphQL queries:
mutation {
updatePost(id: 5, title: "New title") {
title
}
}The following mutation fields have been added to the schema:
createPostupdatePostsetFeaturedImageforCustomPostremoveFeaturedImageforCustomPostaddCommentToCustomPostreplyCommentloginUserlogoutUser
Nested mutations is the ability to perform mutations on a type other than the root type in GraphQL.
For instance, the mutation query from above can also be executed through this nested mutation, on type Post:
mutation {
post(id: 5) {
update(title: "New title") {
title
}
}
}Mutations can also modify data on the result from another mutation:
mutation {
createPost(title: "First title") {
id
update(title: "Second title", contentAs: { html: "Some content" } ) {
title
content
addComment(commentAs: { html: "My first comment" }) {
id
content
date
}
}
}
}Nested mutations have been requested for the GraphQL spec but not yet approved, hence Gato GraphQL adds support for them as an opt-in feature, via module "Nested Mutations" (which must be enabled).
Nested mutations change the root type, from QueryRoot and MutationRoot, to a single Root type handling both queries and mutations:
In addition, a "Mutation Scheme" section has been added to a Schema Configuration, allowing to enable/disable nested mutations for a specific Custom Endpoint or Persisted Query.
The following nested mutation fields have been added to the schema:
CustomPost.updateCustomPost.setFeaturedImageCustomPost.removeFeaturedImageCustomPost.addCommentComment.reply
Starting from this version, the plugin runs without any issue in PHP 8.1.


