-
Notifications
You must be signed in to change notification settings - Fork 739
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
ApolloSQLite -> Fix deserialize method for custom scalars #1144
ApolloSQLite -> Fix deserialize method for custom scalars #1144
Conversation
Update forked master with apollo-ios master
…JSONDecodingError
@ppowers10: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/ |
case .couldNotConvert(value: _, to: _): | ||
break | ||
case .missingValue, .nullValue, .wrongType: | ||
XCTFail("Invalid error type.") |
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.
I think you can just do this and have this be a lot simpler:
switch graphQLError.underlying {
case JSONDecodingError.couldNotConvert(value: _, to: _)?:
break
default:
XCTFail("Invalid error type")
}
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.
@designatednerd - The above change was made, but it looks like CircleCI is complaining about ci/circleci: Apollo iOS 12.4
build. I ran the tests locally and didn't see any issues. I'm unable to trigger the build process again to see if it might pass and it was a glitch. My previous code passed all the tests on all the CircleCI checks.
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.
Yeah there's one test that gets flaky a decent amount - I'll kick the build
(approved, obviously) |
👍 |
1 similar comment
👍 |
…deserialize ApolloSQLite -> Fix deserialize method for custom scalars (cherry-pick 149806e)
Fix:
See Spectrum conversation regarding this issue
Changes:
Removed
invalidRecordValue
as it is no longer used anywhereUpdated
deserialize
method to returnfieldJSONValue
when a lack of a$reference
value is found. This allows custom scalar types to return properly rather than throwing the error.Updated tests to remove any
invalidRecordValue
thrown errors fromSQLiteNormalizedCacheError
as they are not used anymore. Instead, this test fails in the same manner thatInMemoryNormalizedCache
due to aJSONDecodingError
.Tests Passing