Files
bbs/main/api/errors.py
T
nikolark 0a435d3224 ✨ Start on error handling
♻ Use TypedDocumentNode's instead of apollo-react-typescript codegen
💄 Add toast
2021-11-06 21:49:28 +01:00

23 lines
316 B
Python

import strawberry
@strawberry.interface
class Error:
message: str
@strawberry.field()
def error(self) -> bool:
return True
@strawberry.type
class FieldError(Error):
field: str
@strawberry.type
class FormErrors:
fields: list[FieldError]
message: str = ''
error: bool = True