-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
Milestone
Description
I'm using codegen to generate the api spec and would like to specify a refetchOnMountOrArgChange
for the whole endpoint - rather than in every component.
Ideally I'd like to do something like
import { injectedApi } from './generated/api'
const enhancedRtkApi = injectedApi.enhanceEndpoints({
getData: {
refetchOnMountOrArgChange: 600,
keepUnusedDataFor: 14400,
},
},
})
export { enhancedRtkApi as api }
But it looks like refetchOnMountOrArgChange
is part of the query
key. I may be missing something, but I couldn't figure out a way to pass query
key w/o overriding the generated one