The object containing document identification properties.
The validated DocumentHandle object, with projectId and dataset required.
Creates or validates a DocumentHandle object.
Ensures the provided object conforms to the DocumentHandle interface.
The object containing document identification properties.
The validated DocumentHandle object.
Creates or validates a
DocumentHandleobject. Ensures the provided object conforms to theDocumentHandleinterface.This signature applies when the handle passes both
projectIdanddatasetas strings. The returned handle keeps both fields required and typed as the values passed, socreateDocumentHandle({projectId: 'abc123', dataset: 'production', ...}).projectIdis typed'abc123'instead of'abc123' | undefined. A field typedstring | undefined, such as one spread from aSanityConfig, uses the next signature and stays optional.TDatasetandTProjectIdareconstso a call written where a typed handle is expected, such as an annotated variable or a prop typedDocumentHandle<'book', 'production', 'abc123'>, keeps the literals instead of inferringstring.