Skip to content

Return data and errors #2261

Answered by estyxx
thomaskoller asked this question in Q&A
Oct 18, 2022 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

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 :)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@thomaskoller
Comment options

Answer selected by thomaskoller
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants