# Weight Tracker

Use the `weightTracker` query to list all the weight entries for the desired date range along with the tendency of them.

### **Required Arguments**

<table data-header-hidden><thead><tr><th width="201.33333333333331">Argument</th><th>Type</th><th width="271.7804878048781">Note</th></tr></thead><tbody><tr><td>Argument</td><td>Type</td><td>Note</td></tr><tr><td><code>startDate</code></td><td>Date!</td><td>The starting date for the date range. Use the format: <code>YYYY-MM-DD</code></td></tr><tr><td><code>endDate</code></td><td>Date!</td><td>The end date for the date range. Use the format: <code>YYYY-MM-DD</code></td></tr><tr><td><code>source</code></td><td>String</td><td>Source of input, <strong>default</strong> is set to <strong>suggestic</strong>. enum SourceType { APPLE FITBIT GARMIN GOOGLEFIT_NATIVE GOOGLEFIT_REST HUAWEIHEALTH IHEALTH MISFIT OMRONCONNECT OMRONWELLNESS OURA POLAR SAMSUNG STRAVA SUGGESTIC SUUNTO WITHINGS }</td></tr></tbody></table>

### **Available Fields**

| Field        | Type         | Note                                                                                                                                                                                                                                       |
| ------------ | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `date`       | Boolean      | **true:** If the entry has been created successfully. Otherwise, it displays **false**                                                                                                                                                     |
| `createdAt`  | String       | The message returns either if the information has been updated or not.                                                                                                                                                                     |
| `value`      | PositiveInt! | Weight in kilos.                                                                                                                                                                                                                           |
| `source`     | SourceType   | Source of input, **default** is set to **suggestic**. enum SourceType { APPLE FITBIT GARMIN GOOGLEFIT\_NATIVE GOOGLEFIT\_REST HUAWEIHEALTH IHEALTH MISFIT OMRONCONNECT OMRONWELLNESS OURA POLAR SAMSUNG STRAVA SUGGESTIC SUUNTO WITHINGS } |
| `type`       | TendencyType | <p><br>"UP" If the tendency is adding weight. "DOWN" if the tendency is lowering weight.<br>enum TendencyType { DOWN, UP }</p>                                                                                                             |
| `difference` | Float        | Weight difference from starting point vs latest weight entry.                                                                                                                                                                              |

### Example <a href="#example" id="example"></a>

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

```graphql
query { weightTracker (startDate:"2023-03-11" endDate:"2023-03-14" source: SUGGESTIC){
  entries{
    date
    createdAt
    value
    source
  }
  tendency{
    type
    difference
  }
}}
```

{% endtab %}

{% tab title="Response" %}

```graphql
{
  "data": {
    "createWeightEntry": {
{
  "data": {
    "weightTracker": {
      "entries": [
        {
          "date": "2023-03-11",
          "createdAt": "2024-02-06T19:47:26Z",
          "value": 99.15,
          "source": "SUGGESTIC"
        },
        {
          "date": "2023-03-12",
          "createdAt": "2024-02-06T19:47:37Z",
          "value": 100,
          "source": "SUGGESTIC"
        },
        {
          "date": "2023-03-13",
          "createdAt": "2024-02-06T19:47:47Z",
          "value": 88,
          "source": "SUGGESTIC"
        },
        {
          "date": "2023-03-14",
          "createdAt": "2024-02-06T19:48:01Z",
          "value": 87.2,
          "source": "SUGGESTIC"
        }
      ],
      "tendency": {
        "type": "DOWN",
        "difference": -11.950000000000003
      }
    }
  }
}
```

{% endtab %}
{% endtabs %}
