Skip to content

onCacheEntryAdded doesn't work with fixedCacheKeyΒ #2943

@frenz1e

Description

@frenz1e

onCacheEntryAdded is not called when fixedCacheKey is specified for mutation (getCacheKey doesn't handle that case)

const [fetchList, list] = rtkApi.useListMutation({
    fixedCacheKey: 'FIXED_CACHE_KEY',
});

...

list: builder.mutation({
  query: () => ({
    method: "POST",
    url: `/some-url`,
  }),
  async onCacheEntryAdded(arg, { cacheDataLoaded }) {
    console.log("log me please");
    await cacheDataLoaded;
    console.log("log again");
  })
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions