Skip to content

Commit

Permalink
fix: rebase fixes and bugs (#8960)
Browse files Browse the repository at this point in the history
* fix: rebase fixes and bugs

* fix: service walkthrough call for appsync
  • Loading branch information
akshbhu authored and jhockett committed Nov 20, 2021
1 parent 6180642 commit 7413d29
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class CfnApiArtifactHandler implements ApiArtifactHandler {
const resourceDir = this.getResourceDir(apiName);
// update appsync cli-inputs
const appsyncCLIInputs = await this.updateAppsyncCLIInputs(updates, apiName);
if (updates.transformSchema) {
if (!_.isEmpty(updates.transformSchema)) {
this.writeSchema(appsyncCLIInputs.serviceConfiguration.gqlSchemaPath, updates.transformSchema);
}
if (updates.conflictResolution) {
Expand All @@ -123,11 +123,10 @@ class CfnApiArtifactHandler implements ApiArtifactHandler {
const previousAuthConfig = _.cloneDeep(authConfig);
const oldConfigHadApiKey = authConfigHasApiKey(authConfig);
if (updates.defaultAuthType) {
authConfig.defaultAuthentication = appSyncAuthTypeToAuthConfig(appsyncCLIInputs.serviceConfiguration.defaultAuthType);
authConfig.defaultAuthentication = appSyncAuthTypeToAuthConfig(updates.defaultAuthType);
}
if (updates.additionalAuthTypes) {
authConfig.additionalAuthenticationProviders =
appsyncCLIInputs.serviceConfiguration.additionalAuthTypes.map(appSyncAuthTypeToAuthConfig);
authConfig.additionalAuthenticationProviders = updates.additionalAuthTypes.map(appSyncAuthTypeToAuthConfig);
}

if (!opts?.skipCompile) {
Expand Down Expand Up @@ -304,13 +303,13 @@ class CfnApiArtifactHandler implements ApiArtifactHandler {
const prevAppsyncInputs = cliState.getCLIInputPayload();

const appsyncInputs: AppSyncCLIInputs = prevAppsyncInputs;
if (!_.isEmpty(updates.conflictResolution)) {
if (updates.conflictResolution) {
appsyncInputs.serviceConfiguration.conflictResolution = updates.conflictResolution;
}
if (!_.isEmpty(updates.defaultAuthType)) {
if (updates.defaultAuthType) {
appsyncInputs.serviceConfiguration.defaultAuthType = updates.defaultAuthType;
}
if (!_.isEmpty(updates.additionalAuthTypes)) {
if (updates.additionalAuthTypes) {
appsyncInputs.serviceConfiguration.additionalAuthTypes = updates.additionalAuthTypes;
}
cliState.saveCLIInputPayload(appsyncInputs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ async function addNonContainerResource(context: $TSContext, service: string, opt
const { serviceWalkthroughFilename, defaultValuesFilename } = serviceMetadata;
const serviceWalkthrough = await getServiceWalkthrough(serviceWalkthroughFilename);

const serviceWalkthroughPromise: Promise<$TSAny> = serviceWalkthrough(context, defaultValuesFilename, serviceMetadata);
const serviceWalkthroughPromise: Promise<$TSAny> = serviceWalkthrough(context, serviceMetadata);
switch (service) {
case AmplifySupportedService.APPSYNC:
const walkthroughResult = await serviceWalkthroughPromise;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import * as fs from 'fs-extra';
import { ResolverConfig } from 'graphql-transformer-core';
import _ from 'lodash';
import * as path from 'path';
import uuid from 'uuid';
import { v4 as uuid } from 'uuid';
import { gqlSchemaFilename } from '../aws-constants';
import { AppSyncCLIInputs } from '../service-walkthrough-types/appsync-user-input-types';
import { authConfigToAppSyncAuthType } from './auth-config-to-app-sync-auth-type-bi-di-mapper';
Expand Down Expand Up @@ -109,7 +109,7 @@ const generateCliInputs = (parameters: ApiMetaData, apiResourceDir: string): App
serviceName: 'AppSync',
defaultAuthType: authConfigToAppSyncAuthType(parameters.authConfig ? parameters.authConfig.defaultAuthentication : undefined),
additionalAuthTypes:
parameters.authConfig && parameters.authConfig.additionalAuthenticationProviders
!_.isEmpty(parameters.authConfig) && !_.isEmpty(parameters.authConfig.additionalAuthenticationProviders)
? parameters.authConfig.additionalAuthenticationProviders.map(authConfigToAppSyncAuthType)
: undefined,
conflictResolution: resolverConfigToConflictResolution(parameters.resolverConfig),
Expand Down

0 comments on commit 7413d29

Please sign in to comment.