Open tm-ruxandra opened 6 months ago
Create standard response formats for GraphQL API error handling and apply them to the LandPKS Terraso backend.
Currently, error handling and response code behavior is ad-hoc and not standard. For example, a few different error modes currently in use:
if not target_membership: cls.not_allowed( MutationTypes.DELETE, msg="Cannot delete a user membership that does not exist" )
if not user.has_perm(SiteNote.get_perm("delete"), site_note): cls.not_allowed()
return SiteTransferMutation( bad_permissions=bad_permissions, )
Research best-practices for GraphQL error handling and find a strategy to apply to the LandPKS backend. Add appropriate unit/integration tests and update the frontend as needed.
related to #510
Create standard response formats for GraphQL API error handling and apply them to the LandPKS Terraso backend.
Description
Currently, error handling and response code behavior is ad-hoc and not standard. For example, a few different error modes currently in use:
Research best-practices for GraphQL error handling and find a strategy to apply to the LandPKS backend. Add appropriate unit/integration tests and update the frontend as needed.