Update Meal Plan Settings

Use the updateMealPlanSettings mutation to update or overwrite the user's meal plan settings. All the arguments to be sent are optional; however, it will update only the arguments sent in the mutation. The information is saved and it can be later requested by executing the mealPlan query.

Required Arguments

Name

Type

Description

update

Object

Update the values added to it. For example, update: { calories: 1600, protein: 20 }

ovewrite

Object

Overwrite only the values added to it. The ones that were not added will be set as null. For example: overwrite: { format: [BREAKFAST, LUNCH, DINNER] }

If the update and overwrite arguments are defined at the same time, the overwrite argument will be the one applied.

Available Arguments

Use the following arguments within the update and overwrite objects:

Arguments

Type

Description

calories

Int

Total Calories per day. If using the overwrite and no calories value is defined, the default value is set to 1400.

carbs

Int

Percent of Carbs

fat

Int

Percent of Fat

format

MealTime!

Requested meals per day format. Available options: BREAKFAST, SNACK, LUNCH, DINNER.

The list cannot have a null value, i.e, [BREAKFAST, null]. However, it is possible to send the list in the following formats:

  • format: null

  • format: []

  • Not send a format

If not format is sent, the following format is set as default: [BREAKFAST, SNACK, LUNCH, DINNER]

omega3

Float

Percent of Omega 3.

protein

Int

Percent of Protein

Example

The following example updates the protein and calories values:

mutation updateMealPlanSettings {
  updateMealPlanSettings(
    update: { calories: 1600, protein: 20 }
  ) {
    success
    message
  }
}

The following example updates the meal format and sets automatically the rest of arguments not send as null:

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

The following example uses query variables and updates the calories and proteins values:

mutation($update: UpdateMPSettingsInput, $overwrite: UpdateMPSettingsInput) {
  updateMealPlanSettings(update: $update, overwrite: $overwrite) {
    success
    message
  }
}
{
  "overwrite": {"calories": 1600, "protein": 20}
}

Last updated