Question on setQueryData and addEntity #52
-
Hi! In the README it refers to either invalidating the query ( addCourse(course: CourseToAdd) {
return this.http.post<Course>('/api/courses', course).pipe(
tap((newCourse) => {
this.queryClient.setQueryData<Course>(
['courses'],
addEntity('courses', newCourse),
);
}),
);
} I get a type error on the Am I doing something wrong, or is this still baking and should stick with |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 12 replies
-
What's the type of |
Beta Was this translation helpful? Give feedback.
-
Sorry, I still don't get how does it work. By looking at the source code, it shouldn't I think. Might be too late tho 😄 Thank you! 🙇 |
Beta Was this translation helpful? Give feedback.
What's the type of
Course
? The assumption is that the response is an object.