---
title: "ReferenceSchema"
description: "The schema `c.reference(collection)` returns: a Standard Schema that reads an entry id (a string) and outputs a [Reference](https://pitlane.tools/package/content/interface/Reference.md) into `collection`."
url: "https://pitlane.tools/package/content/type/ReferenceSchema"
---

# ReferenceSchema

```ts
import type { ReferenceSchema } from "@pitlane/content";
```

```ts
type ReferenceSchema<C> = ChainableSchema<string, Reference<C>>;
```

The schema `c.reference(collection)` returns: a Standard Schema that reads an entry id (a string) and outputs a [Reference](https://pitlane.tools/package/content/interface/Reference.md) into `collection`.

It composes inside `remix/data-schema`'s `s.object`, `s.array`, and `s.optional` like any other schema. It does not check that the target entry exists; a dangling id surfaces as `getEntry` resolving to `undefined`.

## Type Parameters

### C

`C` _extends_ `string`
