I have a server function called:
const signInWithGoogle = createServerFn({ method: "POST" })
.validator((data: unknown) =>
z.object({ code: z.string(), state: z.string() }).parse(data)
)
.handler(async ({ data }) => ...);
data is typed correctly within the handler but when I call it via:
const { mutateAsync } = useMutation({
mutationFn: signInWithGoogle,
});
await signInWithGoogle();
no errors are displayed even though the object is required.
What am I doing wrong?
Thanks