diff --git a/src/Context/FieldResolver.php b/src/Context/FieldResolver.php index 77150a8..202f77e 100644 --- a/src/Context/FieldResolver.php +++ b/src/Context/FieldResolver.php @@ -337,6 +337,13 @@ class FieldResolver { return $this->constructInternalPath($reference_breadcrumbs); } + // JSON:API outputs entity reference field properties under a meta object + // on a relationship. If the filter specifies one of these properties, it + // must prefix the property name with `meta`. The only exception is if the + // next path part is the same as the name for the reference property + // (typically `entity`), this is permitted to disambiguate the case of a + // field name on the target entity which is the same a property name on + // the entity reference field. if ($at_least_one_entity_reference_field && $parts[0] !== 'id') { if ($parts[0] === 'meta') { array_shift($parts);