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

APIPlugin error deserialization with ConflictUnhandled errorType and model data #368

Closed
wants to merge 1 commit into from

Conversation

lawmicha
Copy link
Contributor

@lawmicha lawmicha commented Mar 31, 2020

Description of changes:

  • This keeps the Amplify's GraphQLError generic by making it a protocol, such that any GraphQL Plugin continues to implement their own conformance to GraphQLError.
  • The AmplifyPluginsCore contains a new AppSync specific class for deserializing the AppSync's graphQL errors into AppSyncGraphQLError.
  • Provide some conveient methods for getting the errorType: AppSyncErrorType
  • This work is mostly for propagating AppSync's conflict unhandled errors back to DataStore for conflict resolution handling. common use case for developers using API Plugin may cast to AppSyncGraphQLError if needed for additional fields like errorType string and data.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@lawmicha lawmicha requested a review from drochetti March 31, 2020 15:51
@lawmicha lawmicha force-pushed the feature/api-conflict-resolution branch 2 times, most recently from 62ca79e to a7f32a1 Compare March 31, 2020 16:29
@lawmicha lawmicha force-pushed the feature/datastore-conditional-update branch 2 times, most recently from 8977e88 to f09e606 Compare April 1, 2020 16:16
…with error object, containing errorType and data. errorType is "ConflictUnhandled" and data is the responseType according to selectioin set used for conflict resolution
@lawmicha lawmicha force-pushed the feature/api-conflict-resolution branch from a7f32a1 to 29d4d8e Compare April 3, 2020 02:10
@lawmicha lawmicha changed the base branch from feature/datastore-conditional-update to master April 3, 2020 02:10
@lawmicha lawmicha marked this pull request as ready for review April 3, 2020 20:06
@lawmicha lawmicha added api Issues related to the API category datastore Issues related to the DataStore category labels Apr 3, 2020
@lawmicha lawmicha self-assigned this Apr 3, 2020
@lawmicha
Copy link
Contributor Author

closed for #401

@lawmicha lawmicha closed this Apr 23, 2020
@lawmicha lawmicha deleted the feature/api-conflict-resolution branch April 27, 2020 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issues related to the API category datastore Issues related to the DataStore category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant