Questions on Queries and Mutations #5045
-
On https://react-query-v3.tanstack.com/guides/queries, what does the On https://react-query-v3.tanstack.com/guides/mutations, why is there an |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi 👋
It's the query function and is described above the example: A function that returns a promise that:
It's a POST request because it's a mutation that the POST verb suits best. TanStack Query can be used for any HTTP verb; it's agnostic of the actual network layer. Queries are commonly GET verbs and mutations are commonly anything else, although there's no hard rules 🙂 |
Beta Was this translation helpful? Give feedback.
Hi 👋
It's the query function and is described above the example:
A function that returns a promise that:
It's a POST request because it's a mutation that the POST verb suits best. TanStack Query can be used for any HTTP verb; it's agnostic of the actual network layer. Queries are commonly GET verbs and mutations are commonly anything else, although there's no hard…