-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make relationships subrequests #1
Comments
@Paulmicha I don't think devour automatically populates relationships like that. You can do an include using the |
I'll go check the source to make sure they're not doing anything that might be a performance hit. If they're not I'll close this ticket and if they are maybe we can consider including @e0ipso's library or something similar. In our higher level API
|
@Paulmicha I read more into subrequests. They definitely have a lot of benefits, bundling multiple HTTP requests into one saves a lot of network latency. I think this might be better handled in a higher level API. I don't see this library providing more than a binding to the JSON:API exported by Drupal. I've added a ticket to |
I tend to agree with this sentiment. However, I don't think that it would be very disruptive to implement: client.subrequestsCapture();
client.get(…); // Prevents sending during capture mode.
client.post(…);
client.post(…);
client.subrequestsSend(); // Sends a single request. |
I haven't looked into devour much yet, but I'm asking in case anyone has given this a thought already :
Would it make sense to extend or replace Devour's relationship feature (see https://github.com/twg/devour#relationships) to use subrequests (see https://github.com/e0ipso/subrequests-express) ?
Edit : context : section Improve performance using subrequests from this article : https://thebrainfiles.wearebrain.com/how-to-quickly-configure-drupal-as-a-decoupled-api-first-system-8730a3623388
The text was updated successfully, but these errors were encountered: