-
-
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
morph adapter errors shouldn't fail the query if there are also valid results #562
Comments
other words that are failing: nero, qui, quibuscum (also double-click), quis and many more |
@balmas, @irina060981: To handle situations like that gracefully we should probably start to use warnings along with errors in our GraphQL API. I think those could have the following meanings:
What do you think about an approach like the above? If it seems reasonable, I can add it into the GraphQL interface and, possibly, to other places. |
This makes sense to me. |
I like this suggestion too |
Kirlat, Question: in the case of "caro" a warning will be issued. for the user, the warning is totally transparent, correct? |
Yes, the warning will be used internally within the system but will not be shown to the user. Users will see no special messages in this case. The UX of the user would be exactly the same as in cases where things will go smoothly and there will be no warnings at all. The user will be notified only of errors that prevent morphological data from being displayed. Such notifications would explain to the user why no data for the user's request was retrieved. |
Thanks!!! |
The ultimate source of truth for error handling is in GraphQL specifications: http://spec.graphql.org/draft/#sec-Errors. Sometimes Apollo error response matches it (https://www.apollographql.com/docs/apollo-server/data/errors/), sometimes, it seems, doesn't: https://www.apollographql.com/blog/full-stack-error-handling-with-graphql-apollo-5c12da407210/ The last source is, however, from 2018, when the GraphQL docs did not have the errors specs published, so maybe things have changed since then. I think we should comply with GraphQL specs first and foremost and only then think about following the Apollo practices: we might use GraphQL solutions other than Apollo and interoperability is a must. Based on what I've read and know so far I suggest the following approach: a. If the query completed successfully and no errors occurred during its execution, the response will have a
b. If the query succeeded partially and there were some errors during its executions, the response will have both a
c. If the query failed completely and no homonym info can be returned, then the response will contain a
Then on the client side, we should check if the If Regarding the format of the
@balmas, @irina060981: does all of the above make sense to you? |
I believe it is relly very similiar to the way Do you suggest to change the response on |
I agree it is very similar to the way it is currently handled with the client adapters. The proposed error extensions structure looks fine to me. One thing to consider here is whether it adds any value to pass a non-critical warning on to the QraphQL API in this case. It has no value for the end user since we never show them the error and if we did they couldn't do anything about it. However it is very helpful for debugging. That's the only reason to include it IMHO. |
I don't think it would make sense to change client adapters to match GraphQL specification exactly. Those are different domains, and we might use something different along with GraphQL as well. Different formats should be able to coexist peacefully. It is a very good point that the client adapters may not know what error is critical for the client app and what is not. But I think from client adapter's point of view an error is something that prevents results from being obtained: a network error, an incorrect parameter or a bad parameter set. If client adapters experienced an error it should return no results at all. The warning, on the other hand, might be an indication that the data returned from client adapters might be incomplete (partial) due to some non-critical error conditions. But the data could still have value to the client. A warning would notify the client that the data is incomplete and it might do an extra effort to retrieve some additional data somewhere, or let the user know that parts of data might be missing. So, considering the above, I think it would probably be good to change the client adapters to support warnings. What do you think about that? |
Yes I agree |
As we talked on the meeting it could be useful, but I think that such warnings could be catched in the following cases:
This way I think that such warnings would appear mostly from user's issues, because they are needed to have more specific knowledge. |
This should be fixed by #568. The changes have been merged to master. |
reported my @monzug . Reproducible with a lookup of the Latin word 'caro'
For this word, the test on
if (adapterMorphRes.errors.length === 0) {
at https://github.com/alpheios-project/alpheios-core/blob/master/packages/components/src/data-model/word-query/lexical-data/data-objects/tufts-morphology-data.js#L50 returns false because there are some errors in the morph response but there are also valid lexemes.We should not entirely fail the query in this case, but proceed with the valid data results.
The text was updated successfully, but these errors were encountered: