exAspArk/batch-loader
63.8
Adequate · 20 September 2026
264
lines of production code
Ruby
primary language
1
measurement over time
What this system is
BatchLoader is a Ruby gem that provides a generic lazy batching mechanism to prevent N+1 query problems in database and HTTP requests. It features deep integration with GraphQL, allowing resolvers to automatically synchronize batched data loading within a single request cycle. The system includes middleware for state management, caching controls, and performance profiling tools to optimize execution.
Features
BatchLoader v2.0.6: New GraphQL integration and Executor refactoring
This release introduces a dedicated GraphQL integration module (\BatchLoader::GraphQL\) that allows users to wrap batch loaders for automatic synchronization within GraphQL resolvers, including a deprecation warning for the legacy \BatchLoader.for\ usage in GraphQL contexts. The core \Executor\ has been refactored to use a \Set\ for tracking items and exposes \items\_by\_block\ and \loaded\_values\_by\_block\ for direct access, supporting a new \ExecutorProxy\ that manages default values and item loading state. A new \Middleware\ is provided to ensure the executor is cleared after each request, and the library version has been bumped to 2.0.6.
_lib/batch\loader · high confidence
Initial release of BatchLoader gem with GraphQL integration
This entry documents the initial commit of the BatchLoader gem, introducing a generic lazy batching mechanism designed to prevent N+1 queries in database and HTTP requests. The diff establishes the core library structure, including the CHANGELOG, README, and build configuration (Makefile, gemspec). It also adds specific support for GraphQL via a new \BatchLoader::GraphQL\ module and a dedicated test environment (\graphql-latest.gemfile\ pinning graphql \~\> 1.8), alongside CI configuration for Ruby 2.3.4.
(repo-wide) · high confidence
Behavioural changes
Major refactoring of BatchLoader with new proxy-based execution and method delegation
The core BatchLoader implementation has been significantly restructured to replace the previous Executor-based architecture with an ExecutorProxy pattern. This change introduces new initialization parameters including \default\_value\, \cache\, \replace\_methods\, and \key\, allowing for more granular control over caching behavior and method delegation. The library now explicitly defines which instance methods are implemented versus replaced, using a singleton class to dynamically delegate methods to the loaded value when \replace\_methods\ is enabled. Additionally, the \respond\_to?\ method no longer relies on \method\_missing\, improving performance and correctness, while the \inspect\ method is simplified to avoid swallowing exceptions in debugging tools like Pry.
lib · high confidence
Test coverage
Added benchmark and profiling scripts for BatchLoader; Added comprehensive test suite for BatchLoader core, GraphQL integration, and middleware; Updated test fixtures for GraphQL integration and model refactoring.
Dependencies
Update development dependencies and test coverage configuration
This change updates the gem's development dependencies, upgrading bundler to \~\> 2.0 and rake to \~\> 13.0, while adding specific versions for graphql (\~\> 1.8), pry (\~\> 0.14), benchmark-ips (\~\> 2.7), and ruby-prof (\~\> 0.16). It also replaces the pry gem with coveralls for test reporting and adjusts the gemspec to include spec and image files in the distribution package.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 64.
Lenses
- Code Health 100
- Architecture 69
- Maturity 54
- Readiness 62
- Security 100
Changes since last survey
- 136 commits — 121 feature/other, 15 fixes
By area
- (root) — 72 commits
- (repo) — 29 commits
- lib/batch_loader — 16 commits
- lib/batch_loader.rb — 11 commits
- spec/batch_loader_spec.rb — 4 commits
- spec/fixtures — 3 commits
- spec/benchmarks — 1 commit
Notable commits
- fix: Additional Ruby 3 fixes relating to kwarg changes
- fix: Fix 1:Many example in README.md
- fix: Fix arity bug in respond_to? method
- fix: Fix batch key example for README.md
- fix: Fix compatibility with GraphQL Interpreter and BatchLoader.for
- fix: Fix readme example for loading 1:many relationship #16 #17
- fix: Fix wrap_with_warning call for new tracing module
- fix: Fixed Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call warnings when using ruby 2.7
- fix: Merge branch 'jamesbrooks-additional-ruby3-kwargs-fixes'
- fix: Merge pull request #14 from ZJvandeWeg/zj-method-missing-bug
- fix: Merge pull request #29 from stanhu/sh-fix-readme
- fix: Merge pull request #3 from ZJvandeWeg/zj-fix-arity-bug
- fix: Merge pull request #94 from engwan/fix-private-method-error
- fix: Release v2.0.1. Actually fix compatibility with Ruby 3, update specs
- fix: Require Set, fix #1
- change: 'Loading multiple items' docs: add has_many to make docs more rails-friendly
- change: Add Alternatives section
- change: Add Universe logo
- change: Add replace_methods argument to BatchLoader#batch
- change: Add a spec. Thank you, @tony-pizza!
- …and 116 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
exAspArk/batch-loader was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 20 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 525a6309e65b5113a4fb16d45b54ddf90c3b9693 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.