# Micronutrients Aggregation

The `nutrientAggregationsByFoodLog` query returns a list of aggregated micronutrients for the given date ranges, **not grouped by date.** I.e. the sum of calcium in grams consumed in the past 5 days.

{% hint style="warning" %}
The calculations made before logging a meal must be on the user's side.
{% endhint %}

### Required Arguments

| Argument   | Type  | Required |
| ---------- | ----- | -------- |
| `fromDate` | Date! | true     |
| `toDate`   | Date! | true     |

### Available Fields

| Nutrient             | Description          | Unit |
| -------------------- | -------------------- | ---- |
| `chocdf (carbs)`     | Carbs                | G    |
| `fat`                | Fat                  | G    |
| `procnt (protein)`   | Protein              | G    |
| `sugar`              | Sugar                | G    |
| `netcarbs`           | Net Carbs            | G    |
| `calcium`            | Calcium              | MG   |
| `chromium`           | Chromium             | UG   |
| `copper`             | Copper               | MG   |
| `fluoride`           | Fluoride             | UG   |
| `iodine`             | Iodine               | G    |
| `iron`               | Iron                 | MG   |
| `magnesium`          | Magnesium            | MG   |
| `manganese`          | Manganese            | MG   |
| `molybdenum`         | Molybdenum           | UG   |
| `phosphorus`         | Phosphorus           | MG   |
| `selenium`           | Selenium             | UG   |
| `zinc`               | Zinc                 | MG   |
| `potassium`          | Potassium            | MG   |
| `sodium`             | Sodium               | MG   |
| `chloride`           | Chloride             |      |
| `vitamina`           | Vitamin A            | IU   |
| `vitaminc`           | Vitamin C            | MG   |
| `vitamind`           | Vitamin D            | UG   |
| `vitamine`           | Vitamin E            | MG   |
| `vitamink`           | Vitamin K            | UG   |
| `thiamin`            | Thiamin              | MG   |
| `riboflavin`         | Riboflavin           | MG   |
| `niacin`             | Niacin               | MG   |
| `vitaminb6`          | Vitamin B6           | MG   |
| `folate`             | Folate               | UG   |
| `vitaminb12`         | Vitamin B12          | UG   |
| `pantothenicacid`    | Phanothenic Acid     | MG   |
| `biotin`             | Biotin               | UG   |
| `choline`            | Choline              | MG   |
| `totalfiber`         | Total Fiber          | G    |
| `linoleicacid`       | Linoleic Acid        |      |
| `alphaLinolenicacid` | Alpha Linolenic Acid |      |

### Example

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

```graphql
{
    nutrientAggregationsByFoodLog(fromDate: "2023-09-28" toDate: "2023-09-29") {
        chocdf {
          value
          goal
        }
         procnt {
          value
          goal
        }
        fat {
          value
          goal
        }
        netcarbs {
          value
          goal
        }
        calcium {
          value
          goal
        }
        chromium {
          value
          goal
        }
        copper{
          value
          goal
        }
        fluoride {
          value
          goal
        }
        iodine {
          value
          goal
        }
        iron {
          value
          goal
        }
        magnesium {
          value
          goal
        }
        manganese {
          value
          goal
        }
         molybdenum {
          value
          goal
        }
        phosphorus {
          value
          goal
        }
        selenium {
          value
          goal
        }
        zinc {
          value
          goal
        }
        potassium {
          value
          goal
        }
        sodium {
          value
          goal
        }
        chloride {
          value
          goal
        }
        vitamina {
          value
          goal
        }
        vitaminc {
          value
          goal
        }
        vitamind {
          value
          goal
        }
        vitamine {
          value
          goal
        }
        vitamink {
          value
          goal
        }
        thiamin {
          value
          goal
        }
        riboflavin {
          value
          goal
        }
        niacin{
          value
          goal
        } 
        vitaminb6{
          value
          goal
        } 
        folate{
          value
          goal
        } 
        vitaminb12{
          value
          goal
        } 
        pantothenicacid{
          value
          goal
        } 
        biotin{
          value
          goal
        } 
        choline{
          value
          goal
        } 
        totalfiber{
          value
          goal
        } 
        linoleicacid{
          value
          goal
        } 	
        alphaLinolenicacid{
          value
          goal
        }
    }
}
```

{% endtab %}

{% tab title="Response" %}

```graphql
{
  "data": {
    "nutrientAggregationsByFoodLog": {
      "chocdf": {
        "value": 27,
        "goal": 30
      },
      "procnt": {
        "value": 35,
        "goal": 40
      },
      "fat": {
        "value": 17,
        "goal": 30
      },
      "netcarbs": {
        "value": 4,
        "goal": 0
      },
      "calcium": {
        "value": 1,
        "goal": null
      },
      "chromium": {
        "value": 0,
        "goal": null
      },
      "copper": {
        "value": 0,
        "goal": null
      },
      "fluoride": {
        "value": 0,
        "goal": null
      },
      "iodine": {
        "value": 0,
        "goal": null
      },
      "iron": {
        "value": 0,
        "goal": null
      },
      "magnesium": {
        "value": 0,
        "goal": null
      },
      "manganese": {
        "value": 0,
        "goal": null
      },
      "molybdenum": {
        "value": 0,
        "goal": null
      },
      "phosphorus": {
        "value": 0,
        "goal": null
      },
      "selenium": {
        "value": 0,
        "goal": null
      },
      "zinc": {
        "value": 0,
        "goal": null
      },
      "potassium": {
        "value": 0,
        "goal": null
      },
      "sodium": {
        "value": 0,
        "goal": null
      },
      "chloride": {
        "value": 0,
        "goal": null
      },
      "vitamina": {
        "value": 0,
        "goal": null
      },
      "vitaminc": {
        "value": 0,
        "goal": null
      },
      "vitamind": {
        "value": 0,
        "goal": null
      },
      "vitamine": {
        "value": 0,
        "goal": null
      },
      "vitamink": {
        "value": 0,
        "goal": null
      },
      "thiamin": {
        "value": 0,
        "goal": null
      },
      "riboflavin": {
        "value": 0,
        "goal": null
      },
      "niacin": {
        "value": 0,
        "goal": null
      },
      "vitaminb6": {
        "value": 0,
        "goal": null
      },
      "folate": {
        "value": 0,
        "goal": null
      },
      "vitaminb12": {
        "value": 0,
        "goal": null
      },
      "pantothenicacid": {
        "value": 0,
        "goal": null
      },
      "biotin": {
        "value": 0,
        "goal": null
      },
      "choline": {
        "value": 0,
        "goal": null
      },
      "totalfiber": {
        "value": 0,
        "goal": null
      },
      "linoleicacid": {
        "value": 0,
        "goal": null
      },
      "alphaLinolenicacid": {
        "value": 0,
        "goal": null
      }
    }
  }
}
```

{% 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/queries/food-log/macros-log-aggregation-1.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.
