TanStackT
TanStack2y ago
3 replies
awake-maroon

Is it possible to call a mutation inside of a Next.js server component?

I want to mutate data on our GraphQL backend but the component I'm in is a server component inside of a server component and I can't change it to a client component because you can't have client stuff inside server stuff.

Is it possible to run a mutation inside of a server component? For queries, I use
queryClient.fetchQuery
but there doesn't appear to be a similar method on
queryClient
.
Was this page helpful?