Skip to content

Handler can be simplified #2

@capaj

Description

@capaj

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions