# Swap Meals

Use the `swapMealPlanRecipe` mutation to replace a recipe in an existing [Meal Plan](/graphql/query/queries/meal-plan/meal-plan-1.md). &#x20;

Replace a single recipe on a specific day and meal by using the `mealId` argument or replace all recipes for every day of the meal plan for a specific meal by using the `mealTag` argument.

### Available Arguments

| **Arguments** | **Type**     | **Is required?** | **Description**                                 |
| ------------- | ------------ | ---------------- | ----------------------------------------------- |
| `recipeId`    | ID           | Yes              | The new recipe ID                               |
| `mealId`      | ID           | No               | The meal ID (from the meal plan) to be replaced |
| `servings`    | Int          | No               | Number of servings to be changed.               |
| `mealTag`     | MealTimeType | No               | BREAKFAST, SNACK, LUNCH, DINNER                 |
|               |              |                  |                                                 |

{% hint style="info" %}
This mutation is commonly used in combination with the [SimilarMacrosRecipe](https://docs.suggestic.com/graphql/query/queries/similar-macros-recipes) query to replace existing recipes with equivalents.
{% endhint %}

### Example

{% tabs %}
{% tab title="Mutation" %}

```graphql
mutation {
  swapMealPlanRecipe(
    recipeId: "UmVjaXBlOjA3ZjUxZDM5LTgyMGYtNGU4NS1iNjQzLWUxYTEwNTdjMWI4MQ=="
    mealId: "TWVhbDoxNjMzMw=="
    serving: 2
  ) {
    success
  }
}
```

{% endtab %}

{% tab title="Response" %}

```javascript
{
  "data": {
    "swapMealPlanRecipe": {
      "success": true
    }
  }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.suggestic.com/graphql/query/mutations/meal-plan/swap-meals.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
