简体   繁体   中英

Is it possible to map full Uris to different services?

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.

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}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM