Closed lache-melvin closed 10 months ago
Post stand up - the plan is to remove that intermediate layer of the lowercase (form_category
etc) types... we map from these to uppercase ones in the frontend, so there seems very little value in maintaining all 3 versions of the types.
We'll stick with the uppercase ones from DGraph, remove the API layer mapping and just do any required translations in the frontend.
Existing nodes (loaded in from the spreadsheet) have capitalised types (e.g.
Route/Form/DoseStrength/Unit
) - which is what our type filter searches DGraph for.However, the API layer exposes a different set of types (e.g.
form_category/form/strength/unit_of_use
). These are the types we are setting in our upsert_entity mutations, but the backend isn't mapping them back to our capitalised DGraph types.The web UI currently doesn't rely on the type filter, but the mSupply query does. It is searching for nodes of type
Strength
andUnit
, but any new nodes have typesstrength
orunit_of_use
, so aren't returned in the query.upsert_entity
should map to existing DGraph node types, so that the mSupply query receives the new items too!Or, if we don't see the mapping as particularly useful anymore, we support both!