Sanity Library Reference Docs
    Preparing search index...

    A document the reactive layer should subscribe to, with its GDR exploded so consumers never re-parse: the resource-addressing parts (from ParsedGdr), the round-trip globalDocumentId URI, and the target doc's schema _type. The resource parts let an adapter detect refs pointing at a project/dataset/resource it isn't configured for; type feeds per-doc handles (useDocument / editState).

    interface SubscriptionDocument {
        dataset?: string;
        documentId: string;
        globalDocumentId:
            | `dataset:${string}`
            | `canvas:${string}`
            | `media-library:${string}`
            | `dashboard:${string}`;
        projectId?: string;
        resourceId?: string;
        scheme: GdrScheme;
        type: string;
    }

    Hierarchy (View Summary)

    Index

    Properties

    dataset?: string

    For dataset: <dataset>

    documentId: string

    The trailing <documentId> part — what _id of the target doc is

    globalDocumentId:
        | `dataset:${string}`
        | `canvas:${string}`
        | `media-library:${string}`
        | `dashboard:${string}`

    Full GDR URI — resource-qualified identity, for round-trip / snapshot keying.

    projectId?: string

    For dataset: <projectId>

    resourceId?: string

    For canvas / media-library / dashboard: <resourceId>

    scheme: GdrScheme
    type: string

    Target doc's schema _type.