Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(vue): Fix regression causing pause argument to not be reactive #3595

Merged
merged 2 commits into from
May 27, 2024

Conversation

arkandias
Copy link
Contributor

Summary

Solves #3594 (comment)

Set of changes

This is just a quick fix for getting isPaused reactive, but there might be some issues with the reactivity of other parameters.

Copy link

changeset-bot bot commented May 25, 2024

🦋 Changeset detected

Latest commit: dbbfa37

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@urql/vue Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@kitten kitten changed the title Quick fix: isPaused was not reactive in useQuery and useSubscription fix(vue): Fix regression causing pause argument to not be reactive May 26, 2024
@kitten

This comment has been minimized.

@JoviDeCroock JoviDeCroock merged commit 41303ff into urql-graphql:main May 27, 2024
13 checks passed
@github-actions github-actions bot mentioned this pull request May 27, 2024
@negezor
Copy link
Contributor

negezor commented May 31, 2024

The type MaybeRef<T> = T | (() => T) | Ref<T>; is specified to support getters.

This is not working as it should at the moment:

const skip = ref(0);

const pokemons = await useQuery({
  query: gql`
    query ($skip: Int!) {
      pokemons(limit: 10, skip: $skip) {
        id
        name
      }
    }
  `,
  variables: { skip },
  pause: () => {
    return skip.value > 1000 || skip.value === -1
  },
});

Of course this can be solved using manual toRef() or computed(). But maybe we can replace it with toRef() by default? The only thing is that it will require vue 3.3+

@arkandias
Copy link
Contributor Author

Hi @negezor, I'm working on it. I'll make a PR very soon (with some other minor updates).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants