You need to sign in or sign up before continuing.
Add GraphQL mutation to delete release asset link
What does this MR do?
Adds a GraphQL mutation - releaseAssetLinkDelete
- to delete a release asset link.
This new mutation is equivalent to the existing REST API update endpoint:
DELETE /projects/:id/releases/:tag_name/assets/links/:link_id
This MR is very similar to these MRs:
- !54605 (merged), where a creation mutation was added, and
- !56265 (merged), where an update mutation was added
Example query/response
When a link is successfully deleted
Query:
mutation {
releaseAssetLinkDelete(input: {id: "gid://gitlab/Releases::Link/187"}) {
link {
id
name
url
directAssetUrl
linkType
external
}
errors
}
}
Response:
{
"data": {
"releaseAssetLinkDelete": {
"link": {
"id": "gid://gitlab/Releases::Link/187",
"name": "A link",
"url": "https://example.com/link",
"directAssetUrl": "https://example.com/link",
"linkType": "OTHER",
"external": true
},
"errors": []
}
}
}
When the provided link doesn't exist
In this example, there's no link with an ID of 999999
.
Query:
mutation {
releaseAssetLinkDelete(input: {id: "gid://gitlab/Releases::Link/999999"}) {
link {
id
name
url
directAssetUrl
linkType
external
}
errors
}
}
Response:
{
"data": {
"releaseAssetLinkDelete": null
},
"errors": [
{
"message": "The resource that you are attempting to access does not exist or you don't have permission to perform this action",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"releaseAssetLinkDelete"
]
}
]
}
When the user doesn't have permission to delete
In this example, the user has Developer permissions to the project.
Query:
mutation {
releaseAssetLinkDelete(input: {id: "gid://gitlab/Releases::Link/188"}) {
link {
id
name
url
directAssetUrl
linkType
external
}
errors
}
}
Response:
{
"data": {
"releaseAssetLinkDelete": null
},
"errors": [
{
"message": "The resource that you are attempting to access does not exist or you don't have permission to perform this action",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"releaseAssetLinkDelete"
]
}
]
}
Permissions
Permissions for this endpoint mirror the existing REST API update endpoint.
Edited by Nathan Friend