Shopping List
Manage Shopping Lists
Use
addToShoppingList
to add a recipe to the user's shopping listArguments | Type | Description |
recipeId | UUID | recipe database UUID |
Field Name | Type | Description |
success | Boolean | True if the recipe has been added to the shopping list. Otherwise, it will display False |
message | String | Description of the result. Either if the recipe was added or not. |
The following example adds the Fried Rice recipe to the shopping list:
Mutation
Response
mutation {
addToShoppingList(recipeId: "bd2f4b0c-83fc-4a45-8b2c-862bb31c85a9") {
success
}
}
{
"data": {
"addToShoppingList": {
"success": true,
"message": "Recipe successfully added"
}
}
}
if the recipe does not exist, the following message is displayed:
Mutation
Response
mutation {
addToShoppingList(recipeId: "24c86d77-031b-4d3b-b6b0-33a0be2d5332") {
success
message
}
}
{
"data": {
"addToShoppingList": {
"success": false,
"message": "Recipe doesn't exist"
}
}
}
In the same way, we have code examples, this is an implementation example in which see results of the API execution in the Suggestic App.
Login to the App, tap on the Meal Plan option, and tap on the
icon to access the Shopping List, Tap on By Recipe tab to see the recently added recipe.


Arguments | Type | Description |
recipeIds | [UUID] | List of recipe database UUID |
Mutation
Response
mutation {
addRecipesToShoppingList(recipeIds: [
"26400c11-125d-4782-b83c-6c74923ae9ab",
"4719210c-fff5-4709-b6d2-7b460102843d"
]) {
message
success
}
}
{
"data": {
"addRecipesToShoppingList": {
"message": "Recipes successfully added",
"success": true
}
}
Use
RemoveFromShoppingList
to remove a recipe from the shopping list.Arguments | Type | Description |
recipeId | ID | Unique ID of the recipe |
Mutation
Response
mutation {
removeFromShoppingList(
recipeId: "UmVjaXBlOjNmMTVmNzkzLTc1ZmQtNGE3YS04MDBkLTIwNGUwZDczYzFkMw=="
) {
success
}
}
{
"data": {
"removeFromShoppingList": {
"success": true
}
}
}
Use
updateShoppingListRecipeServings
to update the recipe number of servingsArguments | Type | Description |
recipeId | ID | ID of the recipe |
numberOfServings | Int | Servings quantity |
Update the recipe number of servings to 2.
Mutation
Response
mutation {
updateShoppingListRecipeServings(
recipeId: "UmVjaXBlOjQyOWM5N2M5LTMyN2ItNDFlNS05MjdlLWI5ZWU3YTJjZWRlYg==",
numberOfServings: 2) {
success
}
}
{
"data": {
"updateShoppingListRecipeServings": {
"success": true
}
}
}
In the same way, we have code examples, this is an implementation example in which see results of the API execution in the Suggestic App.
Login to the App, tap on the Meal Plan option, and tap on the
icon to access the Shopping List, Tap on By Recipe tab and see that the servings number has been updated to 2:



Use
toggleShoppingListItem
to change the isDone status of a shopping list item.Arguments | Type | Description |
itemId | UUID | required the list item id, could be from aggregation or from recipe view. To get the item ID, execute the shoppingListAggregate mutation. |
isAggregate | Bool | required if the id is from the aggregation view |
Mutation
Response
mutation {
toggleShoppingListItem(
itemId: "195c0e2f-302f-4f65-8982-aa13fee2f8d5"
isAggregate: true
){
success
}
}
{
"data": {
"toggleShoppingListItem": {
"success": true
}
}
}
Use
clearShoppingListCheckedItems
to remove all items currently marked as done.Clear all checked items form the user's Shopping List
Mutation
Response
mutation {
clearShoppingListCheckedItems {
success
}
}
{
"data": {
"clearShoppingListCheckedItems": {
"success": true
}
}
}
In the same way, we have code examples, this is an implementation example in which see results of the API execution in the Suggestic App.
Login to the App, tap on the Meal Plan option, and tap on the
icon to access the Shopping List, Tap on By Recipe tab, the action to clear all checked items is the same as explained as follows:


Use
clearShoppingList
to remove all items, independently of their state, from the shopping list.Mutation
Response
mutation {
clearShoppingList {
success
}
}
{
"data": {
"clearShoppingList": {
"success": true
}
}
}
In the same way, we have code examples, this is an implementation example in which see results of the API execution in the Suggestic App.
Login to the App, tap on the Meal Plan option, and tap on the
icon to access the Shopping List, Tap on By Recipe tab, the action to clear the entire shopping list is the same as explained as follows:


Last modified 10mo ago