- Status changed to Fixed
about 1 year ago 9:38am 11 April 2023
Similar to v3 graphql, route() could return an interface Route
Then we have 3 types
- RouteInternal
- RouteExternal
- RouteRedirect
Each one of those is super useful for implementation by a frontend developer.
Example might be:
Frontend dev has a wildcard router.
User clicks link.
Router fetches '/test'/
Test returns from Drupal as an internal redirect
Frontend can get what it needs to redirect the user via transition rather than window.location.
Unsure where to put this code.
It doesnt feel like it follows the core principal of this module.
Its a sub module or side project at best. I'll create the issue here anyway for discussion.
Decide where and if this lives here.
If its all-round usefulness is core, then how this integrates with DataManager is unknown.
None
Addition of route()
Adds 'route' field to Link
interface Route {
url: String!
internal: Boolean!
}
type RouteInternal implements Route {
url: String!
internal: Boolean!
entity: RouteUnion
}
type RouteExternal implements Route {
url: String!
internal: Boolean!
}
type RouteRedirect implements Route {
url: String!
internal: Boolean!
status: Int!
redirect: Boolean!
}
Fixed
2.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.