Skip to content
This repository was archived by the owner on Mar 26, 2024. It is now read-only.
This repository was archived by the owner on Mar 26, 2024. It is now read-only.

Objects in array are missing _type and _key #236

@piotrski

Description

@piotrski

Schema:

{
  name: 'content',
  type: 'array',
  title: 'Content',
  of: [
	{
      type: 'youtube',
    },
    {
      name: 'productSection',
      type: 'productSection',
      title: 'Products',
    }
  ]
}

Data:

content: [
  {
    "_key": "9d0a582dd846"
    "_type": "youtube"
    "url": "..."
  },
  {
    "_key": "c4c84d3114c9"
    "_type": "productSection"
    "products": [...] 1 item "title": "Prodct module"
  }
]

Type:

{
	content: Ref_9GdYNyKK3JQZWeEb | Ref_rxXogl98csCHdj1D
}
type Ref_9GdYNyKK3JQZWeEb = {
      _key: string; // it's missing
      _type: "youtube"; // missing
      url?: string;
      videoLabel?: string;
};

type Ref_rxXogl98csCHdj1D =
  | {
      _key: string; // it's missing
      _type: "productSection" // missing
      products?: Ref_xVWTU39k4Au07eM0[];
      title?: string;
    }[]
  | null;

This might be related to #85
I'm using groq-codegen v1.0.0-alpha.25

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions