Skip to content

Instantly share code, notes, and snippets.

@handshake-engineering-blog
Last active Jun 23, 2021
Embed
What would you like to do?
17_1
require "batch-loader"
class SizeBatchLoader < BatchLoader::GraphQL
def sync
# The sync method in the superclass will return an ActiveRecord Relation with all of the objects that have been queried for - all this has class has to do is get the number of those objects
super.size
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment