esante-graphql-gtw
v4.0.0
Published
A gateway for the esante apollo federation architecture
Downloads
2
Readme
Apollo Federation Gateway for api services in eSante
This is the main entry point for all graphql requests to esante-api, inform-api, insights-api, telehealth-api, and esante-provider.
Updating Subraphs Schemas
The Gateway does NOT resolve automatically at runtime the GraphQL schemas of the subgraphs. This was disabled to avoid the entire gateway crashing when one of the services failed to start.
Instead of leveraging the automatic introspection at runtime the gateway makes use of all the subgraph schema definitions under schemas
folder.
It is the job of developers that whenever of the subgraphs schemas changes to come in this repository, regenerate the new subgraph locally and update the appropiate service file!
How to generate a subraph schema file
Generating a subgraph schema file is done with the rover cli from Apollo.
Pull latest changes for the target service repository locally.
ensure you have introspection enabled in .ENV
Start the service locally and ensure it's up and running
In the local esante-gtw-api repository execute the command below. Replace
LOCAL-PORT
andSERVICE-ID
appropriately../node_modules/.bin/rover subgraph introspect http://localhost:<LOCAL-PORT>/graphql --header "tenantid: <TENANT-ID>" > ./schemas/<SERVICE-ID>.graphql
.
./node_modules/.bin/rover subgraph introspect http://localhost:/graphql --header "tenantid: " > ./schemas/.graphql