Skip to Content

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

FieldTypeNullableDescriptionRelationships
rootUrlStringYesURL to store rootNone
accountUrlStringYesURL to user account pageNone
accountEditUrlStringYesURL to user account edit pageNone
accountLoginUrlStringYesURL to user account login pageNone
accountLogoutUrlStringYesURL to sign out current userNone
accountRegisterUrlStringYesURL to register a new customer accountNone
accountPasswordRecoverUrlStringYesURL to account password recoveryNone
accountPasswordChangeUrlStringYesURL to account password updateNone
accountOrdersUrlStringYesURL to user account orders pageNone
accountWishlistUrlStringYesURL to user account wishlist pageNone
searchUrlStringYesURL to store search pageNone
cartUrlStringYesURL to cartNone
checkoutUrlStringYesURL to checkoutNone
catalogUrlStringYesURL to catalogNone
blogUrlStringYesURL to blogNone

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.

  • Query — The routes field on the root Query type returns the Routes object.

Best Practices

  • Use the Routes object 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 null before using it, as all fields are optional and may not be available depending on store configuration.
  • Cache the Routes response where appropriate to reduce unnecessary network requests, as these URLs typically do not change frequently.
  • Use the URLs provided by Routes for navigation or linking to ensure compatibility with future route changes.

Notes

  • The API currently requires no authentication to query the routes field, 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 Routes type.
  • Performance impact is minimal as this type returns a small fixed set of scalar fields.
Last updated on