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
  • API endpoints to use
  • Code Example
  • Example

Was this helpful?

  1. Knowledge Base
  2. How-to guides

How to log your custom recipe

The document will guide you through the steps to create and log your custom meal

PreviousHow to add desserts to your meal planNextHow to generate a Meal Plan based on a template

Last updated 2 years ago

Was this helpful?

Overview

Custom recipes is a great way to quickly enter meals into your diary, they let you save food with multiple ingredients so you can quickly add it to your daily log. So, instead of adding individual food you eat at breakfast daily, you can create a "My Breakfast routine" recipe with all of these ingredients. So you time consuming will be way far better.

In this example, you will see how to create and log your custom recipe.

Requirements

  • To have your own common or branded food created (not mandatory)

API endpoints to use

Through the example, use the following endpoints in the same order as they are listed below:

  • and/or to get the food Id, either for existing common or branded food.

  • and/or if you need to add a specific food to create your recipe.

  • or to get the FoodId already added. Use this in the createMyRecipe mutation.

  • by using the FoodId gathered before.

  • to list the recent recipe created and get its id to log it. (Optional Step)

  • mutation to log your meal based on the recipe you created above.

Code Example

Example

Name of the recipe: Vegan Milkshake

Follow the 5 steps below to create the Vegan Milkshake recipe to be then logged into your dairy:

STEP 1: Find the foods to add to your recipe

In the case of this example, use the commonFoods to find the "Vanilla extract".

Request:

{
  commonFoods(query: "vanilla extract", first:1) {
    edges {
      node {
        id
        name
        nutrients {
          type
          amount
          name
          unit
        }
      }
    }
  }
}

Response

{
  "data": {
    "commonFoods": {
      "edges": [
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6YzYwZDljOWYtM2IyMy00ZTQxLWE3NDYtNDE2NmE4NzZhMjkz",
            "name": "Vanilla extract",
            "nutrients": [
              {
                "type": "CALCIUM_CA",
                "amount": 11,
                "name": "Calcium, Ca",
                "unit": "MG"
              },
              {
                "type": "POTASSIUM_K",
                "amount": 148,
                "name": "Potassium, K",
                "unit": "MG"
              },
              {
                "type": "ZINC_ZN",
                "amount": 0.11,
                "name": "Zinc, Zn",
                "unit": "MG"
              },
              {
                "type": "NIACIN",
                "amount": 0.425,
                "name": "Niacin",
                "unit": "MG"
              },
              {
                "type": "PANTOTHENIC_ACID",
                "amount": 0.035,
                "name": "Pantothenic acid",
                "unit": "MG"
              },
              {
                "type": "VITAMIN_B_6",
                "amount": 0.026,
                "name": "Vitamin B-6",
                "unit": "MG"
              },
              {
                "type": "FAT",
                "amount": 0.06,
                "name": "Total lipid (fat)",
                "unit": "G"
              },
              {
                "type": "CARBS",
                "amount": 12.65,
                "name": "Carbohydrate, by difference",
                "unit": "G"
              },
              {
                "type": "ENERGY",
                "amount": 288,
                "name": "Energy",
                "unit": "KCAL"
              },
              {
                "type": "WATER",
                "amount": 52.58,
                "name": "Water",
                "unit": "G"
              },
              {
                "type": "PROTEIN",
                "amount": 0.06,
                "name": "Protein",
                "unit": "G"
              },
              {
                "type": "ASH",
                "amount": 0.26,
                "name": "Ash",
                "unit": "G"
              },
              {
                "type": "ALCOHOL_ETHYL",
                "amount": 34.4,
                "name": "Alcohol, ethyl",
                "unit": "G"
              },
              {
                "type": "FIBER_TOTAL_DIETARY",
                "amount": 0,
                "name": "Fiber, total dietary",
                "unit": "G"
              },
              {
                "type": "IRON_FE",
                "amount": 0.12,
                "name": "Iron, Fe",
                "unit": "MG"
              },
              {
                "type": "MAGNESIUM",
                "amount": 12,
                "name": "Magnesium, Mg",
                "unit": "MG"
              },
              {
                "type": "PHOSPHORUS_P",
                "amount": 6,
                "name": "Phosphorus, P",
                "unit": "MG"
              },
              {
                "type": "SODIUM_NA",
                "amount": 9,
                "name": "Sodium, Na",
                "unit": "MG"
              },
              {
                "type": "COPPER_CU",
                "amount": 0.072,
                "name": "Copper, Cu",
                "unit": "MG"
              },
              {
                "type": "MANGANESE_MN",
                "amount": 0.23,
                "name": "Manganese, Mn",
                "unit": "MG"
              },
              {
                "type": "VITAMIN_A_IU",
                "amount": 0,
                "name": "Vitamin A, IU",
                "unit": "IU"
              },
              {
                "type": "DHA",
                "amount": 0,
                "name": "22:6 n-3 (DHA)",
                "unit": "G"
              },
              {
                "type": "EPA",
                "amount": 0,
                "name": "20:5 n-3 (EPA)",
                "unit": "G"
              },
              {
                "type": "DPA",
                "amount": 0,
                "name": "22:5 n-3 (DPA)",
                "unit": "G"
              }
            ]
          }
        }
      ]
    }
  }
}

FoodID to copy --> Q29tbW9uRm9vZE5vZGU6YzYwZDljOWYtM2IyMy00ZTQxLWE3NDYtNDE2NmE4NzZhMjkz

STEP 2: Create a specific food

In case you need to create a specific food, execute the createMyCommonFoods or createMyBrandedFoods. In the example below, we will create the "Vegan vanilla ice cream" common food:

mutation createMyCommonFoods {
  createMyCommonFoods(
    input: {
      name: "Vegan vanilla ice cream"
      description: "vegan vanilla ice cream"
      nutrients: [
        { amount: 124, unit: "MG", nutrient: SODIUM_NA }
        { amount: 124, unit: "MG", nutrient: POTASSIUM_K }
      ]
      portions: [{ amount: 45.33, unit: "G", gramWeight: 1 }]
    }
  ) {
    success
    message
  }
}
STEP 3: Find your created foods

Find the foods to include in your recipe. Execute the myCommonFoods or myBrandedFoods queries to find them. In the case of this example, use the myCommonFoods to find your already created ingredient which is the "Vegan vanilla ice cream".

Request:

{
  myCommonFoods {
    edges {
      node {
        id
        name
        nutrients{
          name
          type
          unit
          amount
        }
      }
    }
  }
}

Response:

{
  "data": {
    "myCommonFoods": {
      "edges": [
        {
          "node": {
            "id": "TXlDb21tb25Gb29kOjNpR2RjSUFCYjREdGhOVmFDQWpI",
            "name": "Vegan vanilla ice cream",
            "nutrients": [
              {
                "name": "Sodium, Na",
                "type": "SODIUM_NA",
                "unit": "MG",
                "amount": 124
              },
              {
                "name": "Potassium, K",
                "type": "POTASSIUM_K",
                "unit": "MG",
                "amount": 124
              }
            ]
          }
        },
      ]
    }
  }
}

From the response, copy the FoodId -> TXlDb21tb25Gb29kOjNpR2RjSUFCYjREdGhOVmFDQWpI

Each ID is different so make sure to copy the Id retrieved in your query response.

Use this query as many times as necessary until you find all the foods the recipe is required to have. See step 2 in case you need to create your food.

STEP 4: Create your own recipe

Use the Food IDs created previously to create your own recipe:

Request:

mutation createMyRecipe {
  createMyRecipe(
    input: {
      name: "Vegan Milkshake"
      tags: ["Vegan", "Snack"]
      ingredientLines: ["Almond Milk", "Vegan vanilla ice cream"]
      ingredients: [
        { foodId: "TXlDb21tb25Gb29kOjNpR2RjSUFCYjREdGhOVmFDQWpI", grams: 10},
        { foodId: "Q29tbW9uRm9vZE5vZGU6YzYwZDljOWYtM2IyMy00ZTQxLWE3NDYtNDE2NmE4NzZhMjkz", grams: 120}
      ]
      numberOfServings: 1
      mealTimes: [BREAKFAST, SNACK]
      courses: "Snack"
      instructions: "Put all ingredients on Blender"
    }
  ) {
    success
    message
     recipe { id name }
  }
}

Response:

{
  "data": {
    "createMyRecipe": {
      "success": true,
      "message": "My recipe has been saved",
      "recipe": {
        "id": "VXNlclJlY2lwZTpQeDFSZTN3QlY0Q1V6aWdSV2VqcQ==",
        "name": "Vegan Milkshake"
      }
    }
  }
}

Copy the "ID" retrieved from the recipe created to log the meal.

STEP 5: Log your meal

Finally, log the meal based on your own recipe created:

Request:

mutation {
  addFoodLog (date:"2021-10-02", 
  foodId: "VXNlclJlY2lwZTpQeDFSZTN3QlY0Q1V6aWdSV2VqcQ==", 
  mealTime:SNACK,
  servings:2,)
    {
      success
      message
    }
  }

Response:

{
  "data": {
    "addFoodLog": {
      "success": true,
      "message": "Food log saved"
    }
  }
}

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

Optional: If you cannot get the "ID", you can execute the query to get it.

graphqlbin
myRecipes
commonFoods
createMyCommonFoods
createMyBrandedFoods
myCommonFoods
MyBrandedFoods
createMyRecipe
myRecipes
createMealLog
brandedFoods