# Swap Meals

Use the `swapMealPlanRecipe` mutation to replace a recipe in an existing [Meal Plan](https://docs.suggestic.com/graphql/query/queries/meal-plan/meal-plan-1). &#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 %}
