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.
perspective
The perspective handle to get the perspective for.
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,}) Copy
import {usePerspective, useQuery} from '@sanity/sdk-react'const perspective = usePerspective({perspective: 'rxg1346', projectId: 'abc123', dataset: 'production'})const {data} = useQuery<Movie[]>('*[_type == "movie"]', { perspective: perspective,})
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.