You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Using Visual editing with steganography](#using-visual-editing-with-steganography)
75
76
-[Creating Studio edit intent links](#creating-studio-edit-intent-links)
@@ -554,7 +555,9 @@ Then `authors` will only contain documents that don't have a `drafts.` prefix in
554
555
]
555
556
```
556
557
557
-
#### `previewDrafts`
558
+
#### `drafts`
559
+
560
+
> Note: this was previously named `previewDrafts`. The `previewDrafts` perspective is still supported, but deprecated and may be removed in a future API version, so we recommend changing to `drafts`.
558
561
559
562
Designed to help answer the question "What is our app going to look like after all the draft documents are published?".
560
563
@@ -592,8 +595,8 @@ import {createClient} from '@sanity/client'
592
595
593
596
const client =createClient({
594
597
...config,
595
-
useCdn: false, // the `previewDrafts` perspective requires this to be `false`
596
-
perspective: 'previewDrafts',
598
+
useCdn: false, // the `drafts` perspective requires this to be `false`
@@ -624,7 +627,7 @@ Then `authors` will look like this. Note that the result dedupes documents with
624
627
]
625
628
```
626
629
627
-
Since the query simulates what the result will be after publishing the drafts, the `_id` doesn't contain the `drafts.` prefix. If you want to check if a document is a draft or not you can use the `_originalId` field, which is only available when using the `previewDrafts` perspective.
630
+
Since the query simulates what the result will be after publishing the drafts, the `_id` doesn't contain the `drafts.` prefix. If you want to check if a document is a draft or not you can use the `_originalId` field, which is only available when using the `drafts` perspective.
Currently, Sanity supports two types of document variations: drafts and versions. Drafts and versions will not be visible to queries as long as the client is unauthenticated.
733
+
However, using the `raw` perspective with an authenticated client will cause both drafts and versions to appear in query results, so if using `raw` with an authenticated client, make sure this is the behavior you want.
734
+
735
+
Also keep in mind that additional document variations may be introduced by Sanity in the future.
736
+
657
737
### Fetching Content Source Maps
658
738
659
739
Content Source Maps annotate fragments in your query results with metadata about its origin: the field, document, and dataset it originated from.
0 commit comments