zidZ
Convex Community2y ago
8 replies
zid

Using convex server-side (nextJS api routes)

Having some trouble getting convex to work inside NextJS api routes.
This is inside /api/fn.js
The mutation fn is defined but the fn is not executing..

import { mutation } from "@/convex/_generated/server";

// ...
        await mutation(async ({ db }, { arg1, arg2 }) => {

          await db.patch(userId, {
            // ...
          });

        });
Was this page helpful?