Local Tasks
Adds a localTasks
field on the InternalUrl
and EntityUrl
interface to get the local tasks for a route.
Schema
Base
graphql
type LocalTask {
baseId: String!
active: Boolean!
url: Url!
title: String!
weight: Int!
}
Extension
graphql
extend interface InternalUrl {
localTasks: [LocalTask!]!
}
extend interface EntityUrl {
localTasks: [LocalTask!]!
}
extend type DefaultInternalUrl {
localTasks: [LocalTask!]!
}
extend type DefaultEntityUrl {
localTasks: [LocalTask!]!
}
extend type EntityCanonicalUrl {
localTasks: [LocalTask!]!
}
Example
graphql
query {
route(path: "/de/node/15957/edit") {
... on InternalUrl {
localTasks {
title
url {
path
}
}
}
}
}
json
{
"data": {
"route": {
"localTasks": [
{
"title": "View",
"url": {
"path": "/de/my-little-node"
}
},
{
"title": "Edit",
"url": {
"path": "/de/node/15957/edit"
}
},
{
"title": "Delete",
"url": {
"path": "/de/node/15957/delete"
}
},
{
"title": "Revisions",
"url": {
"path": "/de/node/15957/revisions"
}
},
{
"title": "Translate",
"url": {
"path": "/de/node/15957/translations"
}
}
]
}
}
}