-
Notifications
You must be signed in to change notification settings - Fork 202
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(auth): parse and surface returned subscription @auth errors #810
Conversation
ff07365
to
a7d585e
Compare
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.
Looks like we are parsing appsync errors and converting them to graphql errors so that we can expose them in the API category? Seems fine to me, but I'll defer to @lawmicha take a look.
...yPlugin/Sync/MutationSync/OutgoingMutationQueue/ProcessMutationErrorFromCloudOperation.swift
Show resolved
Hide resolved
AmplifyPlugins/API/AWSAPICategoryPlugin/Operation/AWSGraphQLSubscriptionOperation.swift
Outdated
Show resolved
Hide resolved
AmplifyPlugins/API/AWSAPICategoryPlugin/Operation/AWSGraphQLSubscriptionOperation.swift
Outdated
Show resolved
Hide resolved
extension AppSyncJSONValue { | ||
static func toJSONValue(_ json: AppSyncJSONValue) -> JSONValue { |
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 looks good to me, i'm not sure if there's any other way around this? maybe there's a way to just decode the payload?["errors"]
directly to [JSONValue.self]
instead of this
a7d585e
to
95f6aac
Compare
AmplifyPlugins/API/AWSAPICategoryPlugin/Support/Utils/GraphQLResponseDecoder+DecodeError.swift
Outdated
Show resolved
Hide resolved
When a subscription fails due to an authorization issue, parse and surface AppSyncJSONValue errors in order to let DataStore recover
95f6aac
to
72a0cd6
Compare
When a subscription fails due to an authorization issue, parse and surface AppSyncJSONValue errors
in order to let DataStore recover
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.