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

Implement graphql mutation node for delete lead in bulk #1459

Open
Tracked by #997
susilnem opened this issue Apr 4, 2024 · 0 comments
Open
Tracked by #997

Implement graphql mutation node for delete lead in bulk #1459

susilnem opened this issue Apr 4, 2024 · 0 comments
Assignees

Comments

@susilnem
Copy link
Member

susilnem commented Apr 4, 2024

Problem Statement

The 'lead bulk delete' features uses a Rest API.

Acceptance Criteria

The 'Lead' feature works with a graphql mutation.

Existing

server/apps/lead/views.py

Lines 257 to 265 in bbfdef2

@action(
detail=False,
methods=['post'],
url_path='bulk-delete',
)
def bulk_delete(self, request, project_id, version=None):
lead_ids = request.data.get('leads', [])
Lead.objects.filter(project_id=project_id, id__in=lead_ids).delete()
return response.Response(status=status.HTTP_204_NO_CONTENT)

The existing api doesnot contain any Serializer.

Rest Framework urls

method: POST
url: api/v1/project/<projectID>/leads/bulk-delete/
request payload: {
	"leads": ["72","43"]
}

Purposed

mutation MyMutation ($projectId: ID! $input: [ID!]) {
              project(id: $projectId) {
                leadBulk(deleteIds: $input) {
                    errors
                    deletedResult : BulkLead
                }
              }
            }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants