Artifacts type files should get generated with imports for custom data types #1135
Labels
Core
Issues related to the core infrastructure
Enhancement
A new feature or improvement to Houdini's public API
Describe the feature
When a query is generated with a field that uses custom data types, the generated
MyQuery.d.ts
file doesn't contain the import to that type and TypeScript isn't 100% sure on what to do with it, and doesn't provide auto-complete on the type.Additionally, if we have a field e.g. of type
Temporal.Instant | null
, TypeScript will handle it asany
.Manually placing an
import type { Temporal } from "@js-temporal/polyfill";
makes TypeScript happy again.The config should probably have an additional property on the custom scalar to define an import for said type, so that this is done correctly when the type is generated.
(I think I saw this discussed somewhere before, perhaps on the Discord server, but I can't find it anymore so I'm making this issue to keep track of it 🙂)
Criticality
cool improvement, my projects will benefit from it
The text was updated successfully, but these errors were encountered: