This is a question regarding Graphql + Next.js , i...
# orm-help
o
This is a question regarding Graphql + Next.js , in the recent video series why was the graphql API made using Next.js API routes and not a server, what benefits does it have over a server (apart from cost)
v
@Mahmoud ^^
🙌 1
m
Hey Octal👋🏼 There are a couple of benefits of using Next.js API routes rather than a traditional server. • Developer experience: it’s easier to have one project with frontend and backend • When deploying to Vercel, API routes become serverless functions. This means is you don’t have to worry about Scalability or provisioning your own server • With serverless computing you only pay for what you use, which is cheaper (I’m not 100% sure of the cost difference so I’ll need to dig into it) Of course Serverless also has tradeoffs. For example you can’t do realtime (eg. GraphQL subscriptions) because it needs a stateful connection