> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Reading objects

## Read one object

A point addresses one fact by its key, or by a `unique` field set:

```ts theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
import { query, role, t } from "@bijectionhq/bijection";

export const customer = query(
  { allow: [role.signedIn], args: { id: t.key(customers) } },
  (ctx, { id }) => ctx.get(customers(id)),
);
```

`ctx.get` answers the fact or `null`. `customers({ email })` reads by a
`unique: [["email"]]` set, and `stock({ warehouse, sku })` by a declared
multi-field `key`. Use `.pick("name", "email")` on the point to read fewer
fields, which also narrows the read set. `ctx.has(point)` answers only
whether the fact is present, which can carry a lower label than the fact.

## Read many

* `ctx.list(selection.first(n))` reads all of a bounded selection.
* `ctx.page(selection, { size, cursor })` reads one window and answers
  `{ facts, next }`; pass `next` back as `cursor`.
* `ctx.count(selection)` answers the exact number of facts.

Pass the requested size through to `ctx.page`. The kernel refuses an
oversized page with `Limit`. An API with a smaller window declares that
bound in its size argument.

## From the client

```ts theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
import { api } from "@bijectionhq/bijection/client";
const result = await client.query(api().customers.customer, { id });
if (result.ok) render(result.value);
```

In React, `useWatch(api<typeof App>().customers.customer, { id })` keeps the value
current, and `usePages` holds the pages of a paging query. See
[Reading](https://docs.bijection.com/database/reading.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.