Is it possible to map full Uris to different services?

36 Views Asked by At

I want to create multiple GraphQL microservices which can be independently deployed to AKS, then utilize a GraphQL Federated gateway to expose a composite graph. I'm wondering if it's possible to go beyond subdomains for separating out the URIs that match.

https://graph.xyzcorp.com/ -- GraphQL Gateway
https://graph.xyzcorp.com/{Microservice Name} -- GraphQL Microservice

I really don't want to have to use multiple subdomains or different subdomain names such as https://customer.graph.xyzcorp.com/, https://customergraph.xyzcorp.com/, etc. I also don't want to combine all the microservices into a single project as that would create a monolith again.

1

There are 1 best solutions below

0
Vaibs On

What you have currently is the correct implementation. You have the gateway and all microservices are mapped(registered) to the gateway.

Just mapping all the microservices to gateway is not going to make your application monolithic because gateway is just the entry point of your application.

I would suggest while defining the contract of microservices(may be swagger), you can mention the base path and path of endpoint like below.

basepath:: domainName/version1.0

Hope this may help you.

path::microserviceName/customer/{id}