Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
19 - Understanding GraphQL for Beginners - Part 3
mutation {
nutritionCreate(input: {
foodId: 4,
servingSize: "100 g",
calories: "237 g",
totalFat: "11 g",
saturatedFat: "3.8 g",
transFat: "0 g",
cholesterol: "0 mg",
sodium:"266 mg",
potassium: "65 mg",
totalCarbohydrate: "34g",
dietaryFiber: "1.6 g",
protein: "1.9 g",
sugars: "36 g",
vitaminA: "0%",
vitaminC: "0%",
iron: "6%",
calcium:"1%",
}) {
id
calories
foodId
}
}
{
"data": {
"nutritionCreate": {
"id": "4",
"calories": "237 g",
"foodId": 4
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment