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

GraphQL Replication error missing information #5952

Open
phal0r opened this issue Apr 29, 2024 · 4 comments
Open

GraphQL Replication error missing information #5952

phal0r opened this issue Apr 29, 2024 · 4 comments

Comments

@phal0r
Copy link

phal0r commented Apr 29, 2024

If the GraphQL server returns an error in the errors json response, it usually includes a code (most of the time a string like AUTHENTICATION_ERROR) in the extensions object. The extensions object is a place to also add other arbitrary information according to the spec.

Starting with RxDB 14 errors seem to be normalized and the graphql replication will just throw an error with the errors array as seen here: https://github.com/pubkey/rxdb/blob/master/src/plugins/replication-graphql/index.ts#L167

The normalized errors do not contain the extensions object anymore, which in our case breaks token refresh, because we cannot detect the proper error code anymore.

Is this behaviour intentional or a bug?

@pubkey
Copy link
Owner

pubkey commented Apr 30, 2024

This is not intentional. If any information is missing in the thrown error, we can add it. Please make a PR.

Copy link

stale bot commented May 7, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed soon. Please update it or it may be closed to keep our repository organized. The best way is to add some more information or make a pull request with a test case. Also you might get help in fixing it at the RxDB Community Chat

@stale stale bot added the stale label May 7, 2024
@phal0r
Copy link
Author

phal0r commented May 9, 2024

Still relevant. We will create a MR

@stale stale bot removed the stale label May 9, 2024
Copy link

stale bot commented May 16, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed soon. Please update it or it may be closed to keep our repository organized. The best way is to add some more information or make a pull request with a test case. Also you might get help in fixing it at the RxDB Community Chat If you know you will continue working on this, just write any message to the issue (like "ping") to remove the stale tag.

@stale stale bot added the stale label May 16, 2024
@stale stale bot removed the stale label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants