Technical Docs
  • Introduction
  • Guides
    • Getting Started
    • Attribution Guidelines
    • Core Concepts
      • Adherence Score
      • Programs, Diets, and Rulesets
      • User Profile
      • Datasets
    • Tutorials and Walkthroughs
      • Creating a Meal Plan
      • Food Log Guide
      • Pagination
      • Executing Multiple Mutations
  • Knowledge Base
    • How-to guides
      • How to add desserts to your meal plan
      • How to log your custom recipe
      • How to generate a Meal Plan based on a template
    • Common errors
      • Meal Plan generation
    • FAQs
      • Getting Started on Suggestic
      • API and Authentication
      • Device Compatibility
      • Meal Plan
      • Nutrition
      • Programs
      • Recipes
  • HELPFUL RESOURCES
    • Deprecated Features
    • Glossary
    • Integrations
      • Building a No-code Meal Planning Application
        • Step 1: Creating the Integromat Scenario and Google Forms Connection
        • Step 2: Creating a User, Generating a Meal Plan, and Retrieving It
        • Step 3: Crafting Our PDF and Connecting PDFMonkey
        • Step 4: Sending The Document to Our User
  • Packages and SDKs
    • Node Package (NPM)
  • GraphQL
    • GraphQL Overview
    • Authentication
    • Calling GraphQL
    • GraphQL Playground
  • Changelog
    • 2025
      • March
  • Suggestic API Reference
    • Search
      • Food Log
        • Branded Foods Search
        • Common Foods Search
        • My Branded Food Search
        • My Common Foods Search
        • Food Search
        • Legacy
          • Autocomplete
          • Barcode Search
      • Recipe Search
        • Recipe Search
        • Recipe Search by Name or Ingredients
        • Recipe Search by Ingredients
      • Meal Plan Template Search
      • Profile Search
      • Restaurant Search
        • Restaurant Search by Location
        • Restaurant Search
    • Queries
      • Appointments
        • Upcoming Appointments
        • Past Appointments
        • Appointments Types
      • Assessments
        • Assessment Answers
        • Display Assessments
        • Supplement Recommendations
        • User Assessments
      • Content
        • Content Library
        • Content Categories
        • Content Tags
        • Journey
      • Food Log
        • Frequently Logged
        • Food Log Entries
        • Macros Aggregation
        • Micronutrients Aggregation
        • Macro Goals
        • Recently Logged
        • User's Foods and Recipes
          • User's Recipes
        • Legacy
          • Food Log Entries (Legacy)
          • Own Food Items
          • Own Food Item
          • Own Food Item by Id
          • Own Items
          • Own Recipe
          • Own Recipes
      • Lab Tests
        • Biomarker Categories
        • Biomarker Units
        • Biomarker Catalog
        • Biomarkers
        • Biomarker Results
        • Historical Biomarker Results
        • Historical Results by Biomarker
        • Lab Test Reports
        • Recommended Supplements
        • Recommended Articles
      • Meal Plan
        • Meal Plan
        • Custom Meal Plan
        • Simplified Meal Tracking
          • Meal Tracker
        • Meal Plan Config
        • Meal Planner (deprecated)
      • Program
        • All Programs
        • Program Details
      • Recipes
        • Equivalent Recipes (Macros)
        • Equivalent Recipes (Calories)
        • Recipe by Id
        • Recipes By MealTime
        • Recipes By Tag
        • Recipe Swap Options
        • Popular Recipes
        • Favorite Recipes
        • Premium Program Recipes
      • Restaurants
        • Restaurant By Id
        • Menu Items
        • Menu Item By Id
        • Menu Item by Program
        • Recommend Menu Items
      • Restrictions
        • Restrictions
        • Restriction by ID
      • Shopping List
        • Shopping List by Aisle
        • Shopping List by Recipes
      • Subscriptions
        • Subscription List
      • Supplement Plans
        • Supplement plan list
        • Supplement list
      • Tracking
        • Activity and Exercise
        • Checklists
          • Intake Checklist
        • Daily Recap
          • Get Daily Recap
          • Get Daily Recaps
          • Get Daily Recap Questions
          • Get Daily Mood Summary
        • Inisghts
        • Wellness Score
        • Sleep
          • Sleep Time
          • Sleep Quality Score
        • Steps
        • Water and Hydration
        • Heart Rate
        • HRV
        • Weight Tracker
      • USDA Food
      • Users
        • Users
        • User Profile
      • WGPT
        • Assistants
        • Journey
        • Guardrails
    • Mutations
      • Appointments
        • Update Appointment Credits
      • Assessments
        • New User Assessments
        • Set User Answers
      • Content
        • Mark Content as Read
      • Feedback
      • Food Log
        • Log Entries
          • Food Log
            • Add a Food Log Entry
            • Delete a Food Log Entry
          • Meal Log (Legacy)
            • Create Log Entry
            • Update Log Entry
            • Remove Log Entry
        • User's Foods and Recipes
          • Create a User Recipe
          • Create my Branded Food
          • Create my Common Foods
          • Update a User Recipe
          • Delete a User Recipe
          • Legacy: "Own" Recipe
            • Create "Own" Recipe
            • Update "Own" Recipe
            • Remove "Own" Recipe
        • AI Food Log
          • Process Ai Food
        • Legacy (ownFoods and ownRecipes)
          • Create "own" Food Item
          • Update "own Food"
          • Remove "own" Food Item
      • Journey Status
        • Start Journeys
        • Journey Status
        • Toggle Task Completed
      • Lab Tests
        • Add Biomarker
        • Update Biomarker
        • Add Biomarker Result
        • Add Biomarker Category
        • Update Biomarker Category
        • Remove Biomarker Category
        • Add Lab Test Report
        • Delete Lab Test Report
        • Update Lab Test Report
        • Create Recommended Supplement
        • Update Recommended Supplement
        • Remove Recommended Supplement
        • Create Recommended Article
        • Update Recommended Article
        • Remove Recommended Supplement
      • Meal Plan
        • Create Meal Plan Template
          • Custom Options
          • From Days
          • From Scratch
        • Assign a Meal Plan Template to a User
        • Generate Simple Meal Plan
        • Generate Meal Plan
        • Start Over Meal Plan
        • Swap Meals
        • Simplified Meal Tracking
          • Create a Meal Tracker Entry
        • Remove Meal Plan
        • Remove Meal Plan Recipe
      • Recipes
        • Add new recipe
        • Add Favorite Recipe
      • Shopping List
        • Add Multiple Recipes to the Shopping List
        • Add a Recipe to the Shopping List
        • Bulk Check/Uncheck Items
        • Check/Uncheck an Item
        • Clear Checked Items
        • Clear Shopping List
        • Remove Recipe
        • Update Serving Number
      • Subscriptions
        • Update Subscription
      • Supplement Plans
        • Create supplement plan for user
        • Update user supplement plan
        • Add Supplement
        • Update Supplement
      • Tracking
        • Activity and Exercise
          • Add Exercise Entry
          • Delete Exercise Entry
        • Checklists
          • Create my Checklist Item
          • Delete my Checklist Item
        • Daily Recap
          • Create a daily recap question
          • Select Daily Recap Questions
          • Delete a Daily Recap Question
        • Sleep
          • Add Sleep Time
          • Add Sleep Quality Score
        • Steps
          • Add Steps Count
          • Delete Steps Count
        • Heart Rate
          • Add Heart Rate
          • Delete Heart Rate
        • HRV
          • Add HRV
          • Delete HRV
        • Water and Hydration
        • Weight
          • Add Weight Entry
          • Remove Weight Entry
        • User Tracker Goals
          • Create User Goal
          • Update User Goal
          • Remove User Goal
      • Users
        • Authenticate using a Magic Link
        • Create User
        • Custom Attributes
        • Delete a User Account
        • Login User
        • Merge User Accounts
        • Request Reset Password
        • Reset Password
        • Request Password Reset email
        • Sensitive Profile Attributes
        • Update Profile
        • Update User's Program
        • User's Restrictions
        • Update Meal Plan Settings
        • User's Goals
        • Legacy User Mutations
          • Legacy | User's Biomarkers
          • User's Meal Plan Settings (deprecated)
      • WGPT
        • Add user to journey
  • Objects
    • Appointments
      • Appointment
      • Appointment Type
      • Appointment Credit
      • Attendee
      • Coach
    • Common
      • User
      • Adherence
      • Aisle Name
      • CPC
      • CPCIngredientGroup
      • Meal Times
      • Menu Item
      • Own Serving
      • Own Nutrients
      • MacroNutrientsRangeInput
      • Range
      • Tracker
      • Restaurant
    • Food Logs
      • Food Filter
      • Ingredient Amount
      • Ingredients
      • Own Recipe Ingredient
      • Meal Type
      • Nutrients
        • Nutrient Enum
      • Portions
      • Servings
      • AI Food Log
        • Food Analysis
    • Meal Plan
      • Debug Meal Plan Conditions
      • Meal
      • Meal Plan Day
      • Maximum Time per Meal
      • Maximum Ingredient Count
      • Meal Plan Template
      • Simple Meal Plan Filters
    • Recipe
      • Recipe
        • Tags
        • Cuisines
      • Recipe Swap Options
      • Parsed Ingredient Lines
      • Nutritional Info
      • Nutrients Per Serving
      • Calories Per Serving
      • Relative Calories
      • Source
      • Ingredients
      • Units of Measurement
    • Lab Tests
      • Article
      • Biomarker
    • Supplement
    • Assessments
      • Question
      • Answer
    • Content
      • Content Library
      • Content Categories
      • Content Tag
    • WGPT
      • Journey
      • dayJourney
      • Interaction
  • Case Studies
    • Reverse Health Case Study
