Generate Simple Meal Plan
Generate a simple meal
The generateSimpleMealPlan
mutation generates a 7-days meal plan that complies with the user's program and preferences.
How the Simple Meal Plan works
The generateSimpleMealPlan
includes default values, for example, each day has breakfast, lunch, dinner, and a single snack, with a daily caloric goal of 2000 kcal.
Use Filters
Use filters if what you need is to generate a meal plan with recipes that contain a specific caloric range or tags per mealtime.
Lock the meal plan
By default, generateSimpleMealPlan
locks the meal plan to stop the user from generating a new meal plan if one is in progress. In other words, a user can't generate a new meal plan if the current one still has dates in the future.
If you need more control over these settings, please review the Generate Meal Plan mutation.
Manage Rules
The generateSimpleMealPlan
inlcudes an option to increase or decrease rules depending on the rules defined in a program.
Allow repetitions in the meal plan
Generate a meal plan more consistently to simplify shopping by defining the variety
argument to specify the number of repetitions per meal.
There are 3 levels of variety:
LOW:
Generate three different meals in the week. For example, the meal plan generates three breakfasts, three lunches, three dinners, and three snacks distributed across the week.MEDIUM:
Generate 5 different meals in the week.HIGH:
All generated meals are different. This is the current behavior of the meal plan.
This is not a required argument, so if it is not defined, the high
variety is set as default.
Considerations
If it is required to set the user's meal plan settings with a custom format such as
[BREAKFAST, SNACK, LUNCH, SNACK, DINNER, SNACK],
use thegenerateMealPlan
mutation or the customMealPlan mutation.The
generateSimpleMealPlan
does not consider the user's macro goals. Instead, you can use thegenerateMealPlan
mutation.
Don't forget to execute the mealPlan
query to verify that your meal plan has been created successfully.
To understand how a meal plan works refer to this guide.
Available Arguments
Argument Name
Type
Description
addDays
Boolean
True to allow generating a new meal plan if a user is on her last meal plan day. This field is ignored if ignoreLock
is true. Default is false.
isAppend
Boolean
True to add an additional week worth of meal plan (7 days) to the end of the current meal plan each time is executed. (Default is false.)
appendDays
Int
After setting isAppend
to True use appendDays
to define the amount of days to append. (max 7)
ignoreLock
Boolean
True to allow generating a new meal plan any time, overwriting any pending days in the current plan. Default is false.
repeat
Datetime
Create a new meal plan repeating the 7 dates after repeat in user's history. Default to null
boostAdherence
Boolean
True to consider increase and decrease rules in simpleMealPlan. All the recipes included will have a higher score. Otherwise is False. By default, this value is set to false
filters
Object that generate a simple meal plan by using specific information such as [
cuisines
]
caloric range
tags
and maxTimeMinutes
variety
MPVariety
Define the variety of the recipes generated in the meal plan. Possible Values: LOW
, MEDIUM
, or HIGH
Available Fields
The following fields will be displayed in the response:
Field
Type
Description
success
Boolean
True if a meal entry has been created. Otherwise, it displays False
message
String
Description of the result
Examples
Generate a 7-day meal plan
GraphQL Example
cURL Example
If the user doesn't have enough history days, the following message is displayed:
Generate a meal plan over a meal plan in progress
If you try using generateSimpleMealPlan
, while a meal plan is in progress, you'll get the following response:
To bypass the lock, send the argument ignoreLock: true
.
Generate a meal plan that increases and decreases the rules
GraphQL Example
cURL Example
Generate a meal plan by setting caloric range for each meal time
Generate a meal plan by setting caloric range and tags for each mealtime
Generate a meal plan with a specific variety of recipes
Generate a meal plan with a specific variety of cuisines
Append days to active meal plan
Generate a meal plan with max time filter
Last updated