Skip to content
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 Dataloader optional #536

Closed
RichAyotte opened this issue Nov 4, 2017 · 2 comments
Closed

Make Dataloader optional #536

RichAyotte opened this issue Nov 4, 2017 · 2 comments

Comments

@RichAyotte
Copy link
Contributor

Because of my ACL needs, I've had to implement a custom Dataloader.

Would you accept a PR to make the currently included Dataloader an optional feature?

@mickhansen
Copy link
Owner

I'd accept a PR to allow disabling it definitely.
Although i think it's a lot simpler to think about ACL post fetch most of the time.

@idris
Copy link
Contributor

idris commented Nov 6, 2017

@mickhansen had an interesting idea here: #535 (comment)

But going forward, when dataloader implements per-request batching i'd love to just remove dataloader from here and just direct people to it in the readme.

Also related: mickhansen/dataloader-sequelize#39 (comment)

The library [dataloader-sequelize] really needs to be refactored so that it works off request caching rather than global caching.

I think that should be the direction here:

  1. Fix dataloader-sequelize so that it is more manual and works off of request caching. It will require a dataloaderSequelize object to be passed in with every call, just like transactions.
  2. Add an option (or options) in graphql-sequelize to create a dataloaderSequelize context and attach it to the graphql Context.

This way, if you don't want to use dataloader-sequelize, all you have to do is not add it in your graphql context.

One drawback: You will not be able to enable dataloader-sequelize for certain associations but not for others. This would be an easy fix, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants