Closed (won't fix)
Project:
JSON:API
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
6 Feb 2018 at 09:05 UTC
Updated:
16 Feb 2018 at 12:24 UTC
Jump to comment: Most recent
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
Comment #2
gabesulliceI 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.