Use apollo server 4 with next js api

I want to try apollo server with nextjs api. I can see only apollo-server-micro is used in all the places i searched. Since, the package is getting depreciated with the release of v4, what is the best way to use v4 with next js api

1 Like

Hey @heerthees, there’s already a Next integration available for v4. You can find it here: GitHub - apollo-server-integrations/apollo-server-integration-next: An Apollo Server integration for use with Next.js

Hey @trevor.scheer ,

Thanks for the information. That helps a lot

I know this might be an easy task but, I am not understanding the documentation on how to migrate to apollo server 4 . I am currently using Next JS as a framework. And this gist is my current configuration. What steps should I take? Apollo Server with micro-cors and apollo-server-micro · GitHub

What specifically are you having difficulty with in the migration guide? The guide pertains mostly to how you use the ApolloServer class itself.

You’ll also want to look at the Next integration’s README.

Good day Trevor, I checked and it was a very dumb mistake from my part. One of my env variables was not correct.
It is working now

1 Like