March 20th, 2019
Our goals (and achievements) for 1.0.0 release was:
- Rename all package from
graphql-codegen-...to scoped packages
- Stabilize the core package and the YML configuration file.
- Remove the old, deprecated code from this repostory (everything related to
- Separate the CLI package from the core package, and create an easy-to-use and easy-to-consume core package.
- Add better support for running the codegen in non-node environments, by clearing unused dependencies and add support for tree shaking.
- Remove the dependency for Handlebars from this repository.
- Introduce a new, easy-to-use common base for plugins, based on
Visitorpattern, that uses
- Better unit tests for all plugins packages, by use TypeScript compiler to compile each test result- makes it much easier to detect mismatches and invalid output.
- Refactor the entire TypeScript plugin, and create better and optimized output.
- Fix most of the GitHub issues.
- Update website and documentation for all plugins.
During the refactor, we rewrote all TypeScript-related plugins. By doing that, we introducted some breaking changes.
Before those changes, you had to depend on
typescript-common plugin, and add
typescript-client (and others) on top of it.
typescript plugin is the plugin you need to use for backend (it combines
typescript-server), and use
typescript-operations on top of it for the client-side.
The reason for this change is the fact that now
Pick<> to create the client-side types, instead of generating tons of
First, the new packages have a different name, that means that you need to manually update those packages names, and not just it's version.
graphql-code-generator package is now
@graphql-codegen/cli and all other packages has been changes from
So start by updating your
Also, make sure to update your YML config file:
And for client-side:
We tried to avoid breaking changes, but it's not always possible. We had a lot of issues we couldn't fix before because we didn't want to introduce breaking changes.
It was very hard for us to track breaking changes in the past, but it it's easier for us, and we promise to be semver-compatiable.
You can find a list of all breaking changes in GitHub Releases page.
We also created a new plugin, called
typescript-compatibility that generates backward compatibility for the
It will generates for you types that are pointing to the new form of types. It supports most of the use-cases.
To use it, start by installing from NPM:
Then, add it to your codegen configuration:
typescript-react-apolloplugin also specified in your config file, it will generate backward-compatibily for it.