capabilities.work

Compare Draft and Published

A 2-step recipe with Sanity. We can help you get access.

Recipe · 2 steps

Compare Draft and Published

with Sanity

Fetch published and draft perspectives of one document for comparison.

  1. Fetch the document under the published perspective to capture its live state.
  2. Fetch the document under the drafts perspective to capture any pending unpublished edits for comparison against the published state.
What you'll need to have ready
  • projectId: The Sanity project id that scopes the API endpoint.
  • apiToken: Sanity project API token used as a Bearer credential.
  • dataset: Dataset name to query.
  • documentId: The published document _id to compare across perspectives.
For your developer

Arazzo workflow sanity:compare-draft-and-published, 2 operations: queryDocuments → queryDocuments. Specs on APIs.io.