> For the complete documentation index, see [llms.txt](https://docs.suggestic.com/graphql/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.suggestic.com/graphql/query/mutations/meal-plan/remove-meal-plan-recipe.md).

# Remove Meal Plan Recipe

Use the `removeMealPlanRecipe` mutation to remove a recipe that is associated with a meal plan. Remove either current or past recipes of any day. Note that the user does not remove the `mealId`; for instance, if the user has a Breakfast meal with an associated recipe, this is removed, and the `numOfServings`, `calories`, and `maxNumOfServings` fields values are `0`; however, Breakfast meal as it is will still be listing.

### Required Argument

| Argument | Type | Description                                                                                                                                                                  |
| -------- | ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `mealId` | ID!  | Unique meal ID of the recipe associated with a meal plan. Use the [`mealPlan`](https://docs.suggestic.com/graphql/query/queries/meal-plan/meal-plan-1) query to get this Id. |

### Available Fields

| Field name | Type    | Description                                                                 |
| ---------- | ------- | --------------------------------------------------------------------------- |
| `success`  | Boolean | **True** if the meal has been removed. Otherwise, it will display **False** |
| `message`  | String  | Description of the result                                                   |

## Examples

### Remove a recipe by a given `mealId`

#### GraphQL Example

Get the `mealId` from the `mealPlan` query. From the following results the Breakfast `mealId` \
(`WVhbDoxNTAzNDIx`) from day 7 is chosen:

{% tabs %}
{% tab title="mealPlan Response" %}

```graphql
{
  "data": {
    "mealPlan": [
      {
        "day": 7,
        "date": "2021-10-12",
        "calories": 2465.42128283024,
        "meals": [
          {
            "id": "TWVhbDoxNTAzNDIx",
            "calories": 746.217929894105,
            "meal": "breakfast",
            "numOfServings": 1,
            "recipe": {
              "name": "Bircher Muesli",
              "numberOfServings": 1,
              "nutrientsPerServing": {
                "calories": 746.22
              }
            }
          },
          {
            "id": "TWVhbDoxNTAzNDIy",
            "calories": 1115.6275848875,
            "meal": "lunch",
            "numOfServings": 2,
            "recipe": {
              "name": "Pistachio Pesto Recipes",
              "numberOfServings": 4,
              "nutrientsPerServing": {
                "calories": 557.81
              }
            }
          }
            }
          }
        ]
      }
        ]
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

Replace that `id` in the mutation argument:

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

```graphql

mutation removeMealPlanRecipe {
    removeMealPlanRecipe(mealId: "TWVhbDoxNTAzNDIx")
  {
    success
    message
  }
}

```

{% endtab %}

{% tab title="Response" %}

```graphql
{
  "data": {
    "removeMealPlanRecipe": {
      "success": true,
      "message": "Meal was successfully removed"
    }
  }
}
```

{% endtab %}
{% endtabs %}

Once the meal is successfully removed, execute the meal plan query once more. The results will show a *null* value in the recipe. The rest of the field values related to the meal appear as `0`.

{% tabs %}
{% tab title="mealPlan Response" %}

```graphql
{
  "data": {
    "mealPlan": [
      {
        "day": 7,
        "date": "2021-10-12",
        "calories": 2465.42128283024,
        "meals": [
          {
            "id": "TWVhbDoxNTAzNDIx",
            "calories": 0,
            "meal": "breakfast",
            "numOfServings": 0,
            "recipe": null
          },
          {
            "id": "TWVhbDoxNTAzNDIy",
            "calories": 1115.6275848875,
            "meal": "lunch",
            "numOfServings": 2,
            "recipe": {
              "name": "Pistachio Pesto Recipes",
              "numberOfServings": 4,
              "nutrientsPerServing": {
                "calories": 557.81
              }
            }
          }
            }
          }
        ]
      }
        ]
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

#### cURL Example

{% tabs %}
{% tab title="cURL example" %}

```java
curl -XPOST 'https://production.suggestic.com/graphql' \
  -H 'Authorization: Bearer <User-JWT>' \
  -H 'Content-Type: application/json' \
  --data-raw { "query": "mutation removeMealPlanRecipe{removeMealPlanRecipe(mealId: \"TWVhbDoxNTAzNTgx\"){ success message } }"
```

{% endtab %}

{% tab title="Response" %}

```graphql
{
    "data": {
        "removeMealPlanRecipe": {
            "success": true,
            "message": "Meal was successfully removed"
        }
    }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.suggestic.com/graphql/query/mutations/meal-plan/remove-meal-plan-recipe.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
