Built-in Plugin Batch
Learn another type of built-in plugin batch.
We'll cover the following
Batch
The problem with async, of course, is that while it’s faster than serial database queries, we still do N number of them to get N number of categories when we could really do just one database query to get all the categories. We need a way to aggregate values, a function that can use those aggregated values to run an SQL query, and then get those values back into individual fields.
Fortunately, the Absinthe.Middleware.Batch
plugin has our back. Let’s see how it looks in our resolver:
Get hands-on with 1400+ tech skills courses.