aws-amplify / amplify-codegen

Amplify Codegen is a JavaScript toolkit library for frontend and mobile developers building Amplify applications.
Apache License 2.0
59 stars 59 forks source link

fix!: use transformer version 2 by default #813

Closed dpilch closed 5 months ago

dpilch commented 5 months ago

BREAKING CHANGE: use transformer version 2 by default in graphql-generator package

Description of changes

transformerVersion parameter had the wrong type. It was boolean instead of number. With the current default true the transformer version 1 was being used by default.

This means that gen 2 model generation is using has transformerVersion set to 1. Gen 1 is still using the cli.json feature flag which has explicitly set the version.

The parameter is used here:

  1. https://github.com/aws-amplify/amplify-codegen/blob/9f559413621dcc4a4a5158a129e575371c6d8c35/packages/appsync-modelgen-plugin/src/visitors/appsync-swift-visitor.ts#L394
  2. https://github.com/aws-amplify/amplify-codegen/blob/9f559413621dcc4a4a5158a129e575371c6d8c35/packages/appsync-modelgen-plugin/src/preset.ts#L325

This is a breaking change for the graphql-generator. This package is intended for internal use only.

We will still need to upgrade the package version in gen 1 and gen 2 CLI.

Gen 1 behavior will not change with this upgrade.

Gen 2 behavior will be breaking, but it is still pre-GA.

Codegen Paramaters Changed or Added

Issue #, if available

N/A

Description of how you validated changes

Checklist

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

palpatim commented 5 months ago

Please change the title to conventional commit breaking change format to ensure we get a MV bump on the next release: fix!: use transformer version 2 by default