next-playground puts a GraphQL API inside a Next.js app. It was pushed in a single commit in July 2019, within a day of the release of Next.js 9.0.0, which added API routes and built-in TypeScript support, and it uses both. It hasn’t been touched since, apart from Dependabot’s pull requests.
What’s in it
- An API route.
pages/api/graphql.tsruns Apollo Server (apollo-server-micro 2.6) as a Next.js API route. Its schema has asayHelloquery, which returns a value from the request context, and asignInmutation, which returns a placeholder token,"test", under a comment that reads “find user and create jwt”. The context function logs the request’sjwtcookie. - A sign-in page.
pages/index.tsxis a bare form with two text fields and a Submit button. Submitting runs thesignInmutation through graphql-hooks and saves the token in ajwtcookie with js-cookie. The fields aren’t wired up yet: the mutation sends hard-coded values instead of what’s typed. - Server-side rendering for queries. A wrapper around the app creates a graphql-hooks client, runs the page’s queries during server rendering with graphql-hooks-ssr, and hands the cached results to the browser through graphql-hooks-memcache.
There are also six empty page files, 1-think, 2-group, 3-vote, 4-discuss, 5-create-action-items and 6-assign-action-items. Their names read like the steps of a retrospective meeting, but none of them has any code.

How it’s built
It uses Next.js 9.0.0 with React 16.8, TypeScript 3.5 for the page and the API route, and apollo-server-micro 2.6.7 with graphql 14. The client side is graphql-hooks 3.6, with js-cookie for the token.
Running it today
It still installs from its lockfile and runs with Node 12. npm install, then npm run dev, serves the page on port 3000 and GraphQL Playground at /api/graphql. The page’s GraphQL client points at http://localhost:3000/api/graphql, so it expects that port.
The creation date shown here is the GitHub repository’s UTC creation date. The screenshot was captured from a local run of the repository with Node 12, and the code card shows the API route’s real source.