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
  • How the Simple Meal Plan works
  • Available Arguments
  • Available Fields
  • Examples
  • Generate a 7-day meal plan
  • Generate a meal plan over a meal plan in progress
  • Generate a meal plan that increases and decreases the rules
  • 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

Was this helpful?

  1. Suggestic API Reference
  2. Mutations
  3. Meal Plan

Generate Simple Meal Plan

Generate a simple meal

PreviousAssign a Meal Plan Template to a UserNextGenerate Meal Plan

Last updated 10 months ago

Was this helpful?

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 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 mutation.

Manage Rules

The generateSimpleMealPlan inlcudes an option to increase or decrease rules depending on the rules defined in a .

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

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

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

mutation {
  generateSimpleMealPlan {
    success
    message
  }
}
{
    "data": {
        "generateSimpleMealPlan": {
            "success": true,
            "message": "Meal plan was successfully created"
        }
    }
}

cURL Example

curl -XPOST 'https://production.suggestic.com/graphql' \
  -H 'Authorization: Bearer <User-JWT' \
  -H 'Content-Type: application/json' \
  --data-raw '{"query":"mutation GenerateSimpleMealPlan {generateSimpleMealPlan { success  message }}"}'
{
    "data": {
        "generateSimpleMealPlan": {
            "success": true,
            "message": "Meal plan was successfully created"
        }
    }
}

If the user doesn't have enough history days, the following message is displayed:

mutation {
  generateSimpleMealPlan (addDays:true ignoreLock:false repeat:"2021-10-21T10:25:14.120000Z"){
    success
    message
  }
{
  "data": {
    "generateSimpleMealPlan": {
      "success": false,
      "message": "Profile does not have enough days in history to complete a meal plan"
    }
  }
}

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:

mutation {
  generateSimpleMealPlan {
    success
    message
  }
}
{
    "data": {
        "generateSimpleMealPlan": {
            "success": false,
            "message": "User has a meal plan in progress."
        }
    }
}

To bypass the lock, send the argument ignoreLock: true .

mutation {
  generateSimpleMealPlan (addDays:true ignoreLock:true){
    success
    message
  }
}

Generate a meal plan that increases and decreases the rules

GraphQL Example

mutation GenerateSimpleMealPlan {
  generateSimpleMealPlan(boostAdherence: true) {
    success
    message
  }
}
{
    "data": {
        "generateSimpleMealPlan": {
            "success": true,
            "message": "Meal plan was successfully created"
        }
    }
}

cURL Example

curl -XPOST 'https://production.suggestic.com/graphql' \
  -H 'Authorization: Bearer <User-JWT>' \
  -H 'Content-Type: application/json' \
  --data-raw '{"query":"mutation GenerateSimpleMealPlan{generateSimpleMealPlan(boostAdherence: true) {success message}}"}'
{
    "data": {
        "generateSimpleMealPlan": {
            "success": true,
            "message": "Meal plan was successfully created"
        }
    }
}

Generate a meal plan by setting caloric range for each meal time

mutation {
  generateSimpleMealPlan(
    addDays: true
    ignoreLock: true
    filters: {
      kcalRange: {
        breakfast: { min: 100, max: 650 }
        lunch: { min: 100, max: 400 }
        snack: { min: 100, max: 300 }
        dinner: { min: 100, max: 400 }
      }
    }
  ) {
    success
    message
  }
}
{
  "data": {
    "generateSimpleMealPlan": {
      "success": true,
      "message": "Meal plan was successfully created"
    }
  }
}

Generate a meal plan by setting caloric range and tags for each mealtime

mutation {
  generateSimpleMealPlan(
    addDays: true
    ignoreLock: true
    filters: {
      kcalRange: { breakfast: { min: 100, max: 500 } }
      tags: { snack: ["salad"] }
    }
  ) {
    success
    message
  }
}

{
  "data": {
    "generateSimpleMealPlan": {
      "success": true,
      "message": "Meal plan was successfully created"
    }
  }
}

Generate a meal plan with a specific variety of recipes

mutation {
  generateSimpleMealPlan (variety:MEDIUM){
    success
    message
  }
}
{
  "data": {
    "generateSimpleMealPlan": {
      "success": true,
      "message": "Meal plan was successfully created"
    }
  }
}

Generate a meal plan with a specific variety of cuisines

mutation {
  generateSimpleMealPlan (filters:{cuisines:["Indian","Mexican","American"]}){
    success
    message
  }
}
{
  "data": {
    "generateSimpleMealPlan": {
      "success": true,
      "message": "Meal plan was successfully created"
    }
  }
}

Append days to active meal plan

mutation{
  generateSimpleMealPlan(isAppend:true appendDays:4){
    success
    message
  }
}
{
  "data": {
    "generateSimpleMealPlan": {
      "success": true,
      "message": "Meal plan was successfully created"
    }
  }
}

Generate a meal plan with max time filter

mutation {
  generateSimpleMealPlan(
    boostAdherence: true
    filters:{maxTimeMinutes:{breakfast:30 dinner:50 lunch:40 snack:15}}
  ) {
    success
    message
  }
}
{
  "data": {
    "generateSimpleMealPlan": {
      "success": true,
      "message": "Meal plan was successfully created"
    }
  }
}

If it is required to set the with a custom format such as [BREAKFAST, SNACK, LUNCH, SNACK, DINNER, SNACK], use the or the .

The generateSimpleMealPlan does not consider the user's macro goals. Instead, you can use the mutation.

Don't forget to execute the query to verify that your meal plan has been created successfully.

To understand how a meal plan works refer to .

Object that generate a simple meal plan by using specific information such as [] caloric range tags and maxTimeMinutes

filters
Generate Meal Plan
program
user's meal plan settings
generateMealPlan mutation
customMealPlan mutation
generateMealPlan
mealPlan
this guide
SimpleMPFiltersInput
cuisines