Classic REST API to GraphQL API
The transition from the Genesis Classic REST API to the new Genesis Foods GraphQL API marks an exciting evolution in how developers can interact with our services. This documentation aims to provide a foundational understanding of this transition, highlighting key queries and mutations that correspond to the existing REST endpoints. While this guide does not offer a comprehensive mapping of every endpoint, it serves as a valuable starting point for customers looking to adapt their applications to the new GraphQL API. By leveraging the flexibility and efficiency of GraphQL, we hope to enhance your development experience and empower you to build more dynamic and responsive applications.
Please ensure you start with https://esharesearch.atlassian.net/wiki/spaces/GGA/pages/3293282331
For a full API Reference please refer to Genesis Foods GraphQL API Reference
Genesis GraphQL API Endpoint
Production: https://api.trustwell.com/genesis
Preview: https://api-preview.trustwell.com/genesis
In the examples below, many responses have been truncated for readability.
Classic Service | Classic REST Endpoint | Genesis GraphQL |
|---|---|---|
| Queries | |
| The FoodQuery is a powerful GraphQL query used to retrieve foods and create searches for them. | |
| ||
| ||
| ||
| ||
| ||
| Use FoodQuery to get the food and specifically ask for the conversions property. | |
| You can use the AnalysisQuery to request an analysis of a specific food by its food ID. | |
| Use the NutrientsQuery to get the standard or user added nutrients. | |
| Use the UnitsQuery to get the standard units. | |
| Use the TagsQuery to get the standard or user added tags. | |
| Use the AllergensQuery to get the standard allergens per regulation. | |
| Use the RegulationsQuery to get Authorities and Regulations, as well as Recommendation Profiles. | |
| ||
| Deprecated, use FoodQuery | |
| Deprecated, use FoodQuery | |
| Mutations | |
| Use the FoodsMutation and call Create to create a new food. Example: https://esharesearch.atlassian.net/wiki/spaces/GGA/pages/3293282331/Getting+Started+with+the+Trustwell+Genesis+Foods+GraphQL+API#Creating-an-Ingredient | |
| Use the FoodsMutation to set the fields on a Food | |
| Use the regulation specific LabelsMutation to create and set properties on a label. | |
| Use the regulation specific LabelsMutation to create and set properties on a label. | |
| Use the regulation specific LabelsMutation to create and set properties on a label. | |
| Use the regulation specific LabelsMutation to create and set properties on a label. | |
| Use the LabelsMutation to create any label type. | |
| Not currently supported | |
|
| |
| Use the LabelQuery to get the Labels for a food. | |
| Not currently supported | |
| Not currently supported | |
| Not currently supported |
Clicking links may navigate you away from the Trustwell site.