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

Throw error instead of returning null #666

Conversation

schroda
Copy link
Collaborator

@schroda schroda commented Aug 23, 2023

In case e.g. no manga exists for the passed id, the query returned null. This makes it harder to have a "streamlined" error handling in the client, since these types of queries need a special handling to detect that the query returned an error.

Could be further improved to return custom errors, but for now, having a default error response is good enough

In case e.g. no manga exists for the passed id, the query returned null.
This makes it harder to have a "streamlined" error handling in the client, since these types of queries need a special handling.
Copy link
Collaborator

@Syer10 Syer10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What error does this throw? I'm not too sure if just changing the generic is enough

@schroda
Copy link
Collaborator Author

schroda commented Aug 27, 2023

it will return an error that it is definend as non nullable but returns null

@Syer10 Syer10 merged commit a76ce03 into Suwayomi:master Aug 28, 2023
@schroda schroda deleted the fix/graphql_queries_returning_null_instead_of_error branch August 28, 2023 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants