Thanks for sharing
I want to give it a try man, I was 2 days ago trying to upload my graphql server to vercel but with no success I ended up going to heroku.
I noticed you have everything inside your api endpoint, but if you decided to have everything organized in different files and folders, would you keep all those files and folders inside the api folder ?
Yes, you can use whatever file strucutre makes sense and import as modules as necessary, and still leverage Next.js's file-based router convention (so in pages/api/foobar.js just import as modules any lib type code that you want to use).
So my first thought was:
Vercel basically allows you to deploy compiled frontend apps, so maybe I would need to compile the playground to present it as my frontend app and all my routes move them to lambdas.
But I didn't know in what direction to go so I just went with Heroku.
2 years ago I took Wes Bos' advanced react course with graphql and I was able to deploy the app in vercel, but that was before they added the new /api file structure.
Anyways, I'll try to update my code and upload it to vercel and if I have some problems deploying I might reach out for help :P
Gotcha. You can serve GraphQL Playground from a Next.js API Route. In Apollo Server 3 you'll just need to enable it via a plugin: apollographql.com/docs/apollo-serv...
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks for sharing
I want to give it a try man, I was 2 days ago trying to upload my graphql server to vercel but with no success I ended up going to heroku.
I noticed you have everything inside your api endpoint, but if you decided to have everything organized in different files and folders, would you keep all those files and folders inside the api folder ?
Hi Pako - what issues did you run into?
Yes, you can use whatever file strucutre makes sense and import as modules as necessary, and still leverage Next.js's file-based router convention (so in pages/api/foobar.js just import as modules any lib type code that you want to use).
So my first thought was:
Vercel basically allows you to deploy compiled frontend apps, so maybe I would need to compile the playground to present it as my frontend app and all my routes move them to lambdas.
But I didn't know in what direction to go so I just went with Heroku.
2 years ago I took Wes Bos' advanced react course with graphql and I was able to deploy the app in vercel, but that was before they added the new /api file structure.
Anyways, I'll try to update my code and upload it to vercel and if I have some problems deploying I might reach out for help :P
Gotcha. You can serve GraphQL Playground from a Next.js API Route. In Apollo Server 3 you'll just need to enable it via a plugin: apollographql.com/docs/apollo-serv...