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) • 320 B
text/typescript
import {defineType, TextComponents} from 'sanity'
import {ComputedTextInput} from '../components/ComputedTextInput'
export const computedStringSchema = defineType({
title: 'Computed String',
type: 'string',
name: 'computedString',
components: {
input: ComputedTextInput as TextComponents['input'],
},
})