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: deserialization of custom scalars #536

Merged
merged 3 commits into from
May 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AWSAppSyncClient/AWSAppSyncCache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Foundation
public enum AWSAppSyncQueriesCacheError: Error {
case invalidRecordEncoding(record: String)
case invalidRecordShape(object: Any)
@available(*, deprecated, message: "No longer being used and will be removed in a future revision.")
case invalidRecordValue(value: Any)
}

Expand Down
2 changes: 1 addition & 1 deletion AWSAppSyncClient/Internal/SQLiteSerialization.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ final class SQLiteSerialization {
switch fieldJSONValue {
case let dictionary as JSONObject:
guard let reference = dictionary[serializedReferenceKey] as? String else {
throw AWSAppSyncQueriesCacheError.invalidRecordValue(value: fieldJSONValue)
return fieldJSONValue
Copy link
Contributor

Choose a reason for hiding this comment

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

From the Apollo issue linked in the description, has the PR with the same change to the SQLiteSerialization file here https://github.com/apollographql/apollo-ios/pull/1144/files#diff-e9bbcdac7903360aed17a5df82e644121e800adbc8b56bc03ffcf1dccc7dfe0a . With this, this change looks accurate to do since I think the file was lifted from the apollo codebase.

}
return Reference(key: reference)
case let array as [JSONValue]:
Expand Down