Next.js Server function with Tanstack Query

hello, I'm using Next.js with Tanstack Query, can I pass a server function to queryFn or I should use an Next API Route for the server function?
Was this page helpful?