-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add RDS primary key transformer #1216
feat: add RDS primary key transformer #1216
Conversation
0bedac2
to
26360c3
Compare
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## feature/rds-support #1216 +/- ##
====================================================
Coverage 63.42% 63.42%
====================================================
Files 297 297
Lines 18931 18931
Branches 4573 4573
====================================================
Hits 12007 12007
Misses 6309 6309
Partials 615 615 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
packages/amplify-graphql-index-transformer/src/graphql-index-transformer.ts
Outdated
Show resolved
Hide resolved
packages/amplify-graphql-index-transformer/src/graphql-primary-key-transformer.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nits, overall LGTM
if (getResolver) { | ||
addIndexToResolverSlot(getResolver, [primaryKeySnippet]); | ||
} | ||
|
||
if (listResolver) { | ||
const sortDirectionValidation = printBlock('Validate the sort direction input')(compoundExpression(validateSortDirectionInput(config, true))); | ||
addIndexToResolverSlot(listResolver, [ | ||
primaryKeySnippet, | ||
sortDirectionValidation | ||
]); | ||
} | ||
|
||
if (createResolver) { | ||
addIndexToResolverSlot(createResolver, [primaryKeySnippet]); | ||
} | ||
|
||
if (updateResolver) { | ||
addIndexToResolverSlot(updateResolver, [primaryKeySnippet]); | ||
} | ||
|
||
if (deleteResolver) { | ||
addIndexToResolverSlot(deleteResolver, [primaryKeySnippet]); | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need these for RDS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we do, in order to set the keys
metadata which is later used in lambda to set WHERE
conditions based on the columns used in primary key.
packages/amplify-graphql-index-transformer/src/resolvers/generators/rds-vtl-generator.ts
Outdated
Show resolved
Hide resolved
packages/amplify-graphql-index-transformer/src/resolvers/generators/vtl-generator.ts
Outdated
Show resolved
Hide resolved
c7667cf
to
17a9e06
Compare
Description of changes
CDK / CloudFormation Parameters Changed
Issue #, if available
Description of how you validated changes
Expanded the current unit tests to be run for RDS primary key transformer.
Checklist
yarn test
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.