Skip to content

Commit

Permalink
fix: update perspective typings
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan committed Jun 12, 2023
1 parent a92d37b commit 74a02f8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/data/dataMethods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ export function _requestObservable<R>(
if (config.resultSourceMap) {
options.query = {resultSourceMap: true, ...options.query}
}
if (typeof config.perspective === 'string' && config.perspective !== 'all') {
if (typeof config.perspective === 'string' && config.perspective !== 'raw') {
options.query = {perspective: config.perspective, ...options.query}
}
}
Expand Down
6 changes: 5 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export interface ClientConfig {
/** @defaultValue true */
useCdn?: boolean
token?: string
perspective?: 'previewDrafts' | 'published' | 'all'
perspective?: 'previewDrafts' | 'published' | 'raw'
apiHost?: string
apiVersion?: string
proxy?: string
Expand Down Expand Up @@ -193,6 +193,10 @@ export type SanityDocument<T extends Record<string, Any> = Record<string, Any>>
_type: string
_createdAt: string
_updatedAt: string
/**
* Present when `perspective` is set to `previewDrafts`
*/
_originalId?: string
}

/** @internal */
Expand Down

0 comments on commit 74a02f8

Please sign in to comment.