# dev.frogspace.stacks.query

> Published by [spacefrog.dev](https://lexicon.garden/identity/did:plc:b3ddarwfwuulrq7p2cfwhvmz)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:b3ddarwfwuulrq7p2cfwhvmz/dev.frogspace.stacks.query)
- [Documentation](https://lexicon.garden/lexicon/did:plc:b3ddarwfwuulrq7p2cfwhvmz/dev.frogspace.stacks.query/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:b3ddarwfwuulrq7p2cfwhvmz/dev.frogspace.stacks.query/examples)

## Definitions

### `dev.frogspace.stacks.query#filter`

**Type**: `object`

structured filter over saved citations. all fields are optional; an empty filter matches everything.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `addedAfter` | `string` (datetime) | No | the item must have been saved at or after this time. |
| `addedBefore` | `string` (datetime) | No | the item must have been saved at or before this time. |
| `collection` | `string` (at-uri) | No | the item must belong to this collection record AT-URI. |
| `ratingMax` | `integer` | No | the item rating must be at most this value. |
| `ratingMin` | `integer` | No | the item rating must be at least this value. |
| `readState` | `string` | No | the item read state must equal this value. |
| `subjectType` | `string` (nsid) | No | the subject's collection NSID must equal this value (e.g. app.bsky.feed.post). |
| `tagsAll` | `array` | No | the item must carry every one of these tags. |
| `tagsAny` | `array` | No | the item must carry at least one of these tags. |

### `dev.frogspace.stacks.query`

**Type**: `record`

a named saved query: a structured filter over the owner's saved citations, evaluated client-side. no free-text grammar.

**Key**: `tid`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `createdAt` | `string` (datetime) | Yes | time the query was saved. preserve it when editing. |
| `filter` | `ref` → `#filter` | Yes | closed filter object. all fields are optional; an empty filter matches every saved citation. clients reject unknown keys. |
| `name` | `string` | Yes | human-readable query name, at most 128 graphemes. |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "filter": {
      "description": "structured filter over saved citations. all fields are optional; an empty filter matches everything.",
      "properties": {
        "addedAfter": {
          "description": "the item must have been saved at or after this time.",
          "format": "datetime",
          "type": "string"
        },
        "addedBefore": {
          "description": "the item must have been saved at or before this time.",
          "format": "datetime",
          "type": "string"
        },
        "collection": {
          "description": "the item must belong to this collection record AT-URI.",
          "format": "at-uri",
          "type": "string"
        },
        "ratingMax": {
          "description": "the item rating must be at most this value.",
          "maximum": 5,
          "minimum": 1,
          "type": "integer"
        },
        "ratingMin": {
          "description": "the item rating must be at least this value.",
          "maximum": 5,
          "minimum": 1,
          "type": "integer"
        },
        "readState": {
          "description": "the item read state must equal this value.",
          "knownValues": [
            "unread",
            "reading",
            "read"
          ],
          "type": "string"
        },
        "subjectType": {
          "description": "the subject's collection NSID must equal this value (e.g. app.bsky.feed.post).",
          "format": "nsid",
          "type": "string"
        },
        "tagsAll": {
          "description": "the item must carry every one of these tags.",
          "items": {
            "maxGraphemes": 64,
            "maxLength": 256,
            "type": "string"
          },
          "maxLength": 32,
          "type": "array"
        },
        "tagsAny": {
          "description": "the item must carry at least one of these tags.",
          "items": {
            "maxGraphemes": 64,
            "maxLength": 256,
            "type": "string"
          },
          "maxLength": 32,
          "type": "array"
        }
      },
      "type": "object"
    },
    "main": {
      "description": "a named saved query: a structured filter over the owner's saved citations, evaluated client-side. no free-text grammar.",
      "key": "tid",
      "record": {
        "properties": {
          "createdAt": {
            "description": "time the query was saved. preserve it when editing.",
            "format": "datetime",
            "type": "string"
          },
          "filter": {
            "description": "closed filter object. all fields are optional; an empty filter matches every saved citation. clients reject unknown keys.",
            "ref": "#filter",
            "type": "ref"
          },
          "name": {
            "description": "human-readable query name, at most 128 graphemes.",
            "maxGraphemes": 128,
            "maxLength": 512,
            "type": "string"
          }
        },
        "required": [
          "name",
          "filter",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "id": "dev.frogspace.stacks.query",
  "lexicon": 1
}
```
