Sanity Library Reference Docs
    Preparing search index...

    Interface QueryStore

    interface QueryStore {
        loadQuery: <QueryResponseResult>(
            query: string,
            params?: QueryParams,
            options?: Pick<
                ResponseQueryOptions,
                "perspective"
                | "cache"
                | "next"
                | "headers"
                | "useCdn"
                | "stega"
                | "tag",
            >,
        ) => Promise<QueryResponseInitial<QueryResponseResult>>;
        setServerClient: (client: SanityClient | SanityStegaClient) => void;
        useLiveMode: UseLiveModeHook;
        useQuery: {
            <QueryResponseResult = unknown, QueryResponseError = unknown>(
                query: string,
                params?: QueryParams,
                options?: UseQueryOptionsUndefinedInitial,
            ): QueryStoreState<QueryResponseResult, QueryResponseError> & WithEncodeDataAttribute;
            <QueryResponseResult = unknown, QueryResponseError = unknown>(
                query: string,
                params?: QueryParams,
                options?: UseQueryOptionsDefinedInitial<QueryResponseResult>,
            ): Omit<QueryStoreState<QueryResponseResult, QueryResponseError>, "data"> & {
                data: QueryResponseResult;
            } & WithEncodeDataAttribute;
        };
    }
    Index

    Properties

    loadQuery: <QueryResponseResult>(
        query: string,
        params?: QueryParams,
        options?: Pick<
            ResponseQueryOptions,
            "perspective"
            | "cache"
            | "next"
            | "headers"
            | "useCdn"
            | "stega"
            | "tag",
        >,
    ) => Promise<QueryResponseInitial<QueryResponseResult>>
    setServerClient: (client: SanityClient | SanityStegaClient) => void
    useLiveMode: UseLiveModeHook
    useQuery: {
        <QueryResponseResult = unknown, QueryResponseError = unknown>(
            query: string,
            params?: QueryParams,
            options?: UseQueryOptionsUndefinedInitial,
        ): QueryStoreState<QueryResponseResult, QueryResponseError> & WithEncodeDataAttribute;
        <QueryResponseResult = unknown, QueryResponseError = unknown>(
            query: string,
            params?: QueryParams,
            options?: UseQueryOptionsDefinedInitial<QueryResponseResult>,
        ): Omit<QueryStoreState<QueryResponseResult, QueryResponseError>, "data"> & {
            data: QueryResponseResult;
        } & WithEncodeDataAttribute;
    }