-
Notifications
You must be signed in to change notification settings - Fork 117
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
Conversation
…ncorrect for many types
…newly proposed ModelIdentifier codegen changes
Reviewers, please take a close look to ensure no unexpected behavior differences from changes made to AppSyncRequestFactory (DataStore) and AppSyncGraphQLRequestFactory (API). |
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.
Left a few minor comments and the new test model classes are missing the copyright header, but core logic LGTM.
aws-api-appsync/src/main/java/com/amplifyframework/api/aws/GraphQLRequestHelper.java
Outdated
Show resolved
Hide resolved
aws-api/src/main/java/com/amplifyframework/api/aws/GraphQLRequestVariable.kt
Show resolved
Hide resolved
aws-api/src/main/java/com/amplifyframework/api/graphql/model/ModelQuery.java
Outdated
Show resolved
Hide resolved
aws-api/src/test/java/com/amplifyframework/api/aws/AppSyncGraphQLRequestAndResponseCPKTest.kt
Outdated
Show resolved
Hide resolved
aws-api/src/test/java/com/amplifyframework/api/aws/AppSyncGraphQLRequestAndResponseCPKTest.kt
Outdated
Show resolved
Hide resolved
aws-api/src/test/java/com/amplifyframework/api/aws/AppSyncGraphQLRequestAndResponseCPKTest.kt
Outdated
Show resolved
Hide resolved
aws-api/src/test/java/com/amplifyframework/api/aws/AppSyncGraphQLRequestFactoryTest.java
Outdated
Show resolved
Hide resolved
core/src/test/java/com/amplifyframework/core/model/ModelIdentifierTest.kt
Show resolved
Hide resolved
testmodels/src/main/java/com/amplifyframework/testmodels/cpk/AmplifyModelProvider.java
Show resolved
Hide resolved
@eeatonaws Addressed all comments. Thank you. |
try { | ||
return Collections.singletonMap("not", parsePredicate(qpg.predicates().get(0))); | ||
} catch (IndexOutOfBoundsException exception) { | ||
throw new IllegalStateException( |
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.
Should this be throwing an AmplifyException
instead?
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.
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 { |
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.
This function doesn't throw AmplifyException
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?
General Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.