I’m trying to write an ember-data adapter for a custom API backend. It allows full-text search using a query, returning records from the store.
I implemented query(store, type, query)
in my adapter, and it works fine, but only when I return the full model when resolving the promise. This might be thousands of objects, and I don’t want to display them all at once anyways. Is there a way to return incomplete objects here that get queried via findRecord
once they’re actually needed?
I can return an array of {id:"..."}
objects from there, but they just have all attributes set to undefined and are never fetched from the server. Their isLoaded
flag is incorrect.
Manually calling reload()
on all objects returned from that query does set the attributes correctly, but that’s not the point of using ember-data in the first place.
How can I modify the isLoaded
flag for this?