Skip to content

Commit ea9b3f2

Browse files
authored
Merge pull request #359 from aws-amplify/master
Release V2.26.23: GrapgQL V2 fix
2 parents fdd29ae + 6c91cc6 commit ea9b3f2

24 files changed

+10769
-41
lines changed

.circleci/config.base.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ install_cli_with_local_codegen: &install_cli
3333
source .circleci/local_publish_helpers.sh
3434
startLocalRegistry "$(pwd)/.circleci/verdaccio.yaml"
3535
setNpmRegistryUrlToLocal
36-
sudo npm install -g @aws-amplify/cli
36+
sudo npm install -g @aws-amplify/cli@amplify-codegen-e2e-tests
3737
sudo npm install -g amplify-app
3838
amplify -v
3939
amplify-app --version

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ install_cli_with_local_codegen: &ref_5
3232
source .circleci/local_publish_helpers.sh
3333
startLocalRegistry "$(pwd)/.circleci/verdaccio.yaml"
3434
setNpmRegistryUrlToLocal
35-
sudo npm install -g @aws-amplify/cli
35+
sudo npm install -g @aws-amplify/cli@amplify-codegen-e2e-tests
3636
sudo npm install -g amplify-app
3737
amplify -v
3838
amplify-app --version

packages/amplify-codegen-e2e-core/src/init/initProjectHelper.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export function initJSProjectWithProfile(cwd: string, settings: Object = {}): Pr
7272
.sendLine(s.profileName);
7373
}
7474

