Currently, exposing functionality from the gateway as REST requires a completely new endpoint to be created with duplicated logic from our GraphQL API. Exposing functionality for health integrations is thus slow and hugely increases our total cost of ownership.
Let's refactor our approach so that we'd have a utility for converting existing GraphQL functionality to REST. My suggestion is that the end result looks something like this:
Currently, exposing functionality from the gateway as REST requires a completely new endpoint to be created with duplicated logic from our GraphQL API. Exposing functionality for health integrations is thus slow and hugely increases our total cost of ownership.
Let's refactor our approach so that we'd have a utility for converting existing GraphQL functionality to REST. My suggestion is that the end result looks something like this:
So for instance to expose the "fetchLocations" query from GraphQL you'd
graphQLToREST
(created by us) utility to define to which GraphQL query the rest endpoint should point toThe end result should be the same as making a graphql request and defining it to return all fields
Discussion: https://opencrvsworkspace.slack.com/archives/C02LU432JGK/p1674021482747219