Sanity Library Reference Docs
    Preparing search index...

    Interface StructureResolverContext

    Structure tool context. Extends from ConfigContext.

    interface StructureResolverContext {
        "[DECISION_PARAMETERS_SCHEMA]"?: DecisionParametersConfig;
        currentUser: CurrentUser;
        dataset: string;
        documentStore: DocumentStore;
        getClient: (options: SourceClientOptions) => SanityClient;
        i18n: LocaleSource;
        perspectiveStack: StackablePerspective[];
        projectId: string;
        schema: Schema;
    }

    Hierarchy (View Summary)

    Index

    Properties

    "[DECISION_PARAMETERS_SCHEMA]"?: DecisionParametersConfig
    currentUser: CurrentUser

    The current user or null if not authenticated.

    dataset: string

    The name of the dataset.

    documentStore: DocumentStore

    This can be replaced by a different API in the future. It is provided as-is to support common structure patterns found in V2 in V3.

    getClient: (options: SourceClientOptions) => SanityClient

    A function that returns a Sanity client with the specified options.

    perspectiveStack: StackablePerspective[]

    The stacked array of perspective ids ordered chronologically to represent the state of documents at the given point in time. It can be used as the perspective param in the client to get the correct view of the documents. ["published"] | ["drafts"] | ["releaseId2", "releaseId1", "drafts"] See PerspectiveStack

    projectId: string

    The ID of the project.

    schema: Schema

    The schema for this source.