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
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I believe you can raise an exception and the message used for the exception will be sent to the client. |
Beta Was this translation helpful? Give feedback.
-
@Alkaraawi-Ali-Husham-Shakir Raising a custom Exception should do the job:
|
Beta Was this translation helpful? Give feedback.
@Alkaraawi-Ali-Husham-Shakir
Raising a custom Exception should do the job:
from graphql import GraphQLError