Skip to content
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

Cannot change limit of included items #418

Open
Redsandro opened this issue Jul 9, 2018 · 3 comments
Open

Cannot change limit of included items #418

Redsandro opened this issue Jul 9, 2018 · 3 comments

Comments

@Redsandro
Copy link

When requesting a resource, we can include it's relationships for client-side model postprocessing by using the querystring ?include=:

http://<server>/<model>/<id>?include=<hasManyRelationship>

However, if we want to load 60 tokens for a single resource, the application breaks because jsonapi-server hard-limits the included items to 50.

I tried doing this:

http://<server>/<model>/<id>?include=<hasManyRelationship>&page[limit]=100

But I'm still only getting 50.

I reckon this should be:

  1. Configurable in jsonApi.setConfig(), and
  2. Settable in the request, e.g. page[limit] (or some other include-only parameter)
@Redsandro
Copy link
Author

I think we need to forward the pagination request params somewhere, but I am not sure where.

Or add a new parameter page[includelimit], but then we'd still need to forward the request params to the internal include fetch function.

@queenvictoria
Copy link

See #260 for a solution if you've rolled your own handler.

@Redsandro
Copy link
Author

Thank you @queenvictoria. This is an awesome project which I used in the past. However certain unaddressed issues (like this one or that one) and the stalled development caused me to move on from jsonapi-server.

There was a fork called jagql but I think it might be stalled too.

For smaller projects I use my own small scoped jsonapi-server-mini. For setting up a jsonapi endpoint on node using express and mongodb, it'll just take one file per route/model. I have yet to see anything simpler.

For more complex projects fortune.js seems interesting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants