# Create User Goal

Use the `createUserTracker` mutation to set personalized goals for the user across all available trackers.

### **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>tracker</code></td><td>TrackerComponent!</td><td><p>All trackers available in Suggestic.</p><p><br>enum TrackerComponent {<br>BLOOD_PRESSURE_TRACKER<br>DAILY_MOOD<br>DAILY_RECAP<br>EXERCISE_TRACKER<br>FOOD_LOGS<br>FOOD_LOG_MEAL_TRACKER<br>HEART_RATE_TRACKER<br>HRV_TRACKER<br>HYDRATION_TRACKER<br>MP_MEAL_TRACKER<br>MY_CHECKLIST_TRACKER<br>PLAN_SUPPLEMENT<br>PLAN_SUPPLEMENTS_MY_CHECKLIST<br>SLEEP_QUALITY_SCORE_TRACKER<br>SLEEP_TIME_TRACKER<br>STEPS_TRACKER<br>TODAY_FOOD<br>TODAY_SUPPLEMENT<br>WEIGHT_TRACKER<br>}</p></td></tr><tr><td><code>goal</code></td><td>Float</td><td>Sets new goal for selected tracker ex. <code>20000</code> steps.</td></tr><tr><td><code>source</code></td><td>SourceType</td><td>Source of input, <strong>default</strong> is set to <strong>SUGGESTIC</strong>.  enum SourceType {<br>APPLE<br>FITBIT<br>GARMIN<br>GOOGLEFIT_NATIVE<br>GOOGLEFIT_REST<br>HEALTHCONNECT<br>HUAWEIHEALTH<br>IHEALTH<br>MISFIT<br>OMRONCONNECT<br>OMRONWELLNESS<br>OURA<br>POLAR<br>SAMSUNG<br>STRAVA<br>SUGGESTIC<br>SUUNTO<br>WITHINGS<br>}</td></tr></tbody></table>

### **Available Fields**

<table data-header-hidden><thead><tr><th>Field</th><th width="249.33333333333331">Type</th><th>Note</th></tr></thead><tbody><tr><td>Field</td><td>Type</td><td>Note</td></tr><tr><td><code>success</code></td><td>Boolean</td><td><strong>true:</strong> If the tracker goal has been created successfully. Otherwise, it displays <strong>false</strong></td></tr><tr><td><code>message</code></td><td>String</td><td>The message returns either if the goal has been created or not.</td></tr><tr><td><code>tracker</code></td><td>UserTracker</td><td><a href="../../../../objects/common/tracker">User tracker.</a></td></tr></tbody></table>

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

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

```graphql
mutation {
  createUserTracker(input: {
    tracker: STEPS_TRACKER
    goal: 20000
    source: SUGGESTIC
  }) {
    success
    message
    tracker {
      id
      tracker
      goal
      source
    }
  }
}
```

{% endtab %}

{% tab title="Response" %}

```graphql
{
  "data": {
    "createUserTracker": {
      "success": true,
      "message": "User tracker successfully created",
      "tracker": {
        "id": "VXNlclRyYWNrZXI6MQ==",
        "tracker": "STEPS_TRACKER",
        "goal": 20000,
        "source": "SUGGESTIC"
      }
    }
  }
}
```

{% endtab %}
{% endtabs %}

Default goal

<figure><img src="https://920729701-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LwqSnBDpAb6mFZYLsuB%2Fuploads%2FECAcyXMMLqgrAhS8Lg9V%2FIMG_25209EB07AB5-1.jpeg?alt=media&#x26;token=698dddda-5a61-4e8a-8e03-2b4f63dbdafd" alt=""><figcaption><p>Default Goal</p></figcaption></figure>

New custom goal

<figure><img src="https://920729701-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LwqSnBDpAb6mFZYLsuB%2Fuploads%2FjHZ5iOWsBe1GjqoDDf6q%2FIMG_0E8D3C4C7E9D-1.jpeg?alt=media&#x26;token=225107f3-116f-470b-898f-5dc44a4e5f18" alt=""><figcaption><p>New Goal</p></figcaption></figure>
