Sanity Library Reference Docs
    Preparing search index...

    Function defineProjection

    • Beta

      Preserves a projection string's literal type and returns the string unchanged. Use this import when migrating an app with existing experimental Typegen output.

      Current Typegen does not scan this helper. New or changed projections need an explicit result type until projection generation is supported.

      Type Parameters

      • const TProjection extends string

      Parameters

      Returns TProjection

      const preview = defineProjection('{title, "author": author->name}')