Add a Recipe to the 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

servings

Int

Number of recipes to add for the recipe.

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

Example with Servings

The following example adds one serving of the Fried Rice recipe to the shopping list.

mutation {
  addToShoppingList(
    recipeId: "bd2f4b0c-83fc-4a45-8b2c-862bb31c85a9"
    servings: 1
  ) {
    success
    message
  }
}

If a shopping list is created from a LOW variety meal plan, we suggest using the following logic.

  • If a recipe is present only once in the meal plan —> add the recipe to the shopping list using the default number of servings of the recipe.

  • If a recipe is present more than one time in the meal plan:

    • if recipe's default number of servings (i.e. 2) < number of times the recipe appears (ie. 3) —> add recipe to shopping list with the number of servings equal to how many times it shows up on the meal plan (ie. 3).

    • if recipe's default number of servings (i.e. 4) >= number of times the recipe appears (i.e. 2) —> add recipe with default number of servings.

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