Closed arkandias closed 1 month ago
Latest commit: dbbfa3747faff0835fb4eef924e76d01fd94c9d7
The changes in this PR will be included in the next version bump.
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
Hiya :wave: We'll need a patch changeset here to merge this, i.e. a changelog entry, e.g.
Fix regression causing
pause
argument onuseQuery
anduseSubscription
to not be reactive
I tried to quickly push one but push access for maintainers may not be enabled on your PR. You can read more about this here though ❤️ https://github.com/urql-graphql/urql/blob/main/CONTRIBUTING.md#how-do-i-document-a-change-for-the-changelog
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+
Hi @negezor, I'm working on it. I'll make a PR very soon (with some other minor updates).
Summary
Solves https://github.com/urql-graphql/urql/issues/3594#issue-2316403034
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.