I am not a 100% sure if this qualifies as a bug report or if it should be a feature request. Currently, we can not use a wild-card (*) import to import fragments of a query.
To Reproduce
Steps to reproduce the behavior:
Create a new file query.ts
import * as F from "./fragments";
export const getSite = groq`*[_type == "site"][0]{
name,
"seoMetadata": seoMetadata${F.SEO_META_DATA_FRAGMENT},
}`;
Run typegen.
Typegen throws an error.
❌ Unsupported expression type: MemberExpression in lib/sanity/queries.ts:8:30 in "lib/sanity/queries.ts"
Expected behavior
Types should be generated.
Which versions of Sanity are you using?
@sanity/cli (global) 3.55.0 (up to date)
@sanity/types 3.55.0 (up to date)
@sanity/vision 3.55.0 (up to date)
sanity 3.55.0 (up to date)
Describe the bug
I am not a 100% sure if this qualifies as a bug report or if it should be a feature request. Currently, we can not use a wild-card (
*
) import to import fragments of a query.To Reproduce
Steps to reproduce the behavior:
query.ts
Expected behavior
Types should be generated.
Which versions of Sanity are you using?
Additional context
This works as expected: