Home > @vue-storefront/magento-api > route

route() function

Returns the canonical URL for a specified product, category, or CMS page

Signature:

export default function route(context: Context, url: string, customQuery?: CustomQuery, customHeaders?: CustomHeaders): Promise<ApolloQueryResult<RouteQuery<RoutableInterface>>>;

Parameters

Parameter Type Description
context Context VSF Context
url string the URL to be resolved
customQuery CustomQuery (Optional) (optional) - custom GraphQL query that extends the default one
customHeaders CustomHeaders (Optional) (optional) - custom headers that extends the default headers

Returns:

Promise<ApolloQueryResult<RouteQuery<RoutableInterface>>>