-
Notifications
You must be signed in to change notification settings - Fork 72
Open
Description
My view fetches the needed data, including a list of comments in the model when it loads.
@queryManager apollo;
setupController(controller, model) {
controller.set('approved_comments', model.commentSet.edges.filter(comment => {
return comment.node.approved == true;
}))
controller.set('unapproved_comments', model.commentSet.edges.filter(comment => {
return comment.node.approved == false;
}))
}
async model(params) {
let variables = { id: params.business_id };
return this.apollo.watchQuery({ query, variables }, 'business')
}
Those comments are passed to the controller on two properties which are tracked:
@tracked approved_comments;
@tracked unapproved_comments;
In that controller, an action runs a mutation which modifies some of those comments, and returns the modified comment. I see that the comment is updated in the apollo cache, but the ember tracked properties do not seem to update.
The docs don't have any examples of using a watch query in a model.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels