Add GraphQL API to list resource links
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 |
---|---|
How to set up and validate locally
- Add an issuable resource link by following the steps mentioned in Create API MR of this feature.
- Copy the global id of the incident issue.
- Paste in the above mutation example.
- Check response.
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #363338 (closed)
Edited by Rajendra Kadam