Create "own" Food Item

Create a new 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.

Note:

mealTime parameter has been deprecated. Instead, mealTimes parameter has been added.

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
  }
}

Last updated