Powered by GitBook
On this page
  • Overview
  • Requirements
  • Considerations
  • API endpoints to use
  • Examples
  • Code Example
  • Step by Step Example

Was this helpful?

  1. Knowledge Base
  2. How-to guides

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.

PreviousHow-to guidesNextHow to log your custom recipe

Last updated 3 years ago

Was this helpful?

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

Considerations

  • If it is required to set the with a custom format such as [BREAKFAST, LUNCH, SNACK, DINNER, SNACK], use the . The generateSimpleMealPlan plan 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 mutationto update your meal plan format to add a SNACK mealtime.

  • The query, only if you update the meal plan settings.

  • The query to get the recipe Id to replace it with the dessert recipe.

  • , or queries to get the dessert recipe ID required

  • The mutation to swap the current recipe with the dessert recipe.

  • The query to verify that the recipes were swapped.

Examples

Code Example

Step by Step Example

Follow the 6 steps below to include a dessert in your meal plan.

The first two steps are optional. Follow then only if you don't have a SNACKdefined in your meal plan.

STEP 1: Add a SNACK meal to your meal plan.

Remember that the SNACK recipe will be replaced by the DESSERT recipe. If your meal plan does not include the SNACK meal time, execute the following mutation by adding a SNACK meal after LUNCH.

