# Create "own" Food Item

Use the `createOwnMealLog` mutation to create a new food item for the currently logged user.

Optional: use *logAfterCreation* to automatically add to the user's log after the item has been created.

| Arguments          | Required | Type                                                                                          |
| ------------------ | -------- | --------------------------------------------------------------------------------------------- |
| `name`             | true     | String!                                                                                       |
| `barcode`          | false    | String                                                                                        |
| `brand`            | false    | String                                                                                        |
| `date`             | false    | Date                                                                                          |
| `logAfterCreation` | false    | Boolean                                                                                       |
| `mealTimes`        | true     | [MealTimes!](https://docs.suggestic.com/graphql/objects/common/meal-time)                     |
| `mealType`         | true     | [MealType!](https://docs.suggestic.com/graphql/objects/food-logs/meal-type#available-options) |
| `ownNutrients`     | true     | [OwnNutrients!](https://docs.suggestic.com/graphql/objects/common/own-nutrients)              |
| `ownServing`       | true     | [OwnServing!](https://docs.suggestic.com/graphql/objects/common/own-serving)                  |

Note:

{% hint style="info" %}
mealTime parameter has been deprecated. Instead, mealTimes parameter has been added.
{% endhint %}

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

```graphql
mutation {
  createOwnMealLog(
    name: "Powercrunch Protein bar"
    barcode: "580062789"
    brand: "Powercrunch"
    date: "2020-08-10"
    logAfterCreation: true
    mealTimes: [BREAKFAST, LUNCH, DINNER]
    mealType: OWN_ITEM
    ownNutrients: {
      enercKcal: 220,
    	ca: 60,
      chocdf: 12,
      chole: 0,
      fams: 0,
      fapu: 0,
      fasat: 0,
      fat: 13,
      fatrn: 0,
      fe: 0,
      fibtg: 0,
      k: 0,
      na: 0,
      procnt: 13,
      sugar: 6,
      vitaIu: 0,
      vitc: 0
    }
    ownServing:{
      equivalent: 40,
      name: "5 servings"
   }
  ) {
    databaseId
  }
}
```

{% endtab %}

{% tab title="Response" %}

```javascript
{
  "data": {
    "createOwnMealLog": {
      "databaseId": "31170210-db3d-11ea-a04e-0242ac180007"
    }
  }
}
```

{% 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/mutations/food-log/own-food-item/create-own-meal.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.
