Skip to content

Can not invalidate cache tags #4692

Answered by alpzaf
alpzaf asked this question in Q&A
Nov 5, 2024 · 2 comments · 7 replies
Discussion options

You must be logged in to vote

Actually, I'd spotted the issue right in the first place. The problem was that my injected endpoints couldn't get any of tagTypes because after I realized I put the provide and invalidate arrays in the wrong place they were in query object.

**
// PREVIOUS
getAllPeople: build.query<ApiResponse<Person[]>, QueryParams | string>({
  query: (query) => ({
    url: '${SERVICE_URL}/people/filter?${buildQueryString(query as QueryParams)}',
    providesTags: ['People'] // -> wrong place. (does not throw any error)
  }),
}),

**


**
// WORKING ONE
getAllPeople: build.query<ApiResponse<Person[]>, QueryParams | string>({
  query: (query) => ({
    url: '${SERVICE_URL}/people/filter?${buildQueryString…

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
2 replies
@alpzaf
Comment options

@alpzaf
Comment options

Comment options

You must be logged in to vote
5 replies
@alpzaf
Comment options

@phryneas
Comment options

@alpzaf
Comment options

Answer selected by alpzaf
@markerikson
Comment options

@EskiMojo14
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants