Technical Docs
Search…
⌃K

Shopping List

Manage Shopping Lists

Add to Shopping List

Use addToShoppingList to add a recipe to the user's shopping list

Available Argument

Arguments
Type
Description
recipeId
UUID
recipe database UUID

Available Fields

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.

Example

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"
}
}
}

UI/UX example

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.

Add Multiple Recipes to a Shopping list

Available Argument

Arguments
Type
Description
recipeIds
[UUID]
List of recipe database UUID

Example

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
}
}

Remove a recipe from a Shopping List

Use RemoveFromShoppingList to remove a recipe from the shopping list.

Available Argument

Arguments
Type
Description
recipeId
ID
Unique ID of the recipe

Example

Mutation
Response
mutation {
removeFromShoppingList(
recipeId: "UmVjaXBlOjNmMTVmNzkzLTc1ZmQtNGE3YS04MDBkLTIwNGUwZDczYzFkMw=="
) {
success
}
}
{
"data": {
"removeFromShoppingList": {
"success": true
}
}
}

Update recipe serving

Use updateShoppingListRecipeServings to update the recipe number of servings
Arguments
Type
Description
recipeId
ID
ID of the recipe
numberOfServings
Int
Servings quantity

Example

Update the recipe number of servings to 2.
Mutation
Response
mutation {
updateShoppingListRecipeServings(
recipeId: "UmVjaXBlOjQyOWM5N2M5LTMyN2ItNDFlNS05MjdlLWI5ZWU3YTJjZWRlYg==",
numberOfServings: 2) {
success
}
}
{
"data": {
"updateShoppingListRecipeServings": {
"success": true
}
}
}

UI/UX example

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:

Check/Uncheck an Item

Use toggleShoppingListItemto change the isDone status of a shopping list item.

Available Arguments

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

Example

Mutation
Response
mutation {
toggleShoppingListItem(
itemId: "195c0e2f-302f-4f65-8982-aa13fee2f8d5"
isAggregate: true
){
success
}
}
{
"data": {
"toggleShoppingListItem": {
"success": true
}
}
}

Clear All Checked Items

Use clearShoppingListCheckedItemsto remove all items currently marked as done.

Example

Clear all checked items form the user's Shopping List
Mutation
Response
mutation {
clearShoppingListCheckedItems {
success
}
}
{
"data": {
"clearShoppingListCheckedItems": {
"success": true
}
}
}

UI/UX example

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:

Clear Shopping List

Use clearShoppingList to remove all items, independently of their state, from the shopping list.
Mutation
Response
mutation {
clearShoppingList {
success
}
}
{
"data": {
"clearShoppingList": {
"success": true
}
}
}

UI/UX example

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: