StellateHQ / fuse

Fuse: The fastest way to build and query great APIs with TypeScript

Home Page:https://fusedata.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Don't empty the generated files during generation

mxstbr opened this issue · comments

When making a change to a client fragment, all the typings disappear until the codegen has finished. You can see this in the demo video when I change the client fragment because all the fragment typings get red underlines:

video-sample.mp4

Ideally, they wouldn't disappear while the codegen is running to make for a neater experience in-editor.

This isn't because the folder gets emptied the reason behind this is how the graphql() helper is typed. Every string literal in the first argument is associated with the output value in the generated types, this means that as soon as we start typing we have no match left, an example here.

I think fixing this would be more a task for gql.tada as we only need upfront code generation for that, generating types for a given introspection. After that we will just automatically infer types for any changed selection-set. I think that would be a good future iteration.