Go Behind the Experience to see how Tecovas brings the West to life with Sanity 🤠 July 18th

Clarification on the correct usage of `defineField` and `defineArrayMember` in a Slack thread.

7 replies
Last updated: Aug 29, 2023
      title: "Navigation",
      description: "Select pages or link for main navigation",
      name: "navigation",
      type: "array",
      group: "navigation",
      of: [
          title: "Internal Link",
          name: "internalLink",
          type: "internalLink"
          title: "External Link",
          name: "externalLink",
          type: "externalLink"
Quick question, isn't this supposed to be defineArrayMember instead of defineField on the type errors?
Aug 29, 2023, 8:13 AM
I believe
is the right one đź‘Ť
Aug 29, 2023, 8:22 AM
Thank you
Aug 29, 2023, 8:39 AM
So to confirm anything inside OF or TO is an arrayMembrer?
Aug 29, 2023, 8:39 AM
if the parent type is array the of or to is an arrayMember correct?
Aug 29, 2023, 8:40 AM
you know what, I don’t think the
array is typed at all . It only supports simple
{type: 'documentTypeName'}
objects, so my guess is that we didn’t see it as super useful
Aug 29, 2023, 8:56 AM
is only for objects in the
Aug 29, 2023, 8:56 AM
Great thank you very much!
Aug 29, 2023, 8:56 AM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?