README.md in graphql-batch-0.3.9 vs README.md in graphql-batch-0.3.10
- old
+ new
@@ -70,9 +70,15 @@
```ruby
resolve -> (obj, args, context) { RecordLoader.for(Product).load(args["id"]) }
```
+The loader also supports batch loading an array of records instead of just a single record, via `load_many`. For example:
+
+```ruby
+resolve -> (obj, args, context) { RecordLoader.for(Product).load_many(args["ids"]) }
+```
+
Although this library doesn't have a dependency on active record,
the [examples directory](examples) has record and association loaders
for active record which handles edge cases like type casting ids
and overriding GraphQL::Batch::Loader#cache_key to load associations
on records with the same id.