Story
I've got a registration content type. This registration relates a person to an event. I would like to access registrants from `/api/events/{id}/registrants`.

Problem
Since we only recognize entity references as the primitive for creating a relationship, this would not work since an event does not directly reference persons.

Feature Request
Since a relationship could be represented many different ways, I would like to provide some mechanism for contrib or custom code to register relationships.

Comments

gabesullice created an issue. See original summary.

gabesullice’s picture

I think this could have something to do w/ the typegraph iterator, but I do not want to be blocked by that work. I would like to find a nice pattern for incorporating this and perhaps later refactoring with the iterator if it makes sense.

gabesullice’s picture

This may be related to #2751985: [FEATURE] Add a bundle level relationship to entity level resources if it stays with the concept of 'resource-bundle' relationships. If so, it would be nice to provide some pattern for collecting relationships that do not belong to any entity field. We could 'dogfood' that pattern to provide the 'resource-bundle' relationship, but also to allow other code to provide custom relationships.

dawehner’s picture

he typegraph iterator, but I do not want to be blocked by that work.

Yeah I agree. I'm wondering whether at that point in time we need a custom/other kind of resource.

e0ipso’s picture

Status: Active » Postponed

#2755025: [CLEANUP] Refactor relationships to have a unified base class Should enable this.

We still need a way for applications to alter the schema to add these relationships with some custom business logic, but that's a deeper issue/feature.

e0ipso’s picture

Status: Postponed » Closed (won't fix)

The running assumption is currently that relationships will be based on entity references and family.

Let's reopen this if this becomes hot again.