Skip to content

Conversation

@jimisaacs
Copy link

@jimisaacs jimisaacs commented Aug 22, 2021

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.

@apollo-cla
Copy link

@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/

Yikes - clones won't have an `apollographql` based `remoteUrl`,
which means this test has been failing for contributors for about 2
years :-(.
@jimisaacs
Copy link
Author

Thanks for your help on this @hwillson !!!

@hwillson
Copy link
Member

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.

@jakubzitny
Copy link

+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.

@the21st
Copy link

the21st commented Nov 3, 2021

@hwillson any update on the internal discussions? :) We really need this, we depend on codegen in our continuous integration flows. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants