Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Add ability to validate types are correct #833

Open
justinanastos opened this issue Dec 14, 2018 · 0 comments
Open

Feature Request: Add ability to validate types are correct #833

justinanastos opened this issue Dec 14, 2018 · 0 comments
Labels
🤖 component - codegen related to the codegen core packages

Comments

@justinanastos
Copy link
Contributor

I'd like the ability to validate my codegen'ed types from the CLI for two reasons:

  1. CI!

  2. When I forget to update types on the fly, I'd like to be able to use something like git bisect to find exactly which commit I forgot to update the types in:

    git bisect run npx apollo client:codegen  \
        --config=[config-filename] \
        --passthroughCustomScalars  \
        --outputFlat  \
        --validate
    

I can think of two ways to handle this:

  1. [Preferred] Add an option that generates types, compares to all files that will be written instead of actually writing, and then exit with a non-zero exit code if any files are incorrect.

  2. [Stopgap?] Allow output to stdout instead of always writing to a file

    For example, allow a - param to signify that we want to write to stdout instead of a real file; possibly only allow such an option when --outputFlat is also specified.

    npx apollo client:codegen --config=[config-filename]  \
        --passthroughCustomScalars  \
        --outputFlat  \
        --target=typescript  \
        -
    
@justinanastos justinanastos changed the title Feature Request: Provide ability to validate types are correct Feature Request: Add ability to validate types are correct Dec 14, 2018
@JakeDawkins JakeDawkins added the 🤖 component - codegen related to the codegen core packages label Jul 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 component - codegen related to the codegen core packages
Projects
None yet
Development

No branches or pull requests

2 participants