Skip to content

Commit

Permalink
chore: bump to data-schema version ^0.18.0 (#13297)
Browse files Browse the repository at this point in the history
* chore: bump to data-schema version ^0.18.0

* update yarn lock and tests associated with changed data-schema behavior

* fix modelintro and fixtures
  • Loading branch information
svidgen authored Apr 26, 2024
1 parent b334158 commit 64acd49
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1041,15 +1041,15 @@ const amplifyConfig = {
type: 'key',
properties: {
name: 'secondaryIndexModelsByTitle',
queryField: 'listByTitle',
queryField: 'listSecondaryIndexModelByTitle',
fields: ['title'],
},
},
{
type: 'key',
properties: {
name: 'secondaryIndexModelsByDescriptionAndViewCount',
queryField: 'listByDescriptionAndViewCount',
queryField: 'listSecondaryIndexModelByDescriptionAndViewCount',
fields: ['description', 'viewCount'],
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5292,7 +5292,7 @@ exports[`generateClient index queries PK and SK index query 1`] = `
"options": {
"body": {
"query": "query ($description: String!, $viewCount: ModelIntKeyConditionInput, $filter: ModelSecondaryIndexModelFilterInput, $sortDirection: ModelSortDirection, $limit: Int, $nextToken: String) {
listByDescriptionAndViewCount(
listSecondaryIndexModelByDescriptionAndViewCount(
description: $description
viewCount: $viewCount
filter: $filter
Expand Down Expand Up @@ -5344,7 +5344,7 @@ exports[`generateClient index queries PK and SK index query, with sort direction
"options": {
"body": {
"query": "query ($description: String!, $viewCount: ModelIntKeyConditionInput, $filter: ModelSecondaryIndexModelFilterInput, $sortDirection: ModelSortDirection, $limit: Int, $nextToken: String) {
listByDescriptionAndViewCount(
listSecondaryIndexModelByDescriptionAndViewCount(
description: $description
viewCount: $viewCount
filter: $filter
Expand Down Expand Up @@ -5397,7 +5397,7 @@ exports[`generateClient index queries PK and SK index query, with sort direction
"options": {
"body": {
"query": "query ($description: String!, $viewCount: ModelIntKeyConditionInput, $filter: ModelSecondaryIndexModelFilterInput, $sortDirection: ModelSortDirection, $limit: Int, $nextToken: String) {
listByDescriptionAndViewCount(
listSecondaryIndexModelByDescriptionAndViewCount(
description: $description
viewCount: $viewCount
filter: $filter
Expand Down Expand Up @@ -5450,7 +5450,7 @@ exports[`generateClient index queries PK-only index query 1`] = `
"options": {
"body": {
"query": "query ($title: String!, $filter: ModelSecondaryIndexModelFilterInput, $sortDirection: ModelSortDirection, $limit: Int, $nextToken: String) {
listByTitle(
listSecondaryIndexModelByTitle(
title: $title
filter: $filter
sortDirection: $sortDirection
Expand Down
21 changes: 12 additions & 9 deletions packages/api-graphql/__tests__/internals/generateClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5337,9 +5337,10 @@ describe('generateClient', () => {

const client = generateClient<Schema>({ amplify: Amplify });

const { data } = await client.models.SecondaryIndexModel.listByTitle({
title: 'Hello World',
});
const { data } =
await client.models.SecondaryIndexModel.listSecondaryIndexModelByTitle({
title: 'Hello World',
});

expect(normalizePostGraphqlCalls(spy)).toMatchSnapshot();

Expand Down Expand Up @@ -5374,10 +5375,12 @@ describe('generateClient', () => {
const client = generateClient<Schema>({ amplify: Amplify });

const { data } =
await client.models.SecondaryIndexModel.listByDescriptionAndViewCount({
description: 'something something',
viewCount: { gt: 4 },
});
await client.models.SecondaryIndexModel.listSecondaryIndexModelByDescriptionAndViewCount(
{
description: 'something something',
viewCount: { gt: 4 },
},
);

expect(normalizePostGraphqlCalls(spy)).toMatchSnapshot();

Expand Down Expand Up @@ -5427,7 +5430,7 @@ describe('generateClient', () => {
const client = generateClient<Schema>({ amplify: Amplify });

const { data } =
await client.models.SecondaryIndexModel.listByDescriptionAndViewCount(
await client.models.SecondaryIndexModel.listSecondaryIndexModelByDescriptionAndViewCount(
{
description: 'match',
viewCount: { lt: 4 },
Expand Down Expand Up @@ -5476,7 +5479,7 @@ describe('generateClient', () => {
const client = generateClient<Schema>({ amplify: Amplify });

const { data } =
await client.models.SecondaryIndexModel.listByDescriptionAndViewCount(
await client.models.SecondaryIndexModel.listSecondaryIndexModelByDescriptionAndViewCount(
{
description: 'match',
viewCount: { lt: 4 },
Expand Down
2 changes: 1 addition & 1 deletion packages/api-graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"dependencies": {
"@aws-amplify/api-rest": "4.0.28",
"@aws-amplify/core": "6.0.28",
"@aws-amplify/data-schema": "^0.17.0",
"@aws-amplify/data-schema": "^0.18.0",
"@aws-sdk/types": "3.387.0",
"graphql": "15.8.0",
"rxjs": "^7.8.1",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 64acd49

Please sign in to comment.