Open ajroberts0417 opened 5 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
We currently have exactly this problem: we'd like to sent back partial data to the user, even if there was an error. This doesn't seem to be possible with graphene-django :-(
https://github.com/graphql-python/graphene-django/blob/b0cba398a1bacd9305c50e784b862785348fca2d/graphene_django/views.py#L284-L285
Currently Graphene-Django assumes any exception during execution is cause for an invalid ExecutionResult, meaning I can't obtain partial data, and my data field is "null".
This is an issue for several reasons, the most obvious being that my client should be able to obtain partial data, even on an exception during execution. Sometimes these exceptions are caused by user error (e.g. bad input).
graphql-core allows partial data to be sent on error: https://github.com/graphql-python/graphql-core/blob/fa4eeda36029680205e20059379e89189b946032/graphql/execution/base.py#L23-L39
What's the rationale behind setting
invalid=True
on all execution errors?EDIT:
From this tutorial it's clear that this behavior isn't what graphql-python expects: https://www.howtographql.com/graphql-python/6-error-handling/