@tsteuwer wrote:
Hey guys,
So, the API team has made the decision to restrict all requests to return a max of 10 resources in our JSON API unless we specifically set the page[size]=# param.
I’ve spoke with them and this breaks many cases where our relationships have more than 10. We’ve decided that it’s fine to just add the param page[size]=9999 in any request that is looking by many ids.
My thought process is to update our Application Adapter and override the urlForFindMany and simply:
//.... adapters/application.js coalesceFindRequests:true, urlForFindMany(ids, modelName) { let baseUrl = this.buildURL(); baseUrl += '/' + modelName + '/?page[size]=9999'; return baseUrl; } //....
Would this be sufficient for all possible scenarios Ember data requests multiple resources by ids or all relationships?
Update For anyone looking for an answer, this does seem to be the best spot. We ended up changing it to add the ids.length count instead of 9999.
urlForFindMany(ids, modelName) { return `${this.buildURL()}/${modelName}/?page[size]=${ids.length}`; }
Posts: 1
Participants: 1