Macro Goals

Use the macroGoals query to obtain the total sum of macros logged for a particular date, the user's macronutrient goals (if goals are active), and the amount left.

Requirements

  • Execute the updateMealPlanSettings mutation to set the user's basic information, i.e: weight, height, age, etc.

Consideration

If the user updates their daily caloric intake by using the meal plan settings, profileMealPlanSettings, the counted calories will be the ones the user or the application set by using that mutation.

Required Argument

Argument

Type

Description

Date

Date!

Date to obtain the sum of macros logged

Available Fields

Field

Type

Note

name

ID

ID of the program. Use the programs mutation to get the program ID.

bmr

Int

Basal Metabolic Rate

Int

Body Mass Index calculated from user's weight and height values.

tdee

Int

Totaly Daily Energy Expenditure

cd

Int

Caloric Deficit

dcig

Int

Daily Caloric Intake Goal

isUserGoal

Boolean

True if this is the user's goal. Otherwise, it will be False

carbs

MacroNutrientGoal

An object that contains predefined macronutrient goals

fat

MacroNutrientGoal

An object that contains predefined macronutrient goals

protein

MacroNutrientGoal

An object that contains predefined macronutrient goals

netcarbs

MacroNutrientGoal

An object that contains predefined macronutrient goals

MacroNutrientGoal

It includes the following objects:

  • carbs

  • fat

  • protein

  • netcarbs

Find the available fields for these objects:

Available fields

Field name

Type

Description

goal

String

Goal's user expressed in grams

logged

Int

The quantity of food the user has been intaken. This information is extracted while the user logs the food intake. This information is expressed in grams.

left

Int

The amount left, expressed in grams, to reach the goal.

color

String

White: There are missing macros to reach the goal.

Green: The goal has been reached.

Red: The goal has been exceeded.

Example

The following example retrieves the user macro goals information for a given date.

{
  macroGoals(date: "2021-07-09") {
    name
    bmr
    bmi
    tdee
    cd
    dcig
    isUserGoal
    carbs {
      goal
      logged
      left
      color
      upperLimit
      lowerLimit
    }
    fat {
      goal
      logged
      left
      color
      upperLimit
      lowerLimit
    }
 
    netcarbs {
      goal
      logged
      left
      color
      upperLimit
      lowerLimit
    }
    protein {
      goal
      logged
      left
      color
      upperLimit
      lowerLimit
    }
  }
}

The macro goals are also displayed within the Suggestic's app:

Last updated