- Issue created by @matthew.hallsworth.dpc
- 🇦🇺Australia matthew.hallsworth.dpc
Adding a patch to use until such time as branch is complete.
- @matthewhallsworthdpc opened merge request.
- @nadermouldi opened merge request.
As a consumer of menu items API, I want to reduce the volume of response for a large menu dataset, so that I reduce the network overhead of downloading this menu when it has many items.
Internally we want to use this module in order to reduce the number of requests made to the API to fetch menus. However, in the spirit of optimising our request footprint, many of the fields aren't relevant to our FE consuming code.
In order to reduce the network response, we want to be able to request what elements return per menu item so that only relevant data points are returned.
1. Install Drupal and JSON:API Menu Items module
2. Create Node with Menu link
3. Request menu items with a filter to only supply provided fields, i.e. filter[fields]=title,url,parent,children
1. Create a method that allows filtering of the `fields` array in ~L186 of MenuItemsResource.php
2. A proposed patch is forthcoming today to demonstrate a potential solution
1. Add tests to ensure filtering works as expected.
N/A
1. Potential reduction of fields returned as part of API signature
N/A
Active
1.2
Code
Adding a patch to use until such time as branch is complete.