Skip to content

Commit

Permalink
fix: reload feature flags after gql v2 flag migration (#8677)
Browse files Browse the repository at this point in the history
This commit reloads the feature flags if
migrateToTransformerVersionFeatureFlag() writes new values.

Co-authored-by: Colin Ihrig <colihrig@amazon.com>
  • Loading branch information
cjihrig and cjihrig-aws committed Nov 5, 2021
1 parent 8c73713 commit cb7bca2
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -630,7 +630,7 @@ export function getTransformerVersion(context) {
return transformerVersion;
}

function migrateToTransformerVersionFeatureFlag(context) {
async function migrateToTransformerVersionFeatureFlag(context) {
const projectPath = pathManager.findProjectRoot() ?? process.cwd();

let config = stateManager.getCLIJSON(projectPath, undefined, {
Expand All @@ -644,6 +644,7 @@ function migrateToTransformerVersionFeatureFlag(context) {
if (useExperimentalPipelineTransformer && transformerVersion === 1) {
config.features.graphqltransformer.transformerversion = 2;
stateManager.setCLIJSON(projectPath, config);
await FeatureFlags.reloadValues();

context.print.warning(
`\nThe project is configured with 'transformerVersion': ${transformerVersion}, but 'useExperimentalPipelinedTransformer': ${useExperimentalPipelineTransformer}. Setting the 'transformerVersion': ${config.features.graphqltransformer.transformerversion}. 'useExperimentalPipelinedTransformer' is deprecated.`,
Expand Down

0 comments on commit cb7bca2

Please sign in to comment.