FormidableLabs / groqd

A schema-unaware, runtime and type-safe query builder for GROQ.
https://commerce.nearform.com/open-source/groqd
MIT License
221 stars 17 forks source link

Dereferencing gives type error #290

Open Bijig0 opened 2 weeks ago

Bijig0 commented 2 weeks ago

Is there an existing issue for this?

Code of Conduct

Code Sandbox link

No response

Bug report

Trying out a copy paste example from the docs and getting a type error

  const query = q("*", { isArray: true })
    .filterByType("inventory")
    .grab$({
      data: q.object({
        heroImageUrl: q("types").filter().deref().grabOne("url", q.string()),
      }),
    });

Type 'ArrayQuery' is missing the following properties from type 'ZodType<any, any, any>': _type, _output, _input, _def, and 31 more.ts(2740)