Best pattern to re-execute queries, e.g. to do something on server every time I need #1290
-
I'm unsure which code is best to use for when I need to call a query multiple times. Example: I want to print something on the server every time I click a button. It is not a mutation. I think a query is best. But how can you always call the same? I read here: https://formidable.com/open-source/urql/docs/basics/queries/#reexecuting-queries-1, but I don't find a good pattern. What do you think? Am I wrong to use urql for this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I think I should use a mutation here. |
Beta Was this translation helpful? Give feedback.
-
Well if you always want it to go to the server it's best to use a |
Beta Was this translation helpful? Give feedback.
Well if you always want it to go to the server it's best to use a
mutation
as you can leverage queries to be cached, .... this kind off feels like triggering a side-effect so for me personally I'd gravitate towards amutation