Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handler can be simplified #2

Open
capaj opened this issue Oct 7, 2021 · 0 comments
Open

Handler can be simplified #2

capaj opened this issue Oct 7, 2021 · 0 comments

Comments

@capaj
Copy link

capaj commented Oct 7, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant