Skip to content

Horizon APIs

What is Horizon?

With every site we create in Ingenuity we have an equivelant GraphQL API that helps support engineering teams with the query and mutations needed to conduct common tasks as well as fetching the relevant data needed to display a page or develop a storefront.

While Horizon is documented the Schema’s needed to operate a GraphQL API (and Schema introspection) Horizon is self-documenting.

Throughout this guide we will represent common Horizon use-cases but it is helpful to review the API in detail using the appropriate playground tools.

Endpoints

Template

You can access the existing sites Horizon APIs by requesting a URL with the below format.

https://horizon-api.[full site url]/graphql

Example

https://horizon-api.coggles.com/graphql

If the site being developed has not been setup with a domain. You will need to utilise the App APIs until the domain has been added (Note: This changes how you authenticate and how sessions are managed.) more details on App APIs are available on the full documentation.

Client-side Security

Horizon utilises Content Security Policy security headers that make it necessary when requesting Horizon from the browser to make the request via a proxy, especially when you’re requesting from a domain that is not the same as the Horizon domain.

Refer to our Framework guides for specific instructions.

Cache Keys

Horizon sets cookies to preserve customer preferences for shipping destination and currency. As a result you need to add the relevant cookies as cache keys to your Altitude configuration. This prevents caches being mixed and customers being served the wrong currency or destination.

altitude.yaml
routes:
cache:
cookies:
- 'en_currency_V6'
- 'en_shippingCountry_V6'