Fetch target entries that have been linked through an Entries field I have a section Posts that has an Entries-type field called Authors that can be linked to one or more entries in section called People. To make a filter for my posts index, I need to fetch all the People entries that have been linked to any post via the Authors field, but I can't wrap my head around how to do this.

Any ideas appreciated!
You first need to query for all post entries and then query for the authors that are related to a post. You can use the ids() method to get just the author’s element IDs, which is a lot quicker than find().

{% set allPostIds = craft.entries({
    section: 'posts',
    limit: null,
}).ids() %}

{% set people = craft.entries({
    section: 'people',
    relatedTo: {
        sourceElement: allPostIds,
        field: 'people',
    },
}) %}