Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titleRequest

Query

Code Block
languagegraphql
query($input : GetAnalysisInput!){
    analysis{
        getAnalysis(input: $input){
            analysis{
                analysisType
                nutrientInfos{
                    nutrient{
                        id
                        name
                    }
                    value
                }
                amountAnalyzed{
                    quantity{
                        value
                    }
                    unit{
                        name
                    }
                }
                weight{
                   quantity{
                        value
                    }
                    unit{
                        name
                    } 
                }
            }
        }
    } 
}

GraphQL Variables

Code Block
{
    "input":{
        "foodId":"855f573f-9977-4625-8241-c6a3ee847b84",
        "analysisInput":{
            "analysisType": "Net",
            "amount":{
                "quantity":"100",
                "unitId":"a7df0af5-0008-0000-7484-751e8eaf05c6"
            }
        }
    }
}
Expand
titleResponse
Code Block
languagejson
"data": {
        "analysis": {
            "getAnalysis": {
                "analysis": {
                    "analysisType": "Net",
                    "nutrientInfos": [
                        {
                            "nutrient": {
                                "id": "84a8709a-0000-0000-ebf9-90cea7d9d44f",
                                "name": "Calories"
                            },
                            "value": 258
                        },
                        {
                            "nutrient": {
                                "id": "84a8709a-0001-0000-ebf9-90cea7d9d44f",
                                "name": "Protein"
                            },
                            "value": 5.9
                        },
                        {
                            "nutrient": {
                                "id": "84a8709a-0002-0000-ebf9-90cea7d9d44f",
                                "name": "Carbohydrates"
                            },
                            "value": 57.8
                        },                        
                        {
                            "nutrient": {
                                "id": "84a8709a-00cf-0000-ebf9-90cea7d9d44f",
                                "name": "Salt"
                            },
                            "value": 1.8725
                        }
                    ],
                    "amountAnalyzed": {
                        "quantity": {
                            "value": "100"
                        },
                        "unit": {
                            "name": "Gram"
                        }
                    },
                    "weight": {
                        "quantity": {
                            "value": "100"
                        },
                        "unit": {
                            "name": "Gram"
                        }
                    }
                }
            }
        }
    }
}

Querying Standard Entities

...