# social.grain.comment.defs

- Kind: defs
- Authority: comment.grain.social
- Lexicon: 1
- Published by [grain.social](https://lexicon.garden/identity/did:plc:e7rftrdyz5e2rw4y6ocszew2), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:e7rftrdyz5e2rw4y6ocszew2/social.grain.comment.defs)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:e7rftrdyz5e2rw4y6ocszew2/social.grain.comment.defs/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:e7rftrdyz5e2rw4y6ocszew2/social.grain.comment.defs/analytics)

## #commentView (`social.grain.comment.defs#commentView`)

Type: object

### Properties

- `author` (ref, required)
  - Reference: `social.grain.actor.defs#profileView`
- `cid` (string · cid, required)
- `createdAt` (string · datetime, required)
- `facets` (array): Annotations of description text (mentions and URLs, hashtags, etc)
  - `items` (ref)
    - Reference: `app.bsky.richtext.facet`
- `favCount` (integer)
- `focus` (union): The photo that the comment is focused on, if applicable.
  - One of: `social.grain.photo.defs#photoView`
- `muted` (boolean): True if the viewer has muted the comment author. Client should show collapsed with option to expand.
- `record` (unknown)
- `replyTo` (string · at-uri): The URI of the comment this comment is replying to, if applicable.
- `subject` (union): The subject of the comment, which can be a gallery or a photo.
  - One of: `social.grain.gallery.defs#galleryView`
- `text` (string, required)
  - Constraints: maxLength: 3000, maxGraphemes: 300
- `uri` (string · at-uri, required)
- `viewer` (ref)
  - Reference: `#viewerState`

## #viewerState (`social.grain.comment.defs#viewerState`)

Type: object

Metadata about the requesting account's relationship with the comment. Only has meaningful content for authed requests.

### Properties

- `fav` (string · at-uri)

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "commentView": {
      "properties": {
        "author": {
          "ref": "social.grain.actor.defs#profileView",
          "type": "ref"
        },
        "cid": {
          "format": "cid",
          "type": "string"
        },
        "createdAt": {
          "format": "datetime",
          "type": "string"
        },
        "facets": {
          "description": "Annotations of description text (mentions and URLs, hashtags, etc)",
          "items": {
            "ref": "app.bsky.richtext.facet",
            "type": "ref"
          },
          "type": "array"
        },
        "favCount": {
          "type": "integer"
        },
        "focus": {
          "description": "The photo that the comment is focused on, if applicable.",
          "refs": [
            "social.grain.photo.defs#photoView"
          ],
          "type": "union"
        },
        "muted": {
          "description": "True if the viewer has muted the comment author. Client should show collapsed with option to expand.",
          "type": "boolean"
        },
        "record": {
          "type": "unknown"
        },
        "replyTo": {
          "description": "The URI of the comment this comment is replying to, if applicable.",
          "format": "at-uri",
          "type": "string"
        },
        "subject": {
          "description": "The subject of the comment, which can be a gallery or a photo.",
          "refs": [
            "social.grain.gallery.defs#galleryView"
          ],
          "type": "union"
        },
        "text": {
          "maxGraphemes": 300,
          "maxLength": 3000,
          "type": "string"
        },
        "uri": {
          "format": "at-uri",
          "type": "string"
        },
        "viewer": {
          "ref": "#viewerState",
          "type": "ref"
        }
      },
      "required": [
        "uri",
        "cid",
        "author",
        "text",
        "createdAt"
      ],
      "type": "object"
    },
    "viewerState": {
      "description": "Metadata about the requesting account's relationship with the comment. Only has meaningful content for authed requests.",
      "properties": {
        "fav": {
          "format": "at-uri",
          "type": "string"
        }
      },
      "type": "object"
    }
  },
  "id": "social.grain.comment.defs",
  "lexicon": 1
}
```
