Matt LuoM
Convex Communityβ€’2y agoβ€’
4 replies
Matt Luo

passing json to convex mutation

Do you know of any examples of passing a JSON to a mutation? I am able to accomplish this on the client side of Next.js but not on the server side.

My use case is that after I have finished streaming a structured response in the actions.ts of this Vercel AI SDK tutorial (https://sdk.vercel.ai/examples/next-app/basics/streaming-object-generation), then I want to insert the object (essentially, it's a JSON) in the Convex DB by creating a Convex DB document per JSON element.

I am able to accomplish a successful save on the client side, the app/page.tsx of this tutorial, but only with the end user clicking a save button
Was this page helpful?