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

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.suggestic.com/graphql/query/mutations/food-log/own-food-item/create-own-meal.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
