react-query#queryCache JavaScript Examples

The following examples show how to use react-query#queryCache. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: useAccountQuery.test.js    From v3-ui with MIT License 6 votes vote down vote up
describe('useAccountQuery', () => {
  // Currently using AuthControllerContext in hook requires a lot more boilerplate
  xit('santizes the address', async () => {
    const queryCache = new QueryCache()

    // const contextValues = { chainId: 1 }

    const wrapper = ({ children }) => (
      <ReactQueryCacheProvider queryCache={queryCache}>{children}</ReactQueryCacheProvider>
    )

    const expectation = nock('https://api.thegraph.com')
      .get('/subgraphs/name/pooltogether/pooltogether-v3_1_0')
      .reply(200, {
        answer: 42
      })

    const { result, waitFor } = renderHook(() => useAccountQuery(), { wrapper })

    await waitFor(() => {
      return result.current.isSuccess
    })

    expect(result.current).toEqual({ answer: 42 })
  })
})
Example #2
Source File: storage.js    From tako with MIT License 5 votes vote down vote up
window.queryCache = queryCache
Example #3
Source File: _app.jsx    From pooltogether-landing-site with MIT License 5 votes vote down vote up
queryCache = new QueryCache()