Skip to content

Is there a way to earger load related submissions? #567

Discussion options

You must be logged in to vote

Sorry for the delay @AbbeyDesign...

In our testing, we cannot reproduce this as an issue. The DB query count does not change if accessing the submissions using the .with('subs'). Without it, the query count about doubles. 🙂

{% set entries = craft.entries.with('subs').all() %}

{% for entry in entries %}
    <p>
        {{ entry.title }}
        {% for sub in entry.subs.all() %}
            <li>{{ sub.title }}</li>
        {% endfor %}
    </p>
{% endfor %}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kjmartens
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants