Skip to content

Any way to pause URQL query when using atomWithQuery? #608

Closed Answered by dai-shi
ricardovanh asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, very nice to see someone trying jotai/uqrl integration. Happy to help, but bear with me as I'm not super familiar with urql.

For a start, we discussed about something.
#463 (comment)
Let me know if that makes sense or not.

As far as I understand, the suggestion was:

const baseAtom = atomWithQuery(
  (get) => ({
    query: 'query goes here...',
    variables: {
      someKey: get(asyncValueAtom)
    },
  }),
  () => client
)

const dataAtom = atom((get) => get(asyncValueAtom) !== null && get(baseAtom))

The general idea is to follow useQuery use cases. I wonder if useQuery suspends (with <Suspense>) with pause?

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ricardovanh
Comment options

@dai-shi
Comment options

Answer selected by ricardovanh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants