ash-project / ash-project/ash_json_api_wrapper
Pagination using limit and offset query parameters
Open
- Dominant language
- Elixir
- Stars
- 27
- Forks
- 11
- Avg merge
- 7h 41m
- Merged PRs (30d)
- 1
Description
I have an API that achieves pagination using query parameters in the URL. The maximum items returned is 50 so an offset/skip is needed to retrieve the full dataset
Is this possible using the library as-is? I have hacked it for now by adding a "skip" parameter to the resource that gets passed as a filter
```elixir
read(:list_companies) do
argument :skip, :integer do
allow_nil? true
default 0
end
filter expr(skip == ^arg(:skip))
end
```
The limit is working nicely as-is:
```elixir
limit_with {:param, "limit"}
```
Contributor guide
Assessment
This issue has not been assessed yet.