Class: Sanity::Document

Inherits:
Resource show all
Defined in:
lib/sanity/resources/document.rb

Overview

Sanity::Document is the core resource for interacting with Sanity’s HTTP API. This class provides out of the box query and mutation methods for interacting with the API.

Examples:

create a new document object in memory

Sanity::Document.new(_id: 1, _type: "post")

invoke the api operations to create a document

Sanity::Document.create(params: {_type: "post", title: "A new blog post"})

invoke the api operations to delete a document

Sanity::Document.delete(params: {id: "1234"})

Method Summary

Methods included from Serializable

included

Methods included from Publishable

included

Methods included from Queryable

included

Methods included from Mutatable

included