> 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/queries/wellness-plans/supplement-plan-list.md).

# Supplement  plan list

Use the `supplementPlans` query to get all supplement plans assigned to an user.

### Arguments

| Argument | Type   | Description                                                                                            |
| -------- | ------ | ------------------------------------------------------------------------------------------------------ |
| `id`     | ID     | Supplement plan Id.                                                                                    |
| `first`  | Int    | Retrieves the first results from the list.                                                             |
| `last`   | Int    | Retrieves the last results from the list.                                                              |
| `after`  | String | See [pagination](https://docs.suggestic.com/graphql/start-here/tutorials-and-walkthroughs/pagination). |
| `before` | String | See [pagination](https://docs.suggestic.com/graphql/start-here/tutorials-and-walkthroughs/pagination). |

### Available fields

| Field                                   | Type                      | Description                                                                         |
| --------------------------------------- | ------------------------- | ----------------------------------------------------------------------------------- |
| `name`                                  | String                    | Supplement plan name.                                                               |
| `isActive`                              | Boolean                   | ***True*** sets the supplement plan active for the user, otherwise ***False***.     |
| `visibility`                            | Boolean                   | ***True*** makes the supplement plan visible for the user, otherwise ***False***.   |
| `coach`                                 | ID                        | Id of Coach.                                                                        |
| `startDate`                             | Date                      | Sets the starting date for the supplement plan. `YYYY-MM-DD`                        |
| `createdAt`                             | DateTime                  | Supplement plan creation date. `YYYY-MM-DDT hh:mm:ssZ`                              |
| `nutrition`                             | String                    | Open text field.                                                                    |
| `resources`                             | String                    | Open text field.                                                                    |
| `overview`                              | String                    | Open text field.                                                                    |
| `exercise`                              | String                    | Open text field.                                                                    |
| `supplements`                           | \[Supplements]            | Supplement or list of supplements. (Refer to example below)                         |
| `supplements.supplementId`              | ID                        | Id of supplement.                                                                   |
| `supplements.length`                    | Int                       | Length duration of supplement, measured in days.                                    |
| `supplements.directionsOfUse`           | SupplementDirection       | Direction of use for supplement.                                                    |
| `supplements.directionsOfUse.quantity`  | Float                     | Supplement quantity.                                                                |
| `supplements.directionsOfUse.timeOfDay` | TimeOfDay                 | enum TimeOfDay { AT\_BEDTIME AT\_WAKING WITH\_BREAKFAST WITH\_DINNER WITH\_LUNCH }. |
| `supplements.<DAYOFWEEK>`               | Boolean                   | Can be any day of the week ex. `sunday: true`                                       |
| `protocols`                             | \[SupplementPlanProtocol] | Protocol or list of protocols. (Refer to example below)                             |
| `protocols.protocolId`                  | ID                        | Id of Protocol.                                                                     |
| `protocols.isActive`                    | Boolean                   | ***True*** sets the protocol active for the user, otherwise ***False***.            |
| `protocols.directionsOfUse`             | SupplementDirection       | Direction of use for protocol.                                                      |
| `protocols.directionsOfUse.quantity`    | Float                     | Protocol quantity.                                                                  |
| `protocols.directionsOfUse.timeOfDay`   | TimeOfDay                 | enum TimeOfDay { AT\_BEDTIME AT\_WAKING WITH\_BREAKFAST WITH\_DINNER WITH\_LUNCH }. |
| `protocols.<DAYOFWEEK>`                 | Boolean                   | Can be any day of the week ex. `sunday: true`                                       |

### Example

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

```graphql
query {
  supplementPlans {
    edges {
      node {
        name
        id
        isActive
        exercise
        createdAt
        nutrition
        overview
        resources
        startDate
        updatedAt
        visibility
        Protocols: protocols {
          id
          isActive
          protocol {
            id
            name
            supplementProtocols {
              supplement {
                name
                id
              }
            }
          }
        }
        singleSupplements: protocols(group: SINGLE_SUPPLEMENT) {
          id
          isActive
          protocol {
            id
            name
            supplementProtocols {
              supplement {
                name
                id
              }
            }
          }
        }
      }
    }
  }
}
```

{% endtab %}

{% tab title="Response" %}

```graphql
{
  "data": {
    "supplementPlans": {
      "edges": [
        {
          "node": {
            "name": "Suggestic Plan",
            "id": "U3VwcGxlbWVudFBsYW46MTY2NTc1",
            "isActive": true,
            "exercise": "Placeholder Text",
            "createdAt": "2024-06-26T22:40:14.775549+00:00",
            "nutrition": "Placeholder Text",
            "overview": "Placeholder Text",
            "resources": "Placeholder Text",
            "startDate": "2024-06-01",
            "updatedAt": "2024-06-26T23:40:35.304339+00:00",
            "visibility": true,
            "Protocols": [
              {
                "id": "U3VwcGxlbWVudFBsYW5Qcm90b2NvbDo1NjEwMjI=",
                "isActive": true,
                "protocol": {
                  "id": "UHJvdG9jb2w6MzA1NTc0",
                  "name": "Suggestic Protocol",
                  "supplementProtocols": [
                    {
                      "supplement": {
                        "name": "Suplement in protocol 1",
                        "id": "U3VwcGxlbWVudDplYjRkZjM4NS1iM2JlLTRlNjQtYjMyZC1lZDFhNmEyOWRmZWY="
                      }
                    },
                    {
                      "supplement": {
                        "name": "Suplement in protocol 2",
                        "id": "U3VwcGxlbWVudDpjYTQ0NWE0Ni1iYTY1LTQ4MDEtODcwZC01M2RmNjQ4MDJhNDY="
                      }
                    }
                  ]
                }
              }
            ],
            "singleSupplements": [
              {
                "id": "U3VwcGxlbWVudFBsYW5Qcm90b2NvbDo1NjEwMjM=",
                "isActive": true,
                "protocol": {
                  "id": "UHJvdG9jb2w6MzA1NjIz",
                  "name": "Single supplement 1",
                  "supplementProtocols": [
                    {
                      "supplement": {
                        "name": "Single supplement 1",
                        "id": "U3VwcGxlbWVudDoxZjNhZjAzYi01ZWQzLTQ0ZTUtYTE4MS03NTAwOWVlNmI1NjE="
                      }
                    }
                  ]
                }
              },
              {
                "id": "U3VwcGxlbWVudFBsYW5Qcm90b2NvbDo1NjEwMjQ=",
                "isActive": true,
                "protocol": {
                  "id": "UHJvdG9jb2w6MzA1NjI0",
                  "name": "Single supplement 2",
                  "supplementProtocols": [
                    {
                      "supplement": {
                        "name": "Single supplement 2",
                        "id": "U3VwcGxlbWVudDpjYzI1YzZkNC0wNzYwLTRmNzItYTU4MS0xYmJhZmViYWY3Zjg="
                      }
                    }
                  ]
                }
              }
            ]
          }
        }
      ]
    }
  }
}
```

{% endtab %}
{% endtabs %}
