Mutations
The root Mutation
type in a GraphQL schema defines all the write operations that can change data. It is analogous to performing HTTP verbs such as POST
, PATCH
, and DELETE
.
Mutations can take arguments as input similar to the body of a POST
request in REST. Like GraphQL queries, mutations can also return fields. This can be useful for fetching the new state of an object after an update.
Field | Argument | Type | Description |
---|---|---|---|
updatePrice | Price! | Updates a price. | |
id | ID! | ||
input | InputUpdatePrice! | ||
archivePrice | Price! | Archives a price. | |
id | ID! | Specifies the price to archive. | |
createProduct | Product! | When performing the mutation | |
input | InputCreateProduct! | Specifies the fields to use when creating the product. | |
updateProduct | Product! | Same as | |
id | ID! | ||
input | InputUpdateProduct! | Specifies the fields to use when updating the product. | |
archiveProduct | Product! | When performing the mutation | |
id | ID! | ||
unarchiveProduct | Product! | When performing the mutation | |
id | ID! | ||
createStockActivity | StockActivity! | When performing the mutation noteTo understand the use of the | |
input | InputCreateStockActivity! | Specifies the fields to use when creating the stock activity. | |
createVariant | Variant! | It is necessary to understand that the changes in the creation and updating of the These mutations manage the insertion and updating of the information related to the product variants and the prices applied to it. | |
input | InputCreateVariant! | ||
variantPricesInput | [InputCreateVariantPrices!]! | ||
updateVariant | Variant! | As | |
id | ID! | ||
input | InputUpdateVariant! | Specifies the fields to use when updating the variant. | |
variantPricesInput | [InputUpdateVariantPrices!] | ||
activateVariant | Variant! | ||
id | ID! | ||
deactivateVariant | Variant! | ||
id | ID! | ||
archiveVariant | Variant! | ||
id | ID! | ||
unarchiveVariant | Variant! | ||
id | ID! |