I see, makes sense. Unfortunately, we don't have any solutions OOB at this time for declaritive composition and is being considered on the roadmap.
As Raymond suggested, you can write JavaScript via custom remote methods to do what you want. In your case, you can write up an external facing API/microservice with N models that expose remote methods that use the Swagger, REST, etc connector to connect to your internal APIs as a datasou
So in the model file (that was generated via Swagger
import) I use remote-methods as the connection to the datasource via
the internal loopback API? I use an operational hook on the model's find
method? And I can aggregate the response of multiple remote methods
into find() response?
Everything up the operational hook part is good. You code up the entire remote method to make N requests to your other services (via regular JavaScript, ie. Async, Promises, etc) and aggregate them in code. This means you can call the find operation when writing up your remote method for that particular model and aggregate the response before returning from the remote method.
The operation hooks are separate in that you can perform other operations before/after certain operations that are triggered as part of the remote method invocation (operation lifecycle hooks).