Open HuiSF opened 3 years ago
what is codegenerated? does the schema contain information that the phone is of type AWSPhone?
type Person @model {
id: ID!
name: String!
phone: AWSPhone
}
The phone field type is string
in codegen generated models (schema).
AWSPhone
is used and validated within AppSync API.
Related to https://github.com/aws-amplify/amplify-js/issues/9065
@HuiSF Is the error handler/callback being triggered when you run into this issue?
No @chrisbonifacio error handler cannot capture this error due to this issue https://github.com/aws-amplify/amplify-android/issues/1637 .
Before opening, please confirm:
Language and Async Model
Java, Kotlin
Amplify Categories
DataStore
Gradle script dependencies
Environment information
Please include any relevant guides or documentation you're referencing
No response
Describe the bug
While using schemas with
AWSPhone
typed fields, if invalid phone numbers are provided,save
API call succeeded, model saved into local DB, modal is not saved into DynamoDB due to DynamoDB value validation raised GraphQL error.Expected behavior:
save
API call should return error with clear error message. Invalid data should not persisted in local DB.Original issue: https://github.com/aws-amplify/amplify-flutter/issues/822#issuecomment-904919041 amplify-ios issue: https://github.com/aws-amplify/amplify-ios/issues/1393
Schema example
Reproduction steps (if applicable)
Code Snippet
Java code example
Log output
amplifyconfiguration.json
No response
GraphQL Schema
Additional information and screenshots
GraphQL request
GraphQL response