How to return a costum error message in graphene? #1160
|
I created the following class to update the post in spesfic conditions but if the contitions ==False the I need to return |
Answered by
danish-wani
Mar 24, 2021
Replies: 2 comments
|
I believe you can raise an exception and the message used for the exception will be sent to the client. |
0 replies
|
@Alkaraawi-Ali-Husham-Shakir Raising a custom Exception should do the job:
|
0 replies
Answer selected by
zbyte64
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@Alkaraawi-Ali-Husham-Shakir
Raising a custom Exception should do the job:
from graphql import GraphQLError