Skip to content

Add GraphQL API to list resource links

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

What does this MR do and why?

Adds a GraphQL API to list issuable resource links for an incident.

This feature is behind a feature flag. There is no front-end development for this yet.

Contributes to #363338 (closed)

Database queries

The table on production is currently empty as this feature is under development.

For getting all resource links in an incident issue - https://console.postgres.ai/shared/dcc4e351-123d-4a13-beb9-71f1b84b17e4

For getting a single resource link from an incident issue - https://console.postgres.ai/shared/45a4cd8c-6184-4841-8e3a-f28bf5d69c83

GraphQL Queries

All resource links in an incident
query GetIssuableResourceLinks($incidentId: IssueID!) {
  issue(id: $incidentId) {
    issuableResourceLinks(incidentId: $incidentId) {
      nodes {
        id
        issue { id title }
        link
        linkType
        linkText
      }
    }
  }
}

Query variables

{
  "incidentId": "<global id of incident>"
}
Single resource link of incident
query GetIssuableResourceLinks($incidentId: IssueID!, $id: IncidentManagementIssuableResourceLinkID!) {
  issue(id: $incidentId) {
    issuableResourceLink(incidentId: $incidentId, id: $id) {
        id
        issue { id title }
        link
        linkType
        linkText
    }
  }
}

Query variables

{
  "incidentId": "<global id of incident>",
  "id": "global id of resource link"
}

Screenshots

Resource links list Single resource link
Screenshot_2022-06-23_at_1.01.12_PM single_item

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 global id of the incident issue.
  3. Paste in the above mutation example.
  4. Check response.
  5. To try for one resource link, also copy the global id of resource link along with global id of incident issue.

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