Return data and errors #2261
-
Hi everybody! I got a use case I'm not sure how to implement. I'd like to provide the functionality of a multi-delete mutation. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi! I think the best approach is to return a Union Type with both Error type and your Object type. Let me know if that helps! |
Beta Was this translation helpful? Give feedback.
Hi!
I think the best approach is to return a Union Type with both Error type and your Object type.
Here there is an example of what I mean: https://play.strawberry.rocks/?gist=a414da7f71ead354c799b062f8e34965
Since the
errors
field is used when an unexpected exception occurs.Let me know if that helps!
We also have a Discord channel where we can chat :)