You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We aren't currently explicitly listing the fields and/or properties of elements that can be eager-loaded.
This may have to be "generic," but should still be front-and-center, i.e. "Only properties and custom fields that reference other elements can be eager-loaded."
Additionally, not all fields and/or related elements need to be eager-loaded. We can cover situations where you are apt to see performance improvements vs situations where you won't see any benefit.
This may include a mention of the eager-loading-in-place service method:
May also be worth mentioning that if you do try to eager load a field that doesn't support it, you'll get blank data for the field instead of the actual data.
Ask me how I know.
{% do craft.app.elements.eagerLoadElements(
className(product),
[product],
[
'listingImage',
'whoopsNotEagerLoadable'
]
) %}
{% for thing in product.whoopsNotEagerLoadable %}
...
{% endfor %}
Results in nothing, but if you remove whoopsNotEagerLoadable from the Eager Loading you get the data in that field.
Product
Other/Multiple/Not Sure
Description
We aren't currently explicitly listing the fields and/or properties of elements that can be eager-loaded.
This may have to be "generic," but should still be front-and-center, i.e. "Only properties and custom fields that reference other elements can be eager-loaded."
Additionally, not all fields and/or related elements need to be eager-loaded. We can cover situations where you are apt to see performance improvements vs situations where you won't see any benefit.
This may include a mention of the eager-loading-in-place service method:
The text was updated successfully, but these errors were encountered: