-
Notifications
You must be signed in to change notification settings - Fork 2
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
Update apollo to 4.0.0 #92
Conversation
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.
One little tweak needed, otherwise I think we should be fine. We need to test this on real project with normalized cache.
if (response.hasErrors()) { | ||
throw NetworkError.CloudError( | ||
code = errorResponseParser.getErrorResponseCode(response), | ||
message = errorResponseParser.getErrorMessage(response) ?: "", | ||
message = errorResponseParser.getErrorMessage(response), | ||
) | ||
} | ||
|
||
// Non-compliant server, if data is null, there should be at least one error | ||
throw NetworkError.CloudError( | ||
code = errorResponseParser.getErrorResponseCode(response), | ||
message = errorResponseParser.getErrorMessage(response), | ||
) | ||
} |
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 two throws are duplicated and can be merged into single throw
// Non-compliant server, if data is null, there should be at least one error, or
// A GraphQL request error happened or a Graph field error bubbled up.
throw NetworkError.CloudError(
code = errorResponseParser.getErrorResponseCode(response),
message = errorResponseParser.getErrorMessage(response)
)
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.
Agreed ✅
Generated by 🚫 Danger |
No description provided.