-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First class support for jsonapi.net filters, pagination and sorting #901
Comments
You can build a custom source on top of JSON:API source, I believe. |
Much of what you're looking for is already supported. See https://orbitjs.com/docs/next/querying-data#queries with the examples. The docs are a work in progress, but sorting, filtering, and pagination are all supported out of the box. |
@SafaAlfulaij @bradjones1
|
@sandreas You're correct that the filtering specifically defined by jsonapi.net is not supported out-of-the-box in I'm working in this area right now as I prep v0.17 for release, so thanks for providing these use cases. |
@dgeb Awesome, thank you! Keep up the good work. For a full set of even more use cases, see https://www.jsonapi.net/usage/reading/filtering.html |
@sandreas Sorry I misunderstood your original question. I am handling this locally, for the time being, doing something like overriding the URL builder: https://gist.github.com/bradjones1/18ff9ebdb85455f781a2a212577653ce See also #559 (comment) |
PR #911 greatly improves the built-in handling of standard json:api options. And, as @bradjones1 pointed out above, overriding the JSONAPIURLBuilder is the recommended way to handle custom options. Once v0.17 is released, it would be great to start publishing packages with some standard overrides such as for jsonapi.net and Drupal. Please let me know if you have any trouble using the new options. |
Thanks @dgeb - that's awesome. I don't see any docs updates in the PR; is this something that you're already working on or should I take a stab at updating the docs? My TypeScript is pretty shoddy but I'd like to help as I can in order to repay a little bit of the effort I'm benefiting from. |
@bradjones1 thanks for asking! I've been planning to update the guides with a section that goes in depth on using and customizing the JSONAPISource. If you want to get a start on that, it would be much appreciated. Also very useful, and perhaps easier to tackle, would be expanded inline API docs for the Thanks in advance for any help you can provide with the docs! |
Thanks guys, I'll try it in the next weeks for a new project. Awesome! Greatly appreciate it. |
Really excited to see this issue! It would be nice for |
Hello,
awesome library, thanks. One thing that I'm missing is first class support for jsonapi.net filters, sorting and pagination:
They implemented every feature a little different to the well known approaches, but in my opinion it is one of the most elegant ways to query resources.
My questions:
options
or to many custom implemenation? (see below)Example for manually including
options
:The text was updated successfully, but these errors were encountered: