Sanity Library Reference Docs
    Preparing search index...

    Interface SanityQueries_2

    The query registry as seen from @sanity/client. Inherits every query registered on the global SanityQueries interface, and still accepts the older module augmentation form:

    declare module '@sanity/client' {
    interface SanityQueries {
    '*[_type == "post"]': PostsQueryResult
    }
    }

    @sanity/client releases that predate the global registry only read this interface, so a generated file that registers queries globally can bridge them with an augmentation that adds the global as a base type. It is harmless on releases that already inherit it:

    declare module '@sanity/client' {
    interface SanityQueries extends globalThis.SanityQueries {}
    }
    interface SanityQueries_2 {
        "*[_type == \"author\"][0]{name}": { name: string } | null;
        "*[_type == \"page\" && slug.current == $slug][0]{_id,_type,body,title}": PageQueryResult;
        "*[_type==\"post\"][0]{title,imageLocation}": {
            _type: "post";
            imageLocation: "left" | "right";
            title: string;
        };
    }

    Hierarchy

    • SanityQueries
      • SanityQueries_2
    Index

    Properties

    "*[_type == \"author\"][0]{name}": { name: string } | null
    "*[_type == \"page\" && slug.current == $slug][0]{_id,_type,body,title}": PageQueryResult
    "*[_type==\"post\"][0]{title,imageLocation}": {
        _type: "post";
        imageLocation: "left" | "right";
        title: string;
    }