The deleteWidgetFromDashboard
mutation removes a specific widget from a dashboard.
Signature
deleteWidgetFromDashboard(id: String!, widgetId: String!): Dashboard!
Arguments
The unique identifier of the dashboard containing the widget.
The unique identifier of the widget to remove from the dashboard.
Response
Returns the updated Dashboard
object with the widget removed. See Dashboard for the schema.
Usage Example
The following example shows how to remove a widget from a dashboard:
mutation DeleteWidgetFromDashboard($id: String!, $widgetId: String!) {
deleteWidgetFromDashboard(id: $id, widgetId: $widgetId) {
id
widgets {
id
title
}
}
}
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <jwt_token>" \
-d '{
"query": "mutation DeleteWidgetFromDashboard($id: String!, $widgetId: String!) { deleteWidgetFromDashboard(id: $id, widgetId: $widgetId) { id widgets { id title } } }",
"variables": {
"id": "dashboard_123456789",
"widgetId": "widget_987654321"
}
}' \
https://{ACCOUNT}.askwisdom.ai/graphql
{
"data": {
"deleteWidgetFromDashboard": {
"id": "dashboard_123456789",
"widgets": [
{
"id": "widget_remaining",
"title": "Remaining Widget"
}
]
}
}
}