apollo-tooling
apollo-tooling copied to clipboard
generate `import type` instead of `import`
Hello, this is my attempt to fix codegen to be able to use "importsNotUsedAsValues": "error"
in tsconfig.json.
It definitely fixes my codebase, which is a pretty gigantic codebase.
At first I thought of maybe doing a more robust solution, but then I thought, I don't think the codegen actually needs any other type of import other than import type
.
TODO:
- [ ] Update CHANGELOG.md* with your change (include reference to issue & this PR)
- [ ] Make sure all of the significant new logic is covered by tests
- [ ] Rebase your changes on master so that they can be merged easily
- [ ] Make sure all tests and linter rules pass
*Make sure changelog entries note which project(s) has been affected. See older entries for examples on what this looks like.
@jimisaacs: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/
Thanks for your help on this @hwillson !!!
Thanks for working on this @jimisaacs. Since this is a breaking change we'll have to be careful with how it's rolled out. We're discussing those plans internally, and will get back to you shortly.
+1 for this change. If there is any help needed, please ping me.
Also, if this breaking change seems like a large step forward, an intermediate solution could be to introduce a config setting that would indicate if the generation would create import type
or just import
.
@hwillson any update on the internal discussions? :) We really need this, we depend on codegen
in our continuous integration flows. Thanks!