Routes
The Routes object type provides URLs for various key pages and actions within the store. It serves as a centralized reference for route paths such as the store root, user account pages, cart, checkout, catalog, blog, and search. All fields are optional and return string URLs when available.
Type Definition
type Routes {
rootUrl: String
accountUrl: String
accountEditUrl: String
accountLoginUrl: String
accountLogoutUrl: String
accountRegisterUrl: String
accountPasswordRecoverUrl: String
accountPasswordChangeUrl: String
accountOrdersUrl: String
accountWishlistUrl: String
searchUrl: String
cartUrl: String
checkoutUrl: String
catalogUrl: String
blogUrl: String
}Fields
| Field | Type | Nullable | Description | Relationships |
|---|---|---|---|---|
rootUrl | String | Yes | URL to store root | None |
accountUrl | String | Yes | URL to user account page | None |
accountEditUrl | String | Yes | URL to user account edit page | None |
accountLoginUrl | String | Yes | URL to user account login page | None |
accountLogoutUrl | String | Yes | URL to sign out current user | None |
accountRegisterUrl | String | Yes | URL to register a new customer account | None |
accountPasswordRecoverUrl | String | Yes | URL to account password recovery | None |
accountPasswordChangeUrl | String | Yes | URL to account password update | None |
accountOrdersUrl | String | Yes | URL to user account orders page | None |
accountWishlistUrl | String | Yes | URL to user account wishlist page | None |
searchUrl | String | Yes | URL to store search page | None |
cartUrl | String | Yes | URL to cart | None |
checkoutUrl | String | Yes | URL to checkout | None |
catalogUrl | String | Yes | URL to catalog | None |
blogUrl | String | Yes | URL to blog | None |
Relationships
The Routes type does not have direct relationships to other object types. It provides string URLs that can be used to navigate or link to other parts of the store or user account system.
Usage Examples
Basic Query
{
routes {
rootUrl
accountUrl
cartUrl
checkoutUrl
}
}Field Selection
{
routes {
accountLoginUrl
accountRegisterUrl
accountPasswordRecoverUrl
}
}Nested Queries
Since Routes fields are scalar strings and do not reference nested objects, nested queries are not applicable.
Filtering and Sorting
Filtering, sorting, and pagination are not applicable to the Routes type as it represents a fixed set of URL strings.
Implements
The Routes type does not implement any interfaces.
Connections
There are no connection fields on the Routes type.
Related Types
Query— Theroutesfield on the rootQuerytype returns theRoutesobject.
Best Practices
- Use the
Routesobject to dynamically retrieve URLs instead of hardcoding paths in your client application. This ensures your app stays consistent with backend routing. - Always check if a URL field is
nullbefore using it, as all fields are optional and may not be available depending on store configuration. - Cache the
Routesresponse where appropriate to reduce unnecessary network requests, as these URLs typically do not change frequently. - Use the URLs provided by
Routesfor navigation or linking to ensure compatibility with future route changes.
Notes
- The API currently requires no authentication to query the
routesfield, but this may change in future versions. - Since all fields are optional strings, clients should handle missing URLs gracefully.
- There are no computed or derived fields in this type.
- No field arguments exist on the
Routestype. - Performance impact is minimal as this type returns a small fixed set of scalar fields.