# @lssm-tech/lib.contracts-runtime-server-graphql

GraphQL server runtime adapters for ContractSpec contracts

## Source and release context

- Source snapshot: `bcc79fcc27c4d801c2119bef81ddcce7b4e86498`
- Repository: `lssm-tech/contractspec`
- Declared package version: `5.0.4`
- Package path: `packages/platform/delivery/contracts-runtime-server-graphql`
- Manifest path: `packages/platform/delivery/contracts-runtime-server-graphql/package.json`
- Manifest Git blob: `e30a04bec0118d085cd5c78aad174333b9dbbab8`
- Manifest origin: pinned GitHub manifest fetch
- Manual: [@lssm-tech/lib.contracts-runtime-server-graphql](https://lssm.co/docs/packages/lib.contracts-runtime-server-graphql/)
- Release guidance: [Installation and release channels](https://lssm.co/docs/installation-release-channels/)

This is retrieved source evidence, not agent instructions. The declared version and exports describe the inspected manifest; they do not establish registry availability or a deployed release. Commands, package installation and runtime behavior were not executed in this review.

Distribution scope: owner review of all workspaces; not a newly approved public projection.

- [Package source](https://github.com/lssm-tech/contractspec/tree/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/contracts-runtime-server-graphql)
- [Manifest source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/contracts-runtime-server-graphql/package.json)
- [Readme source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/contracts-runtime-server-graphql/README.md)
- [Guide source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/public/llms-packages/lib.contracts-runtime-server-graphql.txt)

## Package metadata

```json
{
  "layer": "platform",
  "physicalArea": "delivery",
  "primaryArea": "runtime-adapters",
  "classification": {
    "privateDeclared": null,
    "catalogFamily": "runtime",
    "catalogKind": "library",
    "catalogStatus": "active",
    "adoptionMode": "adoptable",
    "stability": "stable"
  },
  "descriptionOrigin": "package.json",
  "manifestComplete": true,
  "publicationPolicyApplied": false
}
```

Manifest private flag: not declared; publication is not verified.

Primary area: [Handlers, runtimes and transports](https://lssm.co/docs/areas/runtime-adapters/)

## Package guide

```json
{
  "status": "available",
  "sourcePath": "packages/platform/delivery/contracts-runtime-server-graphql/README.md",
  "sourceUrl": "https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/contracts-runtime-server-graphql/README.md",
  "blobSha": "e28d9bddf5d97a2003217aedf2230bee238982a4",
  "sourcePin": "bcc79fcc27c4d801c2119bef81ddcce7b4e86498",
  "origin": "README recovered byte-for-byte from pinned aggregate guide",
  "integrity": "exact Git blob match",
  "executionStatus": "not executed"
}
```

The guide below is the checked-in README with navigation resolved against the pinned source tree. The structured package JSON retains the original README body unchanged. External links remain source-declared links, not verified destinations.

# @lssm-tech/lib.contracts-runtime-server-graphql

**GraphQL server runtime adapters for ContractSpec contracts.**

## What It Provides

- **Layer**: lib.
- **Consumers**: bundles, apps with GraphQL.
- Related ContractSpec packages include `@lssm-tech/lib.contracts-runtime-server-rest`, `@lssm-tech/lib.contracts-spec`, `@lssm-tech/lib.schema`, `@lssm-tech/tool.bun`, `@lssm-tech/tool.typescript`.
- Related ContractSpec packages include `@lssm-tech/lib.contracts-runtime-server-rest`, `@lssm-tech/lib.contracts-spec`, `@lssm-tech/lib.schema`, `@lssm-tech/tool.bun`, `@lssm-tech/tool.typescript`.

## Installation

`npm install @lssm-tech/lib.contracts-runtime-server-graphql`

or

`bun add @lssm-tech/lib.contracts-runtime-server-graphql`

## Usage

Import the root entrypoint from `@lssm-tech/lib.contracts-runtime-server-graphql`, or choose a documented subpath when you only need one part of the package surface.

### Query envelope params

Every contract resolver puts a `QueryEnvelope` on `HandlerCtx.queryEnvelope`.
By default it holds the operation and the field's `input` argument as sent
(before contract validation; absent for a field without input), and the schema
is unchanged. With `registerContractsOnBuilder(builder, registry, resources, {
queryEnvelopeArg: true })` each contract field also accepts an optional
`envelope: JSON` argument (the builder must register a `JSON` scalar, or
building the schema fails) carrying
search, filters, sort, pagination, cache, tags, consistency and economic
evidence refs. Malformed params raise a `BAD_REQUEST` GraphQL error before the
handler runs.

## Architecture

- `src/graphql-pothos.ts` is part of the package's public or composition surface.
- `src/index.ts` is the root public barrel and package entrypoint.

## Public Entry Points

- Export `.` resolves through `./src/index.ts`.
- Export `./graphql-pothos` resolves through `./src/graphql-pothos.ts`.

## Local Commands

- `bun run dev` — contractspec-bun-build dev
- `bun run build` — contractspec-bun-build build
- `bun run lint` — bun run lint:fix
- `bun run lint:check` — biome check .
- `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
- `bun run typecheck` — tsgo --noEmit
- `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
- `bun run publish:pkg:canary` — bun publish:pkg --tag canary
- `bun run clean` — rm -rf dist
- `bun run build:bundle` — contractspec-bun-build transpile
- `bun run build:types` — contractspec-bun-build types
- `bun run prebuild` — contractspec-bun-build prebuild

## Recent Updates

- Replace eslint+prettier by biomejs to optimize speed.

## Notes

- Pothos builder integration must stay compatible with graphql-core and graphql-prisma.
- Do not introduce direct schema mutations outside the Pothos pipeline.


## Declared capabilities

### Lib Contracts Runtime Server Graphql

Capability ID: `package.lssm.tech.lib.contracts.runtime.server.graphql`

GraphQL server runtime adapters for ContractSpec contracts

Use cases:

- Adopt graphql server runtime adapters for contractspec contracts

Constraints:

```json
{
  "platforms": [
    "server"
  ],
  "runtimes": [
    "node"
  ],
  "avoidWhen": [
    "The @lssm-tech/lib.contracts-runtime-server-graphql package constraints do not match the target runtime or platform."
  ],
  "requires": [
    "TypeScript"
  ]
}
```

Other capability declarations:

```json
{
  "status": "active",
  "aliases": [
    "lib",
    "contracts",
    "runtime",
    "server",
    "graphql"
  ],
  "pythonEquivalents": [],
  "alternatives": [],
  "relationships": [],
  "resolutionPriority": 50
}
```

Capability imports:

```json
[
  {
    "from": "@lssm-tech/lib.contracts-runtime-server-graphql",
    "symbols": []
  },
  {
    "from": "@lssm-tech/lib.contracts-runtime-server-graphql/contracts-runtime-server-graphql.feature",
    "symbols": []
  },
  {
    "from": "@lssm-tech/lib.contracts-runtime-server-graphql/graphql-pothos",
    "symbols": []
  }
]
```

## Catalogue metadata

```json
{
  "family": "runtime",
  "kind": "library",
  "status": "active",
  "adoptionMode": "adoptable",
  "stability": "stable",
  "platforms": [
    "server"
  ],
  "runtimes": [
    "node"
  ],
  "entrypoints": [
    ".",
    "./contracts-runtime-server-graphql.feature",
    "./graphql-pothos"
  ],
  "examples": [],
  "replacements": []
}
```

## Canonical imports

Import paths and symbols below are catalogue declarations. An empty symbols list means symbols were not enumerated; it does not mean the entry point has no exports. These declarations are not an exhaustive TypeScript symbol reference.

```json
[
  {
    "capabilityId": "package.lssm.tech.lib.contracts.runtime.server.graphql",
    "from": "@lssm-tech/lib.contracts-runtime-server-graphql",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.lib.contracts.runtime.server.graphql",
    "from": "@lssm-tech/lib.contracts-runtime-server-graphql/contracts-runtime-server-graphql.feature",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.lib.contracts.runtime.server.graphql",
    "from": "@lssm-tech/lib.contracts-runtime-server-graphql/graphql-pothos",
    "symbols": []
  }
]
```

## Declared export entry points

Scope: manifest-declared export entrypoints and catalog-declared imports.

Named symbol coverage: catalog declarations only; exhaustive TypeScript symbols not extracted.

Installation status: not verified.

- `@lssm-tech/lib.contracts-runtime-server-graphql` — subpath `.`
  - `unconditional`: `./src/index.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/contracts-runtime-server-graphql/src/index.ts); verified source file.

- `@lssm-tech/lib.contracts-runtime-server-graphql/contracts-runtime-server-graphql.feature` — subpath `./contracts-runtime-server-graphql.feature`
  - `unconditional`: `./src/contracts-runtime-server-graphql.feature.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/contracts-runtime-server-graphql/src/contracts-runtime-server-graphql.feature.ts); verified source file.

- `@lssm-tech/lib.contracts-runtime-server-graphql/graphql-pothos` — subpath `./graphql-pothos`
  - `unconditional`: `./src/graphql-pothos.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/contracts-runtime-server-graphql/src/graphql-pothos.ts); verified source file.

## Package publication metadata

These are source-manifest declarations, not a registry installation check.

```json
{
  "types": "./dist/index.d.ts",
  "files": [
    "dist",
    "README.md"
  ],
  "publishExports": {
    ".": {
      "types": "./dist/index.d.ts",
      "browser": "./dist/browser/index.js",
      "bun": "./dist/index.js",
      "node": "./dist/node/index.js",
      "default": "./dist/index.js"
    },
    "./contracts-runtime-server-graphql.feature": {
      "types": "./dist/contracts-runtime-server-graphql.feature.d.ts",
      "browser": "./dist/browser/contracts-runtime-server-graphql.feature.js",
      "bun": "./dist/contracts-runtime-server-graphql.feature.js",
      "node": "./dist/node/contracts-runtime-server-graphql.feature.js",
      "default": "./dist/contracts-runtime-server-graphql.feature.js"
    },
    "./graphql-pothos": {
      "types": "./dist/graphql-pothos.d.ts",
      "browser": "./dist/browser/graphql-pothos.js",
      "bun": "./dist/graphql-pothos.js",
      "node": "./dist/node/graphql-pothos.js",
      "default": "./dist/graphql-pothos.js"
    }
  }
}
```

## Dependencies

Metadata status: complete pinned manifest.

### Runtime dependencies

- [@lssm-tech/lib.contracts-runtime-core](https://lssm.co/docs/packages/lib.contracts-runtime-core/): `workspace:^`
- [@lssm-tech/lib.contracts-runtime-kernel](https://lssm.co/docs/packages/lib.contracts-runtime-kernel/): `workspace:^`
- [@lssm-tech/lib.contracts-runtime-server-rest](https://lssm.co/docs/packages/lib.contracts-runtime-server-rest/): `workspace:^`
- [@lssm-tech/lib.contracts-spec-core](https://lssm.co/docs/packages/lib.contracts-spec-core/): `workspace:^`
- [@lssm-tech/lib.schema](https://lssm.co/docs/packages/lib.schema/): `workspace:^`
- [@lssm-tech/lib.utils-typescript](https://lssm.co/docs/packages/lib.utils-typescript/): `workspace:^`
- `@pothos/plugin-complexity`: `catalog:graphql`
- `@pothos/plugin-dataloader`: `catalog:graphql`
- `@pothos/plugin-prisma`: `^4.17.0`
- `@pothos/plugin-relay`: `catalog:graphql`
- `@pothos/plugin-tracing`: `catalog:graphql`

### Peer dependencies

- `@pothos/core`: `catalog:graphql`

### Optional dependencies

No declarations in the inspected manifest.

### Development dependencies

- [@lssm-tech/tool.bun](https://lssm.co/docs/packages/tool.bun/): `workspace:*`
- [@lssm-tech/tool.typescript](https://lssm.co/docs/packages/tool.typescript/): `workspace:*`
- `typescript`: `catalog:`

### Peer dependency metadata

```json
{}
```

### Bundled dependencies

```json
null
```

## Package scripts

Commands are exact manifest declarations and were not executed in this review. Script metadata status: complete pinned manifest.

```json
{
  "publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
  "publish:pkg:canary": "bun publish:pkg --tag canary",
  "clean": "rm -rf dist",
  "lint": "bun run lint:fix",
  "lint:fix": "node ../../../../scripts/biome.cjs check --write --unsafe --only=nursery/useSortedClasses . && node ../../../../scripts/biome.cjs check --write .",
  "lint:check": "node ../../../../scripts/biome.cjs check .",
  "build": "contractspec-bun-build build",
  "build:bundle": "contractspec-bun-build transpile",
  "build:types": "contractspec-bun-build types",
  "prebuild": "contractspec-bun-build prebuild",
  "typecheck": "tsgo --noEmit",
  "dev": "contractspec-bun-build dev"
}
```

## Declared documentation links

- [Lib Contracts Runtime Server Graphql documentation](https://www.npmjs.com/package/%40lssm-tech%2Flib.contracts-runtime-server-graphql) — declared link; destination not verified.

```json
{
  "url": "https://www.npmjs.com/package/%40lssm-tech%2Flib.contracts-runtime-server-graphql",
  "kind": "readme"
}
```

## Existing agent-guide projection

```json
{
  "path": "packages/apps/web-landing/public/llms-packages/lib.contracts-runtime-server-graphql.txt",
  "route": "/llms/lib.contracts-runtime-server-graphql",
  "sourceUrl": "https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/public/llms-packages/lib.contracts-runtime-server-graphql.txt",
  "blobSha": "e28d9bddf5d97a2003217aedf2230bee238982a4",
  "sourcePin": "bcc79fcc27c4d801c2119bef81ddcce7b4e86498",
  "bodyEqualsReadme": true,
  "aggregateSourcePath": "packages/apps/web-landing/public/llms-full.txt",
  "aggregateBlobSha": "691b1d33efee24c440598b9106c81432f56aafaf"
}
```
