Autogenerated Mutations
Certain mutations are automatically generated when you publish your graph.
-
CREATE
GraphQL:
createItem({ input: ItemInput })
REST:POST
/items
Allows you to create an entry for the table corresponding to the graph. It takes the fields defined in the graph as input paramters. Returns the created document on success.
-
UPDATE
GraphQL:
updateItem({ _id: ID, input: ItemInput })
REST:PATCH
/items/:_id
(_id is the id of the entry to be updated)Allows you to update an existing entry in the table. Only the keys that need to be updated need to be provided. Returns the updated document on success.
-
DELETE
GraphQL:
deleteItem({ _id: ID })
REST:DELETE
/items/:_id
(_id is the id of the entry to be deleted)Allows you to delete an existing entry in the table. The _id provided in the url parameter would be used to delete the record. Returns the deleted document on success.
This is a permanent action. Be careful while executing this mutation.