Closed DaddyWarbucks closed 3 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Apologies if the issue could not be resolved. FeathersJS ecosystem modules are community maintained so there may be a chance that there isn't anybody available to address the issue at the moment. For other ways to get help see here.
This is not a bug, and not even necessarily a feature request. But I wanted to share some code that I thought feathers-batch may benefit from. It uses Facebooks
DataLoader
to construct the "instructions" sent to the server in an async manner. This would allow the developer to more easily create the "instructions" inside hooks and things likefeathers-schema
.The following code is a snippet from a thought experiment outlined here: https://github.com/DaddyWarbucks/test-feathers-client-joins
Note this code is just kinda cobbled together and was also not built for feathers-batch specifically. It was built to match a much simpler (less powerful) server side "batch" service that only handles finds for the sake of the project mentioned above. So the key serialization, etc would need to change. It also does some
processHooks.call
stuff that probably doesn't belong here and could be handled elsewhere. It is also important to note that this is doing somebatchLoader
stuff with the{ _id: { $in: [] } }
. That is not relevant to implementing this in feathers-batch.And ti would be used as follows
I know there is some code in this example that is not relevant to feathers-batch, but I just copy pasted it from the other project. If this does not make sense let me know and I will type out a more specific implementation.