Sanity Library Reference Docs
    Preparing search index...

    Type Alias ResolveProjectionResult<TProjection, TDocumentType, TSchemaId>Beta

    ResolveProjectionResult: TSchemaId extends keyof SanityProjectionsByResource
        ? ProjectionIn<TSchemaId, TDocumentType, TProjection>
        : UsesLegacyLookup<TSchemaId, SanityProjectionsByResource, TProjection> extends true
            ? SanityProjectionResult<TProjection, TDocumentType, TSchemaId>
            :
                | ProjectionIn<
                    MatchingKeys<SanityProjectionsByResource, TSchemaId>,
                    TDocumentType,
                    TProjection,
                >
                | LegacyProjectionIn<TSchemaId, TDocumentType, TProjection>

    Resolves a projection result for one resource and document type.

    A projection runs against the document its handle names, so the same projection text resolves differently per document type as well as per resource. A resource key known only as a pattern gets the union across the registered resources it can match, plus the result saved by experimental Typegen for the same projection text, as in ResolveDocument.

    Type Parameters

    • TProjection extends string = string
    • TDocumentType extends string = string
    • TSchemaId extends string = string