Skip to content
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

fix(api): Fix Custom Primary Key API Support #2470

Merged
merged 33 commits into from
Jun 29, 2023
Merged

Conversation

tylerjroach
Copy link
Member

  • PR title and description conform to Pull Request guidelines.

Issue #, if available:

Description of changes:

How did you test these changes?
(Please add a line here how the changes were tested)

Documentation update required?

  • No
  • Yes (Please include a PR link for the documentation update)

General Checklist

  • Added Unit Tests
  • Added Integration Tests
  • Security oriented best practices and standards are followed (e.g. using input sanitization, principle of least privilege, etc)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

…newly proposed ModelIdentifier codegen changes
@tylerjroach tylerjroach marked this pull request as ready for review June 28, 2023 19:27
@tylerjroach tylerjroach requested a review from a team as a code owner June 28, 2023 19:27
@tylerjroach
Copy link
Member Author

Reviewers, please take a close look to ensure no unexpected behavior differences from changes made to AppSyncRequestFactory (DataStore) and AppSyncGraphQLRequestFactory (API).

Copy link
Contributor

@eeatonaws eeatonaws left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few minor comments and the new test model classes are missing the copyright header, but core logic LGTM.

@tylerjroach
Copy link
Member Author

@eeatonaws Addressed all comments. Thank you.

try {
return Collections.singletonMap("not", parsePredicate(qpg.predicates().get(0)));
} catch (IndexOutOfBoundsException exception) {
throw new IllegalStateException(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be throwing an AmplifyException instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a good catch, thank you. API category will now catch this and throw IllegalStateException as before and DataStore will catch and throw DataStoreException as before.

Map<String, Object> result,
ModelField modelField,
Object fieldValue,
ModelAssociation association) throws AmplifyException {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function doesn't throw AmplifyException

@tylerjroach tylerjroach merged commit 3588c48 into main Jun 29, 2023
@tylerjroach tylerjroach deleted the tjroach/cpk-api branch June 29, 2023 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants