-
Example my main page using export default function MyPage() {
const { data } = api.endpoints.getSomething.useQuery(
{ limit: 100 },
{ pollingInterval: 10000, skip: false, refetchOnMountOrArgChange: true }
)
// …
} And one of my components needs to perform a custom trigger with export default function MyComponent() {
const [trigger] = api.endpoints.getSomething.useLazyQuery()
const handleUpdate = () => {
trigger({ limit: 1 })
}
// …
} Question: 🤔 Network logs: "https://a.com/something?limit=100" // pollingInterval
"https://a.com/something?limit=100" // pollingInterval
"https://a.com/something?limit=100" // pollingInterval
"https://a.com/something?limit=1" // Because trigger({ limit: 1 }) triggered
"https://a.com/something?limit=1" // pollingInterval (args changed)
"https://a.com/something?limit=1" // pollingInterval
"https://a.com/something?limit=1" // pollingInterval
// so on… Thanks alot. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
That is very weird - Could you create a reproduction (e.g. a CodeSandbox) of that behaviour? |
Beta Was this translation helpful? Give feedback.
I believe this one is currently not possible - by using a manual
serializeQueryArgs
, you merge these into semantically one cache entry - and polling will always just "follow" that cache entry :/