This is an experiment of using GraphQL to link together disparate functions for GraphQL endpoint.
There are three functions here:
/ingredient
– This will give you back the nutritional information for all the ingredients in a string in a human-readable format in a JSON structure./recipe
– This will fetch the top result for a recipe and then provide back to you the nutritional information using the ingredient API./graphql
– This allows you to query both of the other functions using GraphQL./graphiql
– This allows you to explore the API via the GraphiQL web IDE
The Nutritionix API and Food2Fork API.
- Install Node 8 (I suggest using nvm)
npm i -g azure-functions-core-tools@core
- Signup for both the Nutritionix and Food2Fork APIs. Copy
secrets.example.json
tosecrets.json
and add your ids and keys in the file or set these environment variables (Application Settings in Azure):NUTRITIONIX_ID
NUTRITIONIX_KEY
FOOD2FORK_KEY
npm run start
- Navigate to the graphiql API explorer at http://localhost:7071/api/graphiql
Apache 2.0. Go nuts.