juicycleff / ultimate-backend

Multi tenant SaaS starter kit with cqrs graphql microservice architecture, apollo federation, event source and authentication
https://juicycleff.github.io/ultimate-backend-docs
MIT License
2.6k stars 407 forks source link

[QUESTION] Trouble understanding the flow of Gql context throughout services #213

Closed bpofficial closed 3 years ago

bpofficial commented 3 years ago

My understanding currently is that the rpc services within the GraphQL context are serialized & sent to the microservices via RPC. However, this has confused me as the microservices would be running on separate containers & therefore not share the same memory space. There has to be a flaw in my understanding - Please advise

I'm currently working on a REST + TypeOrm migration of this project and would love to complete my implementation in order to offer it as an alternative to the GQL configuration (I can see from a previous issue that there are constraints howver I've solved them all in my implementation using db isolation)

Cheers :)

juicycleff commented 3 years ago

Hello @bpofficial we just pass the RPC client into the service. Makes it easy to access the client from the graphql context. It just makes for clean code. You don't have to adhere to it. feel free to initialize the client in your controller or service