https://github.com/2wce/api-routes-graphql
https://github.com/2wce/api-routes-graphql
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/2wce/api-routes-graphql
- Owner: 2wce
- Created: 2021-02-28T11:32:03.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-08T00:25:04.000Z (over 3 years ago)
- Last Synced: 2025-02-01T12:12:11.563Z (over 1 year ago)
- Language: JavaScript
- Homepage: api-routes-graphql-kappa.vercel.app
- Size: 239 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# API routes with GraphQL server
Next.js ships with [API routes](https://github.com/vercel/next.js#api-routes), which provide an easy solution to build your own `API`. This example shows their usage alongside [apollo-server-micro](https://github.com/apollographql/apollo-server/tree/main/packages/apollo-server-micro) to provide simple GraphQL server consumed by Next.js app.
## Deploy your own
Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=next-example):
[](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/api-routes-graphql&project-name=api-routes-graphql&repository-name=api-routes-graphql)
## How to use
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:
```bash
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](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).