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

Why not to use attr_accessor for batch_loader? #88

Open
feruzoripov opened this issue Nov 24, 2023 · 1 comment
Open

Why not to use attr_accessor for batch_loader? #88

feruzoripov opened this issue Nov 24, 2023 · 1 comment

Comments

@feruzoripov
Copy link

feruzoripov commented Nov 24, 2023

We have this line https://github.com/exAspArk/batch-loader/blob/master/lib/batch_loader/graphql.rb#L51 and it defines attr_writer :batch_loader. Why not to use attr_accessor :batch_loader instead? Let's say we want to get a loaded item for debugging purposes or for whatever reason, but with the current solution we can't proceed with batch_loader variable or instance_variable_get(:@batch_loader) needs to be run which does not look good.

@feruzoripov
Copy link
Author

It seems like the .sync method is what I am looking for. We probably need to include why and how to use this method in README because we don't have information about it.

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

1 participant