- Issue created by @brianperry
- 🇮🇳India pratik_kamble Pune, India
@brianperry I did not fully understand what is expected output here? Do we want to disable pagination? Because as far as I know we can't get disable pagination for JSONAPI client.
- 🇺🇸United States brianperry
@pratik_kamble - you are correct that there is no way to disable paging of the JSON:API endpoint. This would essentially be providing a helper on our end to automatically get all paged results.
In DrupalState we had an 'all' option
// If there is a collection with more than 50 entries, Drupal will automatically // paginate results and return the first 50 items. // To fetch all items in a collection, use the `all` option const allArticlesFromApi = await store.getObject({ objectName: 'node--ds_example', all: true, });
This passage of code is how we approached it in that library: https://git.drupalcode.org/project/drupal_state/-/blob/1.0.x/src/DrupalS...
- 🇺🇸United States brianperry
Added a little more detail to the issue description.
- Assigned to pratik_kamble
- 🇮🇳India pratik_kamble Pune, India
@brianperry What should be response if the both `rawreponse` and `all` flag is true.
- Status changed to Postponed
10 months ago 8:12pm 1 February 2024 - 🇺🇸United States brianperry
@pratik_kamble that's a good question. If forced to choose with both flags I think 'all' would have to override 'rawResponse' - either just ignoring it, or throwing an error when both exist.
But as you seem to imply, that feels like it is in conflict with our interface. And the JSON:API spec for that matter.
I'm inclined to say that we postpone this for now in favor of leading people to use JSON:API as intended by the spec. If we hear demand for this feature we can reconsider.
- Issue was unassigned.