-
Notifications
You must be signed in to change notification settings - Fork 1
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
Include param defined in the adapter #10
Comments
So, would you need to define a custom adapter for each model then? |
Yes, for each model that has relationships. |
👍 on defining the include parameter on the adapter.It might be good to have it avoiding duplicity on different routes. |
Part of me likes defining the Either way, the Where is the most Embery place to define sideloaded relationships? |
The join(',') part was just me being cute it could have been written more simply as a string. I feel like making this an adapter concern is correct because it involves the url which Ember Data is using to communicate with the backend. The problem with As for |
I think you're probably right that these are mostly static throughout the app. Let's give it a shot on our next internal app using this (away) and see how it goes? |
@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.Then any time you would need to do a get
GET
request the adapter'squeryParams
object would be serialized into the url. For examplestore.find('post')
would requestGET /posts?include=author,comments,comments.author
andstore.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 theinclude
defined on thequeryParams
object.Open question. Should the
queryParams
be included in the url for non get requests?The text was updated successfully, but these errors were encountered: