PabloSzx/next-fastify-mercurius-vercel

Handler can be simplified

capaj opened this issue · 0 comments

capaj commented

export const apiHandler: NextApiHandler<unknown> = async (nextRequest, nextResponse) => {

you should be able to just write it exactly as in here:
https://github.com/capaj/vercel-serverless-mercurius-sample-api/blob/b33fa2cd590b11d1565cad75fdda3bc08a5cb152/api/graphql.ts#L65-L68

also you are not wawiting the app.ready() which should be alright in this case, but if anyone ever adds an async plugin it could cause issues