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.
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.
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 useattr_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 withbatch_loader
variable orinstance_variable_get(:@batch_loader)
needs to be run which does not look good.