batch-loader icon indicating copy to clipboard operation
batch-loader copied to clipboard

:zap: Powerful tool for avoiding N+1 DB or HTTP queries

Results 13 batch-loader issues
Sort by recently updated
recently updated
newest added

Hi, everyone. Does batch-loader can works with graphql union type?

Sometimes `#tap` is used just for code style and the value is never checked, so don't sync the value unnecessarily. (Contrived) Example: ```ruby lazy_fetch(1).tap { logger.info('lazy_fetch complete') } ```

Hi in my query value returned is one object `Project.find(id)` This schema return one error `Failed to build a GraphQL list result for field `Project.Items` at path `project.items`.\nExpected `#` (BatchLoader::GraphQL)...

Hey all, I'm trying to print out the variable values inside of batch blocks for debug purpose, but somehow it doesn't work. Nothing print out. I wonder if anyone knows...

Fixes some failures when using Ruby 3 in situations where it appears a few layers of delegation occur inside other libraries (in this case I was having failures using batch-loader...

Is something like this possible? ```ruby class Types::SubcategoryType < Types::BaseObject def records BatchLoader.for(object.category_id).batch do |category_ids, loader| records = Record.where(category_id: category_ids).group_by(&:subcategory_id) loader.call(object.subcategory_id, records[object.id]) end end end ``` The goal is to...

Suggested change: I only wanted this for graphql, but i added to either use case, I can change it to be more limited if you want. From the graphql spec,...

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...

It seems there was a [breaking change](https://github.com/rmosolgo/graphql-ruby/pull/4344) introduced in 2.0.18 that causes `use BatchLoader::GraphQL` to cause the following exception: ``` vendor/bundle/ruby/3.2.0/gems/graphql-2.0.19/lib/graphql/schema.rb:944:in `tracer': Can't add tracer after configuring a `trace_class`, use...