mutation updateMealPlanSettings {
  updateMealPlanSettings(
    overwrite: { format: [BREAKFAST, LUNCH, SNACK, DINNER] }
  ) {
    success
    message
  }
}

Note: Add a or move the SNACK meal time to any place. For example, if you need to have a SNACK (as a dessert) after the DINNER meal, you can setup the following format:

format: [BREAKFAST, LUNCH, SNACK, DINNER, SNACK]
STEP 2: Regenerate your meal plan
STEP 3: Identify the mealtime to replace

Request:

{
  mealPlan {
    day
    date(useDatetime: false)
    calories
    meals {
      id
      calories
      meal
      numOfServings
      recipe {
        name
        numberOfServings
        nutrientsPerServing {
          calories
        }
      }
    }
  }
}

Response:

{
  "data": {
    "mealPlan": [
      {
        "day": 7,
        "date": "2022-04-28",
        "calories": 2250.48579801368,
        "meals": [
          {
            "id": "TWVhbDo0OTg4Mzg2",
            "calories": 582.850409456654,
            "meal": "breakfast",
            "numOfServings": 1,
            "recipe": {
              "name": "Mexican-Spiced Tofu Scramble",
              "numberOfServings": 4,
              "nutrientsPerServing": {
                "calories": 582.85
              }
            }
          },
          {
            "id": "TWVhbDo0OTg4Mzg3",
            "calories": 830.597746296156,
            "meal": "lunch",
            "numOfServings": 2,
            "recipe": {
              "name": "Arugula Cannellini Beans Salad Recipes",
              "numberOfServings": 4,
              "nutrientsPerServing": {
                "calories": 415.3
              }
            }
          },
          {
            "id": "TWVhbDo0OTg4Mzg4",
            "calories": 154.027677840875,
            "meal": "snack",
            "numOfServings": 1,
            "recipe": {
              "name": "Kale Smoothie With Orange And Pear",
              "numberOfServings": 2,
              "nutrientsPerServing": {
                "calories": 154.03
              }
            }
          },
          {
            "id": "TWVhbDo0OTg4Mzg5",
            "calories": 683.00996442,
            "meal": "dinner",
            "numOfServings": 1,
            "recipe": {
              "name": "Braised Tofu",
              "numberOfServings": 1,
              "nutrientsPerServing": {
                "calories": 683.01
              }
            }
          }
        ]
      }
      ......

Copy the meal or meals id of the meal times and save them to use at the moment of swapping the recipes. In the case of the examples, the SNACK mealtime for day 7 is copied:

DAY 7: "id": "TWVhbDo0OTg4Mzg4"

STEP 4: Get the DESSERT recipe Id

As was mentioned above, there are different queries to get the dessert information. In the case of this example, the recipesByMealTime query is used.

Request:

{
  recipesByMealTime(mealTime: TREAT_DESSERT, dietaryTags: [VEGAN]) {
    edges {
      node {
        id
        name
        author
        tags
        mealTags
        ingredients {
          name
        }
        instructions
        ingredientLines
      }
    }
  }
}

Response:

{
  "data": {
    "recipesByMealTime": {
      "edges": [
        {
          "node": {
            "id": "UmVjaXBlOmJlZGQ0MjAzLTljZWEtNDZiYS05ZmIwLTY4NGFjZGYxZjZkNg==",
            "name": "Pineapple Chia Ice Pops",
            "author": "I Heart Vegetables",
            "tags": [
              "VEGETARIAN",
              "PLANT_BASED",
              "Dessert",
              "DAIRY_FREE",
              "VEGAN",
              "GLUTEN_FREE"
            ],
            "mealTags": [
              "Snack"
            ],
            "ingredients": [
              {
                "name": "Pineapple"
              },
              {
                "name": "Protein powder optional"
              },
              {
                "name": "Bolthouse farms pineapple mango smoothie"
              },
              {
                "name": "Chia seeds"
              }
            ],
            "instructions": [],
            "ingredientLines": [
              "½ cup frozen pineapple",
              "1 scoop of protein powder Optional: For a protein boost",
              "16 oz Bolthouse Farms Pineapple Mango Smoothie",
              "2 tbsp chia seeds"
            ]
          }
        }
      ]
    }
  }
}
STEP 5: Swap the SNACK and DESSERT recipes in the meal plan
mutation {
  swapMealPlanRecipe(
    recipeId: "UmVjaXBlOmI5NmMxMmExLWU1Y2EtNDI2MS1hZjUzLWY0MGMxY2ZhNDBiMg=="
    mealId: "TWVhbDo0ODk4OTY3"
    serving: 2
  ) {
    success
  }
}
STEP 6: Verify that both recipes were swapped

Execute the mealPlan query to verify that the recipe has been replaced:

Find all the steps detailed below in this . Modify the code accordingly.

If you updated the meal plan settings,

Execute the query to identify the mealtime or mealtimes to replace.

Execute the and replace the mealId copied on step 2 and the recipeID copied on step 4:

​

meal plan generated
user's meal plan settings
generateMealPlan mutation
updateMealPlanSettings
generateMealPlan
mealPlan
recipeSearch
recipesByTag
recipesByMealTime
swapMealPlanRecipe
mealPlan
graphqlbin
re-generate your meal plan
mealPlan
swapMealPlanRecipe