-
-
Save handshake-engineering-blog/846d28a3ea0616686183d9b5c2bc710e to your computer and use it in GitHub Desktop.
17_1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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