You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Meta in a response may contain both constant and temporary data that relates only to the given query.
It would be nice to be able in such a case to define which properties are merged and which are simply returned in the response of store.query().
I have the following use case:
My API returns in its meta a total with the total count of objects in the collection and, when the query is filtered (store.query('model', { filter: ... })) a filtered count of the number of objects that meet the filter criteria. I see no reason to persist the filtered count in the store's metadata is such a case. Furthermore, given that the filtered property is not present when the request is not filtered, the (currently merged) meta returned in the response is misleading.
Should the merge behaviour of metadata be optional/ overideable? Defined in the serializer/ adapter?
The text was updated successfully, but these errors were encountered:
For JSONSerializer and RESTSerializer you should be able to munge the meta in normalizeQueryResponse if you want to remove it in certain code paths but not others. Would that solve this issue?
For JSONAPISerializer we still haven't implemented full meta support but I guess the same (above) would apply here.
We no longer merge meta at all, it is a simple direct assign of whatever the latest meta given to us is. If you do want to merge, this is something you can achieve on your own by accessing the previous meta and merging prior to giving us the new meta.
Meta in a response may contain both constant and temporary data that relates only to the given query.
It would be nice to be able in such a case to define which properties are merged and which are simply returned in the response of
store.query()
.I have the following use case:
My API returns in its meta a
total
with the total count of objects in the collection and, when the query is filtered (store.query('model', { filter: ... })
) afiltered
count of the number of objects that meet the filter criteria. I see no reason to persist thefiltered
count in the store's metadata is such a case. Furthermore, given that thefiltered
property is not present when the request is not filtered, the (currently merged) meta returned in the response is misleading.Should the merge behaviour of metadata be optional/ overideable? Defined in the serializer/ adapter?
The text was updated successfully, but these errors were encountered: