> 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/wellness-plans/update-supplement.md).

# Update Supplement

Use `updateSupplement` to update a supplement by `Id`.

## Required Arguments

| Argument                    | Type                    | Description                                                                        |
| --------------------------- | ----------------------- | ---------------------------------------------------------------------------------- |
| `id`                        | ID!                     | Supplement Id.                                                                     |
| `brand`                     | String                  | Supplement brand.                                                                  |
| `name`                      | String                  | Supplement name.                                                                   |
| `servingName`               | String                  | Supplement serving name ex: Capsule, scoop, etc.                                   |
| `category`                  | String                  | Supplement category.                                                               |
| `directionsOfUse`           | \[DirectionsOfUseInput] |                                                                                    |
| `directionsOfUse.timeOfDay` | TimeOfDay               | enum TimeOfDay { AT\_BEDTIME AT\_WAKING WITH\_BREAKFAST WITH\_DINNER WITH\_LUNCH } |
| `directionsOfUse.quantity`  | Float                   | Recommended dosage.                                                                |
| `mainImage`                 | String                  | Main image URL.                                                                    |
| `description`               | String                  | Supplement description.                                                            |
| `directionsOfUseText`       | String                  | Recommended use instructions.                                                      |
| `externalId`                | String                  | External Id.                                                                       |
| `images`                    | \[String]               | Supplement images.                                                                 |
| `ingredients`               | String                  | Supplement ingredients.                                                            |
| `instructions`              | String                  | Supplement instructions.                                                           |
| `shopifyParentId`           | String                  | Shopify parent Id.                                                                 |
| `shopifyVariantId`          | String                  | Shopify variant Id.                                                                |
| `sizeCount`                 | Int                     | Supplement size.                                                                   |
| `sku`                       | String                  | SKU                                                                                |
| `storeId`                   | String                  | Store Id.                                                                          |
| `supplementFacts`           | String                  | Supplement Facts.                                                                  |
| `productUrl`                | String                  | URL of the supplement.                                                             |

## Example

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

```graphql
mutation($input: UpdateSupplementInput!) {
            updateSupplement(input: $input) {
                success message
                supplement {
                    name category mainImage brand servingName description
                    directionsOfUseText sizeCount externalId sku storeId
                    shopifyVariantId shopifyParentId instructions ingredients 
                    supplementFacts images 
                    directionsOfUse { id quantity timeOfDay }
                }
            }
        }
```

{% endtab %}

{% tab title="Response" %}

```graphql
{
  "data": {
    "updateSupplement": {
      "success": true,
      "message": "Supplement updated",
      "supplement": {
        "name": "Supp G Test",
        "category": "Generic",
        "mainImage": "https://static.wikia.nocookie.net/warner-bros-entertainment/images/6/6e/Acme-corp.png/revision/latest?cb=20180619032346",
        "brand": "ACME",
        "servingName": "Capsule",
        "description": null,
        "directionsOfUseText": null,
        "sizeCount": 0,
        "externalId": null,
        "sku": null,
        "storeId": null,
        "shopifyVariantId": null,
        "shopifyParentId": null,
        "instructions": null,
        "ingredients": null,
        "supplementFacts": null,
        "images": [],
        "directionsOfUse": [
          {
            "id": "U3VwcGxlbWVudERpcmVjdGlvbjoxNzUzMzQ=",
            "quantity": 1,
            "timeOfDay": "WITH_BREAKFAST"
          }
        ]
      }
    }
  }
}
```

{% endtab %}
{% endtabs %}

#### Query Input Variables

```json
{
    "input": {
    "id": "U3VwcGxlbWVudDpkMzAxNmM4Ni1kNGVmLTRiYjAtODk0OS0xYWNiZmFmNzY5YjE=",
		"name": "Supp G Test",
		"directionsOfUse": [{
			"timeOfDay": "WITH_BREAKFAST",
			"quantity": 1
		}]
	}
}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.suggestic.com/graphql/query/mutations/wellness-plans/update-supplement.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
