rsnext/examples/api-routes-graphql
Mahmoud Abdelwahab c3884e6837
Update graphql example (#27334)
## Documentation / Examples

This is an update to the [GraphQL example](https://github.com/vercel/next.js/tree/canary/examples/api-routes-graphql) to use [apollo server 3](https://www.apollographql.com/docs/apollo-server). This example works with Apollo Studio
2021-07-20 15:19:22 +00:00
..
pages Update graphql example (#27334) 2021-07-20 15:19:22 +00:00
.gitignore Added .gitignore to examples that are deployed to vercel (#15127) 2020-07-16 10:52:23 -04:00
package.json Update graphql example (#27334) 2021-07-20 15:19:22 +00:00
README.md docs: add 'Open in StackBlitz' buttons to various examples (#25853) 2021-06-08 20:45:02 +00:00

API routes with GraphQL server

Next.js ships with API routes, which provide an easy solution to build your own API. This example shows their usage alongside apollo-server-micro to provide simple GraphQL server consumed by Next.js app.

Preview

Preview the example live on StackBlitz:

Open in StackBlitz

Deploy your own

Deploy the example using Vercel:

Deploy with Vercel

How to use

Execute create-next-app with npm or Yarn to bootstrap the example:

npx create-next-app --example api-routes-graphql api-routes-graphql-app
# or
yarn create next-app --example api-routes-graphql api-routes-graphql-app

Deploy it to the cloud with Vercel (Documentation).