How to add desserts to your meal plan
The document will guide you through the steps to add a dessert meal to your generated meal plan.
Overview
The Suggestic API usually generates a 7-day meal plan based on the following format:
BREAKFAST, SNACK, LUNCH, DINNER
Even though there is no DESSERT mealtime category, you can replace a mealtime to include a dessert recipe. Usually, the SNACK mealtime can be replaced with a dessert recipe in an already generated meal plan.
In this example, you will learn how to add a dessert recipe to your meal plan.
Requirements
To have a meal plan generated
Considerations
If it is required to set the user's meal plan settings with a custom format such as
[BREAKFAST, LUNCH, SNACK, DINNER, SNACK],use thegenerateMealPlanmutation. ThegenerateSimpleMealPlanplan does not consider the format.
API endpoints to use
Through the example, use the following endpoints in the same order as they are listed below:
The
updateMealPlanSettingsmutationto update your meal plan format to add aSNACKmealtime.The
generateMealPlanquery, only if you update the meal plan settings.The
mealPlanquery to get the recipe Id to replace it with the dessert recipe.recipeSearch,recipesByTagorrecipesByMealTimequeries to get the dessert recipe ID requiredThe
swapMealPlanRecipemutation to swap the current recipe with the dessert recipe.The
mealPlanquery to verify that the recipes were swapped.
Examples
Code Example
Find all the steps detailed below in this graphqlbin. Modify the code accordingly.
Step by Step Example
Follow the 6 steps below to include a dessert in your meal plan.
Last updated
Was this helpful?
