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

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:

yarn install

Start the local GraphQL server:

yarn start:graphql

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

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:

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: