Eager loading nested matrix blocks #17280
-
We've recently switched form NEO to a native Matrix setup and I wanted some clarification on eager loading. The docs don't have a specific example for Matrix fields: https://craftcms.com/docs/5.x/development/eager-loading.html My Matrix field has a bunch of Entry Types… some of those Entry Types have relationships. In the case of the container block it contains the block builder matrix field (recursive): In the majority of cases I would like all the children blocks of the Is this possible to do in a one liner? Maybe with I should also mention I'm using |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
There’s no “one-liner” solution, but you can have all of your queries eager-loaded by adding |
Beta Was this translation helpful? Give feedback.
There’s no “one-liner” solution, but you can have all of your queries eager-loaded by adding
.eagerly()
to each element query.