Skip to content

client.query does not obey requestPolicy "network-only" #2183

Answered by kitten
villesau asked this question in Q&A
Discussion options

You must be logged in to vote

Hiya ✌️

That's expected behaviour. To a certain extent, even without a cache it's expected that queries behave consistently and predictably — in other words, are side-effect free. It's likely a better idea to model your generation of upload URLs as a mutation instead if you're semi-randomly (at least as it looks from the outside) returning differing values.
Otherwise urql may always assume, at least via the dedupExchange that the same query is repeatable. Even the Client itself groups queries in the interest of avoiding work and registering whether a query is currently "active" or not by its key

As per the spec; https://spec.graphql.org/October2021/#sec-Mutation

It is expected that the t…

Replies: 4 comments 11 replies

Comment options

You must be logged in to vote
5 replies
@villesau
Comment options

@villesau
Comment options

@kitten
Comment options

@thojanssens
Comment options

@kitten
Comment options

Answer selected by kitten
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@kitten
Comment options

@nandorojo
Comment options

@nandorojo
Comment options

@gus-t27
Comment options

@nandorojo
Comment options

Comment options

You must be logged in to vote
1 reply
@nandorojo
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants
Converted from issue

This discussion was converted from issue #2182 on January 08, 2022 20:39.