You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, I've just started using groqd after the 1.0.0 release due to support for typed schemas. Great work, loving it so far.
However one issue I've run into is the typing of expanded (deref()) references. From the example below, I'd expect benefits to be an array of benefits according to Typescript, but it is actually still just an array of references. The actual query works fine though, returning the expanded references for my use. It is only a typing issue.
constlanding=awaitrunQuery(q.star.filterByType("landing").project((sub)=>({"...": true,benefits: sub.field("benefits[]").deref(),})).slice(0),)landing.benefits.map((benefit)=>{// title is there and logs fine, but this throws a type error// typescript still thinks this is just reference and doesn't know about "title"console.log(benefit.title)})
Am I doing something wrong or is this a bug? The documentation for 1.0.0 is still a little sparse so I wasn't sure.
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Code of Conduct
Question
Hey, I've just started using
groqd
after the 1.0.0 release due to support for typed schemas. Great work, loving it so far.However one issue I've run into is the typing of expanded (
deref()
) references. From the example below, I'd expectbenefits
to be an array of benefits according to Typescript, but it is actually still just an array of references. The actual query works fine though, returning the expanded references for my use. It is only a typing issue.Am I doing something wrong or is this a bug? The documentation for 1.0.0 is still a little sparse so I wasn't sure.
The text was updated successfully, but these errors were encountered: