Add to Shopping List

Manage Shopping Lists

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 {
  addToShoppingList(recipeId: "bd2f4b0c-83fc-4a45-8b2c-862bb31c85a9") {
    success
  }
}

if the recipe does not exist, the following message is displayed:

mutation {
  addToShoppingList(recipeId: "24c86d77-031b-4d3b-b6b0-33a0be2d5332") {
    success
    message
  }
}

UI/UX example

This is an implementation example from the Suggestic App.

Add Multiple Recipes to a Shopping list

Available Argument

Arguments

Type

Description

recipeIds

[UUID]

List of recipe database UUID

Example

mutation {
  addRecipesToShoppingList(recipeIds: [
    "26400c11-125d-4782-b83c-6c74923ae9ab",
    "4719210c-fff5-4709-b6d2-7b460102843d"
  ]) {
    message
    success
  }
}

Last updated