Technical Docs
Ask or search…
K

Custom Meal Plan

Generates a Custom Meal Plan based on a daily caloric goal, macro ratios, and the user's profile.
The customMealPlan query will return a list of days with a number of meals, based on the arguments below. Each meal contains a Recipe with all its expected properties along with the amount of recommended servings.

Arguments

Arguments
Type
Description
calories
Int!
Total Calories per day
carbs
Float!
Percent of Carbs
protein
Float!
Percent of Protein
fat
Float!
Percent of Fat
omega3
Float
Percent of Omega 3. If not included, the planner ignores this constraint.
days
Float
Length of meal plan (in days)
format
MealTimeType
Requested meals per day format, Available options are: BREAKFAST, SNACK, LUNCH, DINNER
error
Float!
Margin of error (as a percentage) for calories and macros. Default: 0.05
breakfastDistribution
Float
Percentage of the daily calories goal that each breakfast covers.
lunchDistribution
Float
Percentage of the daily calories goal that each lunch covers.
dinnerDistribution
Float
Percentage of the daily calories goal that each dinner covers.
snackDistribution
Float
Percentage of the daily calories goal that each snack covers.
maxTimeMinutes
Object that returns the maximum values for each meal. Expressed in minutes.
For example, maximum preparation time for the following meals:
  • breakfast: 15
  • lunch: 30
  • dinner: 40
  • snack: 30
maxIngredientsCount
Object that returns the maximum values for each meal. Expressed in minutes.
For example, maximum ingredient count for the following meals:
  • breakfast: 7
  • lunch: 5
  • dinner: 5
  • snack: 6

Available Fields

The following fields will be displayed in the response:
Field name
Type
Note
day
Int
The number of days in the returned meal plan.
calories
Float
Total calories (in Kcal) for the day.
meals
A Recipe along with the amount of recommended servings.

Example

Query
Response
{
customMealPlan(
calories: 1600
carbs: 0.45
protein: 0.25
fat: 0.3
days: 1
format: [BREAKFAST, LUNCH, DINNER]
breakfastDistribution: 0.3
maxTimeMinutes:{
breakfast:10,
dinner:8,
snack:5,
lunch:3
}
) {
day
calories
meals {
id
meal
numOfServings
calories
recipe {
id
databaseId
name
numberOfServings
nutrientsPerServing {
calories
}
}
}
}
}
{
"data": {
"customMealPlan": [
{
"day": 1,
"calories": 1608.8731844830427,
"meals": [
{
"id": null,
"meal": "Breakfast",
"numOfServings": 2,
"calories": 514.5982545763253,
"recipe": {
"name": "Carrot,Ginger And Plum Juice",
"id": "UmVjaXBlOjVkMjg3NjA5LTdlODYtNDQ4ZC1iZTkwLWU3MDdkNjlkNTkyMQ==",
"databaseId": "5d287609-7e86-448d-be90-e707d69d5921",
"numberOfServings": 2,
"nutrientsPerServing": {
"calories": 257.3
}
}
},
{
"id": null,
"meal": "Lunch",
"numOfServings": 2,
"calories": 784.672,
"recipe": {
"name": "Homemade Chicken Ham Recipe",
"id": "UmVjaXBlOmVkZWM0MzYzLTYwNTctNGY5OS1iOGRhLTk1N2VhZjJhOGI1MA==",
"databaseId": "edec4363-6057-4f99-b8da-957eaf2a8b50",
"numberOfServings": 2,
"nutrientsPerServing": {
"calories": 392.34
}
}
},
{
"id": null,
"meal": "Dinner",
"numOfServings": 2,
"calories": 309.60292990671724,
"recipe": {
"name": "Roasted Butternut Squash Green Bean Casserole Recipes",
"id": "UmVjaXBlOmI5NTgxMDk5LTgyZGQtNDVlYS04ZWE2LTk1NTU3MGY5YThmMw==",
"databaseId": "b9581099-82dd-45ea-8ea6-955570f9a8f3",
"numberOfServings": 8,
"nutrientsPerServing": {
"calories": 154.8
}
}
}
]
}
]
}
}
It may occur that meal plan service times out and generates fewer days than requested, if this happens please review your constraints, as too many restrictions may significantly reduce the universe of suitable recipes.

Considerations

  • A margin of error has been set for the resulting meal plan for both calories and macronutrients.
  • No meal repeats on the same day.
  • This query takes into account the user's program and preferences.
  • This query doesn't take into consideration a user's personal caloric goals. Use Meal Plan for that option.
  • A number of quality-related filters have been set, by default, in order to ensure high-quality meal plans:
    • Excludes recipes for desserts, sauces, dips, bread, cocktails, and similar.
    • Excludes recipes with under 40 calories per serving.
    • Excludes snacks with over 5 ingredients.
    • Excludes recipes with over 15 servings.
    • Excludes recipes with more than 45-minute of cooking and preparation time.
    • Excludes 0 calorie foods.
    • Excludes packaged foods.