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

Returning non fatal errors alongside data #1536

Open
yairsilbermintz-aon opened this issue Jan 25, 2024 · 0 comments
Open

Returning non fatal errors alongside data #1536

yairsilbermintz-aon opened this issue Jan 25, 2024 · 0 comments

Comments

@yairsilbermintz-aon
Copy link

I have a mutation that updates multiple records. In cases where some of the records would be invalid, I want to skip updating those records, update what records I can, and return a list of the ones that failed in the errors array

GraphQL has support for returning a partial response along with non fatal error information. Graphene already uses this in certain cases, such as an error accessing a specific subfield in a request.

There are docs for [https://docs.graphene-python.org/projects/django/en/latest/mutations/#simple-example](returning data from a successful mutation), and it is easy to return an error by raising an exception. But is there any way for me to return both from my mutation?

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

1 participant