UNPKG

sanity-plugin-computed-field

Version:

Sanity plugin that computes a field's value based on other fields or relationships with its document or external data. In other words, this field memoizes a value in a document using GROQ to lookup and custom javascript to compute the value from those GRO

13 lines (10 loc) 312 B
import {defineType, TextComponents} from 'sanity' import {ComputedTextInput} from '../components/ComputedTextInput' export const computedTextSchema = defineType({ title: 'Computed Text', type: 'text', name: 'computedText', components: { input: ComputedTextInput as TextComponents['input'], }, })