Can useQuery be used for simple POSTs? #1107
-
I tried using useMutate for this post and failed, so then reverted to trying it with useQuery and failed. Is it correct that you may not use useQuery to make a post? Here's a sandbox where I attempt this that seems to perform the fetch (see console) but results in the error,
If useQuery may not POST, I can do another version where I fail to make this work with useMutate. Any feedback appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hi @banagale. It looks like you're calling the fetchSessionToken not passing a callback to be invoked later. If you change the useQuery to
and the h2 to: |
Beta Was this translation helpful? Give feedback.
Hi @banagale.
It looks like you're calling the fetchSessionToken not passing a callback to be invoked later. If you change the useQuery to
and the h2 to:
<h2>{data.title}</h2>
it seems to work for me. Here is a working fork too