You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am updating from the AppSync SDK and using the Swift files generated by the Amplify CLI. However, I am encountering an issue where the parsing of enums fails.
public var status: HogeStatus {
get {
return snapshot["status"]! as! HogeStatus // <- fails
}
set {
snapshot.updateValue(newValue, forKey: "status")
}
}
Error:
Could not cast value of type ‘__NSCFString’ to ‘HogeStatus’.
It seems that snapshot["status"] is being interpreted as a String. In the AppSync SDK, the value is retrieved as an enum, but in Amplify, it becomes a String.
Is there any way to handle this in Amplify to avoid this issue?
In the AppSync SDK, there was logic to handle enums in GraphQLSelectionSetMapper, but I couldn't find a similar feature in Amplify.
Environments
Amplify CLI 12.13.1
Amplify 2.45.4
The text was updated successfully, but these errors were encountered:
This has been identified as a feature request. If this feature is important to you, we strongly encourage you to give a 👍 reaction on the request. This helps us prioritize new features most important to you. Thank you!
Description
I am updating from the AppSync SDK and using the Swift files generated by the Amplify CLI. However, I am encountering an issue where the parsing of enums fails.
It seems that snapshot["status"] is being interpreted as a String. In the AppSync SDK, the value is retrieved as an enum, but in Amplify, it becomes a String.
Is there any way to handle this in Amplify to avoid this issue?
In the AppSync SDK, there was logic to handle enums in GraphQLSelectionSetMapper, but I couldn't find a similar feature in Amplify.
Environments
Amplify CLI 12.13.1
Amplify 2.45.4
The text was updated successfully, but these errors were encountered: