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) • 330 B
text/typescript
import {defineType, NumberComponents} from 'sanity'
import {ComputedNumberInput} from '../components/ComputedNumberInput'
export const computedNumberSchema = defineType({
title: 'Computed Number',
type: 'number',
name: 'computedNumber',
components: {
input: ComputedNumberInput as NumberComponents['input'],
},
})