# Vyriy Preset GraphQL API

Calm cloud-ready GraphQL application.

Published: 2026-06-04
Tags: vyriy, preset, graphql, api, cli
Source: https://vyriy.dev/examples/vyriy-preset-graphql/

---

# Vyriy Preset - GraphQL API

Calm cloud-ready GraphQL application.

This repository is a Yarn workspace monorepo with a reusable GraphQL API package and a runtime workspace that serves it over HTTP.

## Create this example

```bash
npm create vyriy@latest
```

Choose the `gql` preset.

## Requirements

- Node.js `>=24.0.0`
- Yarn `4.16.0`

## Workspaces

- `packages/graphql` - reusable `@p/graphql` package that owns the GraphQL schema, embedded GraphiQL page, and public router export.
- `workspaces/graphql` - `@w/graphql` runtime workspace that mounts the shared router through `@vyriy/handler` and `@vyriy/server`.

## Development

Install dependencies:

```bash
yarn install
```

Start the local GraphQL server:

```bash
yarn start:graphql
```

Open `http://localhost:3000` to use GraphiQL, or send a request directly:

```bash
curl http://localhost:3000 \
  --header 'Content-Type: application/json' \
  --data '{"query":"{ hello test { ok message } }"}'
```

## Scripts

- `yarn start` - starts all runtime workspaces.
- `yarn start:graphql` - starts the GraphQL HTTP server.
- `yarn build` - builds all deployable outputs.
- `yarn build:graphql` - builds the GraphQL runtime to `dist/graphql`.
- `yarn test` - runs the Jest test suite.
- `yarn lint` - runs TypeScript, Prettier, and ESLint checks.
- `yarn check` - runs linting, builds, and tests.

## GraphQL

The root endpoint is handled by `@p/graphql`:

- `GET /` serves the embedded GraphiQL page.
- `POST /` executes GraphQL requests.

Current schema fields:

```graphql
type Query {
  hello: String
  test: Test
}

type Test {
  ok: Boolean
  message: String
}

type Mutation {
  ping(message: String): String
}
```

See the package and runtime READMEs for the detailed API and deployment notes:

- `packages/graphql/README.md`
- `workspaces/graphql/README.md`

## Project Guidance

These articles describe the development approach behind this preset and provide practical guidance for evolving a project on top of it:

- [Calm Development Environment: Node.js, Corepack, Yarn and Static Preview](https://vyriy.dev/blog/calm-development-setup/) - how to keep the local development environment predictable and easy to reproduce.
- [Calm App Structure for the Vyriy Ecosystem](https://vyriy.dev/blog/vyriy-calm-app-structure/) - a practical project structure for Vyriy applications: shared configs, small packages, thin workspaces, Storybook docs, tests, and deployable entry points.
- [One Handler, Many Runtimes](https://vyriy.dev/examples/one-handler-many-runtimes/) - how @vyriy/handler, @vyriy/router, and @vyriy/server compose a calm Lambda-compatible API that can run locally, in Docker, Fargate-style HTTP runtimes, and AWS Lambda.
- [Storybook as Project Documentation](https://vyriy.dev/blog/storybook-as-project-documentation/) - how to use Storybook as living project documentation and a component playground.
