Skip to content

Commit 450616e

Browse files
haverchuckNoyes
andauthored
fix(amplify-codegen): excludes flutter projects from gql gen (#6199)
Makes sure that flutter project customers are not asked about generating GraphQL statements and types Co-authored-by: Noyes <dnnoyes@f8ffc25e9e15.ant.amazon.com>
1 parent 4a8a294 commit 450616e

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

packages/amplify-codegen/src/callbacks/prePushAddCallback.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const { normalizeInputParams } = require('../utils/input-params-manager');
22
const constants = require('../constants');
33
const askShouldGenerateCode = require('../walkthrough/questions/generateCode');
44
const addWalkThrough = require('../walkthrough/add');
5-
const { isCodegenConfigured } = require('../utils');
5+
const { getFrontEndHandler, isCodegenConfigured } = require('../utils');
66
const prePushUpdateCallback = require('./prePushUpdateCallback');
77
const path = require('path');
88
const { isDataStoreEnabled } = require('graphql-transformer-core');
@@ -16,11 +16,15 @@ async function prePushAddCallback(context, resourceName) {
1616

1717
let shouldGenerateCode = false;
1818
if (context.exeInfo.inputParams) {
19-
normalizeInputParams(context);
20-
const inputParams = context.exeInfo.inputParams[constants.Label];
21-
const yesFlag = context.exeInfo.inputParams.yes;
19+
const frontend = getFrontEndHandler(context);
2220

23-
shouldGenerateCode = await determineValue(inputParams, yesFlag, 'generateCode', true, () => askShouldGenerateCode());
21+
if (frontend !== 'flutter') {
22+
normalizeInputParams(context);
23+
const inputParams = context.exeInfo.inputParams[constants.Label];
24+
const yesFlag = context.exeInfo.inputParams.yes;
25+
26+
shouldGenerateCode = await determineValue(inputParams, yesFlag, 'generateCode', true, () => askShouldGenerateCode());
27+
}
2428
} else {
2529
shouldGenerateCode = await askShouldGenerateCode();
2630
}

0 commit comments

Comments
 (0)