Craft 3 Element API: Query the "parent" entry of a "child" entry with Matrix blocks connected by an 'Entries' field In a Matrix block field of a "page" entry, I'm using an Entries field to manually select a list of "article" entries to the "page" entry.

When I query an "article" entry, is it possible to query its "parent" page entry that's connected using the above method or do I have to use categories?

BTW it'd be appreciated if the solution is written for the Element API plugin or PHP code if possible.

Thanks!

EDIT: edited question to be more accurate by adding the Matrix details.  Also, the correct query would be:

Entry::find()-&gt;section('page')-&gt;relatedTo([
    'targetElement' =&gt; $article,
    'field' =&gt; 'articleSections.articles'
])-&gt;all();
$page = Entry::find()
    -&gt;relatedTo([
        'targetElement' =&gt; $article, 
        'field'         =&gt; 'articleSections.articles' 
    ])
    -&gt;section('page')-&gt;all();


Please read the docs about ElementQueries and relations

Note: the Element API Creates an ElementQuery from your criteria property.

criteria =&gt; [
    'sectionId' =&gt; 4,
    'typeId'    =&gt; 1
]


Is the same as

Entry::find()-&gt;sectionId(4)-&gt;typeId(1)