The main problem is in serving our graphQL API, which needs to be able to dynamically and efficiently execute pretty much arbitrary queries across all components
Our approach is to model the use cases of our modules as commands and queries. These become the api of our modules. Our GraphQL API sits on top of this.
<@U783UION177> is that something you have working right now or something you’d like to work towards. Because i’ve experimenting with this a lot. And wondering how that works in practicality
It is something we have working now, but it’s still early days. We have pushed batch loading into our queries, which can be used by GQL and restful endpoints.
<@U783MOJYF8Z> So in your example we would call the CarsQuery of the Cars module and in the tires resolver of the cars output type, we’d call the TiresQuery of the Tires module. Since all of our queries are batch loaded, we avoid the n+1s in the TiresQuery. Does that make sense?
Since all of our queries are batch loaded
Not sure I understand what you mean by that.
To narrow it down, can you guarantee a maximum of one DB query per table and graphql query? Do you use lazy evaluation like https://github.com/Shopify/graphql-batch?