75-
chain.wait('Try "amplify add api" to create a backend API and then "amplify publish" to deploy everything').run((err: Error) => {
75+
chain.wait('Try "amplify add api" to create a backend API and then "amplify push" to deploy everything').run((err: Error) => {
7676
if (err) {
7777
reject(err);
7878
} else {
@@ -112,7 +112,7 @@ export function initAndroidProjectWithProfile(cwd: string, settings: Object): Pr
112112
.sendCarriageReturn()
113113
.wait('Please choose the profile you want to use')
114114
.sendLine(s.profileName)
115-
.wait('Try "amplify add api" to create a backend API and then "amplify publish" to deploy everything')
115+
.wait('Try "amplify add api" to create a backend API and then "amplify push" to deploy everything')
116116
.run((err: Error) => {
117117
if (!err) {
118118
addCircleCITags(cwd);
@@ -153,7 +153,7 @@ export function initIosProjectWithProfile(cwd: string, settings: Object): Promis
153153
.sendCarriageReturn()
154154
.wait('Please choose the profile you want to use')
155155
.sendLine(s.profileName)
156-
.wait('Try "amplify add api" to create a backend API and then "amplify publish" to deploy everything')
156+
.wait('Try "amplify add api" to create a backend API and then "amplify push" to deploy everything')
157157
.run((err: Error) => {
158158
if (!err) {
159159
addCircleCITags(cwd);
@@ -194,7 +194,7 @@ export function initFlutterProjectWithProfile(cwd: string, settings: Object): Pr
194194

195195
singleSelect(chain, s.region, amplifyRegions);
196196

197-
chain.wait('Try "amplify add api" to create a backend API and then "amplify publish" to deploy everything').run((err: Error) => {
197+
chain.wait('Try "amplify add api" to create a backend API and then "amplify push" to deploy everything').run((err: Error) => {
198198
if (!err) {
199199
resolve();
200200
} else {
@@ -254,7 +254,7 @@ export function initProjectWithAccessKey(
254254

255255
singleSelect(chain, s.region, amplifyRegions);
256256

257-
chain.wait('Try "amplify add api" to create a backend API and then "amplify publish" to deploy everything').run((err: Error) => {
257+
chain.wait('Try "amplify add api" to create a backend API and then "amplify push" to deploy everything').run((err: Error) => {
258258
if (!err) {
259259
resolve();
260260
} else {
@@ -293,7 +293,7 @@ export function initNewEnvWithAccessKey(cwd: string, s: { envName: string; acces
293293

294294
singleSelect(chain, process.env.CLI_REGION, amplifyRegions);
295295

296-
chain.wait('Try "amplify add api" to create a backend API and then "amplify publish" to deploy everything').run((err: Error) => {
296+
chain.wait('Try "amplify add api" to create a backend API and then "amplify push" to deploy everything').run((err: Error) => {
297297
if (!err) {
298298
resolve();
299299
} else {
@@ -323,7 +323,7 @@ export function initNewEnvWithProfile(cwd: string, s: { envName: string }): Prom
323323
.sendCarriageReturn()
324324
.wait('Please choose the profile you want to use')
325325
.sendCarriageReturn()
326-
.wait('Try "amplify add api" to create a backend API and then "amplify publish" to deploy everything')
326+
.wait('Try "amplify add api" to create a backend API and then "amplify push" to deploy everything')
327327
.run((err: Error) => {
328328
if (!err) {
329329
resolve();
@@ -357,7 +357,7 @@ export function amplifyInitSandbox(cwd: string, settings: {}): Promise<void> {
357357
.sendCarriageReturn()
358358
.wait('Please choose the profile you want to use')
359359
.sendLine(s.profileName)
360-
.wait('Try "amplify add api" to create a backend API and then "amplify publish" to deploy everything')
360+
.wait('Try "amplify add api" to create a backend API and then "amplify push" to deploy everything')
361361
.run((err: Error) => {
362362
if (!err) {
363363
resolve();

packages/amplify-codegen-e2e-core/src/utils/pinpoint.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export function initProjectForPinpoint(cwd: string): Promise<void> {
114114

115115
singleSelect(chain, settings.region, amplifyRegions);
116116

117-
chain.wait('Try "amplify add api" to create a backend API and then "amplify publish" to deploy everything').run((err: Error) => {
117+
chain.wait('Try "amplify add api" to create a backend API and then "amplify push" to deploy everything').run((err: Error) => {
118118
if (!err) {
119119
resolve();
120120
} else {

packages/amplify-codegen-e2e-tests/src/environment/env.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export function addEnvironmentHostedUI(cwd: string, settings: { envName: string
157157
.sendLine(AMAZON_APP_ID)
158158
.wait('Enter your Amazon App Secret for your OAuth flow:')
159159
.sendLine(AMAZON_APP_SECRET)
160-
.wait('Try "amplify add api" to create a backend API and then "amplify publish" to deploy everything')
160+
.wait('Try "amplify add api" to create a backend API and then "amplify push" to deploy everything')
161161
.run((err: Error) => {
162162
if (!err) {
163163
resolve();

packages/amplify-codegen-e2e-tests/src/init-special-cases/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ async function initWorkflow(cwd: string, settings: { accessKeyId: string; secret
8686

8787
singleSelect(chain, settings.region, amplifyRegions);
8888

89-
chain.wait('Try "amplify add api" to create a backend API and then "amplify publish" to deploy everything').run((err: Error) => {
89+
chain.wait('Try "amplify add api" to create a backend API and then "amplify push" to deploy everything').run((err: Error) => {
9090
if (!err) {
9191
resolve();
9292
} else {

packages/appsync-modelgen-plugin/src/__tests__/visitors/appsync-visitor.test.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -897,4 +897,29 @@ describe('AppSyncModelVisitor', () => {
897897
expect(visitor.models.ModelB.fields[1].directives[0].arguments.indexName).toEqual('byModelB');
898898
});
899899
});
900+
901+
describe('Graphql V2 fix tests for multiple has many relations of only one model type', () => {
902+
const schema = /* GraphQL*/ `
903+
type Registration @model {
904+
id: ID! @primaryKey
905+
meetingId: ID @index(name: "byMeeting", sortKeyFields: ["attendeeId"])
906+
meeting: Meeting! @belongsTo(fields: ["meetingId"])
907+
attendeeId: ID @index(name: "byAttendee", sortKeyFields: ["meetingId"])
908+
attendee: Attendee! @belongsTo(fields: ["attendeeId"])
909+
}
910+
type Meeting @model {
911+
id: ID! @primaryKey
912+
title: String!
913+
attendees: [Registration] @hasMany(indexName: "byMeeting", fields: ["id"])
914+
}
915+
916+
type Attendee @model {
917+
id: ID! @primaryKey
918+
meetings: [Registration] @hasMany(indexName: "byAttendee", fields: ["id"])
919+
}
920+
`;
921+
it(`should not throw error when processing models`, () => {
922+
expect(() => createAndGeneratePipelinedTransformerVisitor(schema)).not.toThrow();
923+
});
924+
})
900925
});

0 commit comments

Comments
 (0)