Hmm, actually this isn’t quite what we want. We also want to debounce the initial query. There’s another approach that I need to document here.
Keeping in mind that React Query will execute the query on initial load and then only when its query key changes, the idea is that you use a debounced version of your query keys. That way, the query itself will be debounced. See CodeSandbox for a working example.