Sanity Library Reference Docs
    Preparing search index...

    Type Alias ClientReturnStega<GroqString, Fallback>Beta

    ClientReturnStega: StegaBranded<ClientReturn<GroqString, Fallback>>

    Drop-in replacement for ClientReturn that brands the result strings as StegaString, for use as the first generic of client.fetch when stega is enabled:

    import {createClient} from '@sanity/client'
    import type {ClientReturnStega} from '@sanity/client/stega'

    const query = '*[_type == "post"][0]'
    const post = await client.fetch<ClientReturnStega<typeof query>>(query)

    When the query is registered in the SanityQueries interface (for example by sanity typegen), the result type is looked up and deeply branded with StegaBranded. Otherwise it falls back to Fallback, which defaults to any, just like ClientReturn.

    Type Parameters

    • GroqString extends string
    • Fallback = Any