mutations?
Opened this issue · 4 comments
You think it would make sense to add support for RSC mutations?
You mean in the sense of server actions? Could you expand a little on what you mean exactly?
You should already be able to execute regular mutations in client components.
I have a callback url that's called with some query parameters and I need to run a mutation on the server with them. I would like to do it on the RSC rather than on the client.
I would like it to be a RSC so I can display a message while the operation is running
I'm sorry, but I still don't fully understand what you mean. With useMutation you get an indicator that the mutation is running so you can use that to display the in-progress message on the client.
I'm sorry, I wasn't clear. I have 3 options:
Client component
Server action
Server component
The first can't access secrets
The second can't render react
The third can do both. But can't currently execute mutations.
I was thinking it would be nice if mutations were supported and allowed to stream the mutation response once complete. So that the RSC can update what it's displaying after the mutation is done.
For now I moved all the logic (secrets included) into the graphql resolver logic and I'm running the mutation in a useEffect on page load, but still having a way to trigger the mutation without client side JavaScript would be awesome