Sanity App SDK
    Preparing search index...

    Interface DocumentsOptions<TDocumentType, TDataset, TProjectId>

    Configuration options for the useDocuments hook

    interface DocumentsOptions<
        TDocumentType extends string = string,
        TDataset extends string = string,
        TProjectId extends string = string,
    > {
        batchSize?: number;
        dataset?: TDataset;
        documentType?: TDocumentType | TDocumentType[];
        filter?: string;
        orderings?: SortOrderingItem[];
        params?: Record<string, unknown>;
        perspective?: ReleasePerspective | ClientPerspective;
        projectId?: TProjectId;
        search?: string;
    }

    Type Parameters

    • TDocumentType extends string = string
    • TDataset extends string = string
    • TProjectId extends string = string

    Hierarchy (View Summary)

    Index

    Properties

    batchSize?: number

    Number of items to load per batch (defaults to 25)

    dataset?: TDataset
    documentType?: TDocumentType | TDocumentType[]

    Filter documents by their _type. Can be a single type or an array of types.

    filter?: string

    GROQ filter expression to apply to the query

    orderings?: SortOrderingItem[]

    Sorting configuration for the results

    params?: Record<string, unknown>
    perspective?: ReleasePerspective | ClientPerspective
    projectId?: TProjectId
    search?: string

    Text search query to filter results