reexecuteQuery not using new variables #3469
-
Describe the bugI am using urql version 4.0.5. For fetching data i am calling below request using useQuery hook. For fetching new user data i am calling reexecuteQuery as per document, but it not working.
ReproductionreexecuteQuery({ variables: { userId: 3 } }); Urql version4.0.5 Validations
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Okay, got it now. thanks |
Beta Was this translation helpful? Give feedback.
-
|
As per the TSDocs/TypeScript typings and our docs,
This is also not a pattern that makes much sense. As per the issue template, I'm converting this to a discussion, since it's a usage issue/question |
Beta Was this translation helpful? Give feedback.
As per the TSDocs/TypeScript typings and our docs,
executeQueryis not a state setter and does not acceptvariables. It accepts anOperationContextobject:This is also not a pattern that makes much sense.
Either, you need to track your variables in state, and update that state, as it's an input to
useQuery, or, if you're doing programmatic queries, you can use theClientdirectly (e.g. viauseClient)As per the issue template, I'm converting this to a discussion, since it's a usage issue/question