Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardize LandPKS GraphQL API error responses #1264

Open
tm-ruxandra opened this issue Apr 29, 2024 · 1 comment
Open

Standardize LandPKS GraphQL API error responses #1264

tm-ruxandra opened this issue Apr 29, 2024 · 1 comment

Comments

@tm-ruxandra
Copy link
Contributor

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:

        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.

@shrouxm
Copy link
Member

shrouxm commented Nov 6, 2024

related to #510

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

2 participants