JSS Layout API
Overview of the JSS API that helps you fetch layout information for Sitecore items
When using JSS, you can get layout data from several endpoints, without worrying about data fetching implementation details. The JSS Layout API abstracts data fetching implementation details into services, clients, and data fetchers for REST and GraphQL endpoints. See some usage examples.
Sitecore endpoints for layout data
There are several options for fetching layout information from Sitecore:
Query the Sitecore Edge Preview GraphQL endpoint provided by Headless Services. Sitecore Edge Preview GraphQL API is an implementation of a GraphQL server on top of Sitecore. The Sitecore GraphQL schema mirrors the Experience Edge schema.
Query the GraphQL endpoint provided by Sitecore Experience Edge for XM. Sitecore Experience Edge for XM comes with a read-only GraphQL schema designed to accommodate common front-end use cases for headless Sitecore development.
You can choose whether you want to use REST or GraphQL endpoints when creating your JSS application with the parameter
--fetchWith REST or