danielroe / sanity-typed-queries

A typed, zero-dependency schema generator and query builder for Sanity.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

feat: add support for fieldsets

waspeer opened this issue · comments

🆒 Your use case
It would be nice to be able to add fields to a fieldset (https://www.sanity.io/docs/object-type#fieldsets-AbjN0ykp).

🆕 The solution you'd like
A intuitive solution would be something like this:

defineObject(
  'something',
  {
    fieldset: {
      field: { type: 'string' },
      anotherField: { type: 'date' },
    },
  },
);

🔍 Alternatives you've considered
A possible alternative could be to manually edit the generated object / document, but this is of course far from ideal.

Btw, I'd be happy to contribute when we figure out the right api