What if we could construct an object that described everything about the fetch and query all together in a single object. And that object could be ultra-portable, able to be passed to any sort of functions such as:
useQuery(<new api object>)
- declarative hook-fetched datafetchQuery(<new api object>)
- imperative method-fetched dataprefetchQuery(<new api object>)
- imperative method-fetched data for SSR cacheinvalidateQuery(<new api object>)
- invalidate the api's cache keymockApiResponse(<new api object>)
- mock the api for a test