Sanity Library Reference Docs
    Preparing search index...

    Type Alias ResolveQueryResult<TQuery, TSchemaId>Beta

    ResolveQueryResult: TSchemaId extends keyof SanityQueriesByResource
        ? QueryIn<TSchemaId, TQuery>
        : UsesLegacyLookup<TSchemaId, SanityQueriesByResource, TQuery> extends true
            ? SanityQueryResult<TQuery, TSchemaId>
            :
                | QueryIn<MatchingKeys<SanityQueriesByResource, TSchemaId>, TQuery>
                | LegacyQueryIn<TSchemaId, TQuery>

    Resolves a query result for one resource, selected by the exact query text.

    A key known only as a pattern gets the union of the query's result across the registered resources it can match, plus the result saved by experimental Typegen for the same query text, if any. See ResolveDocument for why a registered resource does not fall through, and when the experimental Typegen declarations apply.

    Type Parameters

    • TQuery extends string = string
    • TSchemaId extends string = string