the-deep / server

Server for DEEP
https://app.thedeep.io/
GNU Affero General Public License v3.0
9 stars 3 forks source link

Implement graphql mutation node for delete lead in bulk #1459

Open susilnem opened 5 months ago

susilnem commented 5 months ago

Problem Statement

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

Acceptance Criteria

The 'Lead' feature works with a graphql mutation.

Existing

https://github.com/the-deep/server/blob/bbfdef24fa80f04a046cca7f957297adc534ba15/apps/lead/views.py#L257-L265 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
                }
              }
            }