Next.js Conf
Shadid Haque

Shadid Haque

@HaqueShadid

Developer Advocate at Fauna

About

Travel enthusiast and a mediocre dancer turned full-time software engineer. Shadid is on a mission to help developers build the next generation of apps with serverless and JamStack tech. He is a developer advocate at Fauna Inc. Say hi to Shadid on Twitter at @HaqueShadid and read his blog at dev.to/shadid12.

Watch their Session

How to build a GraphQL API with Next.js and Vercel

In my talk, I would like to share how my team and I built a serverless GraphQL API with Next.js and Vercel. During my time on the stage, I will make a simple version of the application we shipped. So why would you want to build a GraphQL API with Next.js? Suppose you have a Next.js application interacting with many small microservices and third-party data sources. You might want to consider combining these into a single GraphQL service. Doing so will reduce complexity in your client-side code. You can build a GraphQL service inside your Next.js API layer. That way, you don't have to create and maintain an entirely new application. Your GraphQL code will live in the same repository as your Next.js client code, making it easier to develop common modules. Finally, when you deploy your application to Vercel, it turns your GraphQL API into a serverless function. You don't have to deal with scaling your application as it will auto-scale. As you deploy your GraphQL service through Vercel, you don't have to deal with any DevOps overhead. You can use the same CI/CD pipeline as your Next.js application. In my talk, I will demonstrate these concepts. I will also share the challenges my team faced and the solutions we came up with while building this application.