Skip to content

Add GraphQL API to delete resource links

Rajendra Kadam requested to merge 363338-links-widget-delete-gql-api into master

What does this MR do and why?

This MR adds a GraphQL API to delete resource links from an incident. Currently, there is no frontend development for this. This change is behind a feature flag.

Screenshots or screen recordings

Mutation Result
Screenshot_2022-06-14_at_6.14.57_PM Screenshot_2022-06-14_at_6.15.11_PM

Mutation

mutation DeleteIssuableResourceLink($input: IssuableResourceLinkDestroyInput!) {
  issuableResourceLinkDestroy(input: $input) {
    issuableResourceLink {
      id
      issue { id title }
      link
      linkText
      linkType
    }
    errors
  }
}

Query variables

{
  "input": {
    "id": "<IssuableResourceLink global id to delete>"
  }
}

How to set up and validate locally

  1. Add an issuable resource link by following the steps mentioned in Create API MR of this feature.
  2. Copy the link global id of the link.
  3. Paste in the above mutation example.
  4. Check the delete response and confirm from rails c by running IncidentManagement::IssuableResourceLink.all

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #363338 (closed)

Edited by Rajendra Kadam

Merge request reports