Query to obtain recipes with similar macronutrient distribution
Use the similarMacrosRecipes query to obtain recipes equivalent in macronutrient distribution as the one provided in the argument. Use the size argument to indicate the number of recipes returned.
If you already have a meal from a mealPlan query, you can use the serving argument to find more recipes. The recipes in the response will also have a serving field to know how many of the total numbers of servings have to be served to keep a similar amount of macros.
Arguments
Type
Required
Description
recipeId
ID
True
Recipe to which equivalents are to be returned
serving
Int
False
The number of recipe servings served. Default to 1.
size
Int
False
Define the number of returned recipes.
If this parameter is not sent, the default number is 3.
Example
The following example returns recipes equivalent to the recipe ID provided in the argument. Since the size parameter is not defined, by default, the number of recipes retrieved is 3.
{ similarMacrosRecipes( recipeId: "UmVjaXBlOjZlZDUyNGFmLWVhNTMtNDJhMi05ODEzLTc1MDQzMDNkNjc4Yw==" serving: 2 ) { id name serving numberOfServings nutrientsPerServing { calories carbs fat protein } }}
{"data": {"similarMacrosRecipes": [ {"id":"UmVjaXBlOjI0ODBlMTZhLTBhOTUtNDAzOC05YmJhLTBmZTAxZDE3YTI3NQ==","name":"Banana Chai Spice Smoothie","serving":2,"numberOfServings":3,"nutrientsPerServing": {"calories":362.58,"carbs":56.83,"fat":9.43,"protein":12.6 } }, {"id":"UmVjaXBlOjExNjFiOTIxLTcyNGEtNDk0YS1hMWZkLThlYzAxYTczYTgxYg==","name":"Baked Oatmeal With Dried Fruit","serving":1,"numberOfServings":1,"nutrientsPerServing": {"calories":336.31,"carbs":48.94,"fat":9.94,"protein":12.77 } }, {"id":"UmVjaXBlOjc3MTg2ZTIzLTYzMDktNDQ5Mi05NDA1LWIxN2IwMDNjMmFkMg==","name":"Quinoa Salad With Black Beans And Mango","serving":2,"numberOfServings":4,"nutrientsPerServing": {"calories":348.72,"carbs":55.18,"fat":8.74,"protein":12.34 } } ] }}
The following example retrieves 15 similar recipes:
{
similarMacrosRecipes(
recipeId: "UmVjaXBlOjZlZDUyNGFmLWVhNTMtNDJhMi05ODEzLTc1MDQzMDNkNjc4Yw=="
serving: 2
size: 15
) {
id
name
serving
numberOfServings
nutrientsPerServing {
calories
carbs
fat
protein
}
}
}