@bobholt @tkellen @cowboy @leobalter What is your reaction to the idea of defining the include parameter on the adapter? I was thinking it would end up looking something like this.
// app/adapters/post.js
import EndpointsAdapter from "ember-data-endpoints/adapter";
export default EndpointsAdapter.extend({
queryParams: {
include: ['author', 'comments', 'comments.author'].join(',')
}
});
Then any time you would need to do a get GET request the adapter's queryParams object would be serialized into the url. For example store.find('post') would request GET /posts?include=author,comments,comments.author and store.find('post', 1) would request GET /posts/1?include=author,comments,comments.author.
I think in the cases where doing a store.find('post', {include: 'foo'}) the include: 'foo' would take priority over the the include defined on the queryParams object.
Open question. Should the queryParams be included in the url for non get requests?
@bobholt @tkellen @cowboy @leobalter What is your reaction to the idea of defining the
includeparameter on the adapter? I was thinking it would end up looking something like this.Then any time you would need to do a get
GETrequest the adapter'squeryParamsobject would be serialized into the url. For examplestore.find('post')would requestGET /posts?include=author,comments,comments.authorandstore.find('post', 1)would requestGET /posts/1?include=author,comments,comments.author.I think in the cases where doing a
store.find('post', {include: 'foo'})theinclude: 'foo'would take priority over the theincludedefined on thequeryParamsobject.Open question. Should the
queryParamsbe included in the url for non get requests?