This is a follow-up to #2937961: ResourceType should provide related ResourceTypes.

Since that issue was committed, we now have duplicate logic for traversing resource relationships in the FieldResolver. This logic is used to expand and validate the paths used for filtering, including and sorting. We should remove the duplicated relationship following logic and use ResourceType::getRelatedResourceTypesByField().

Comments

gabesullice created an issue. See original summary.

gabesullice’s picture

Priority: Major » Normal
Status: Active » Closed (won't fix)

I started to do this and realized that the field resolver really does need to duplicate the logic because it needs to throw exceptions like "this field doesn't exist" and it is not able to get that information from ResourceTypes alone. Therefore, I think it's acceptable duplication. Perhaps some future validation in Entity Query API itself will make this unnecessary.