Sanity Library Reference Docs
    Preparing search index...

    Function defineField

    • Beta

      Define a field within a document, object, image or file definition fields array.

      This function will narrow the schema type down to fields and options based on the provided type-string.

      Using defineField is optional, but should provide improved autocompletion in your IDE, when building your schema. Field-properties like validation and initialValuewill also be more specific.

      See defineType for more examples.

      Returns any

      • defineField
      • defineArrayMember
      • typed