Sanity App SDK
    Preparing search index...
    • Returns a single or stack of perspectives for the given perspective handle, which can then be used to correctly query the documents via the perspective parameter in the client.

      Parameters

      • perspectiveHandle: PerspectiveHandle

        The perspective handle to get the perspective for.

      Returns string | string[]

      The perspective for the given perspective handle.

      import {usePerspective, useQuery} from '@sanity/sdk-react'

      const perspective = usePerspective({perspective: 'rxg1346', projectId: 'abc123', dataset: 'production'})
      const {data} = useQuery<Movie[]>('*[_type == "movie"]', {
      perspective: perspective,
      })