Sitecore’s Layout Service acts as a Headless endpoint, delivering requested pages or rendering data in the JSON format. This service can be accessed via GraphQL in both Sitecore Headless (JSS) within traditional Content Delivery and the Sitecore Experience Edge product. Rendering Content Resolvers complement the Layout Service by exposing or providing complex Sitecore Content of the rendering once more, this time in JSON Object format.
Sitecore Headless provides rendering contents resolvers and they are found here:
/sitecore/system/Modules/Layout Service/Rendering Contents Resolvers.
When you are working with the SXA then SXA related rendering content resolver are found here:
/sitecore/system/Modules/Layout Service/Rendering Contents Resolvers/SXA
and
/sitecore/system/Modules/Layout Service/Rendering Contents Resolvers/Headless Experience Accelerator
These default resolves are used full for majority of situations. But custom resolvers may be required.
Here is the simple process for creating custom content resolve.
Step 1: Creating custom class by inherit
Sitecore.LayoutService.ItemRendering.ContentsResolvers.RenderingContentsResolver and must override ResolveContents method of the base class.
Copy the below class:
Step 2 : Creating Resolver Sitecore item
Create Sitecore item under /sitecore/system/Modules/Layout Service/Rendering Contents Resolvers.
Now Content Resolver is Ready to Use. You can find this custom resolver in Rending Layout service section Select Rendering Contents Resolver.
Additional Links
Official Sitecore Layout Service Documentation
Custom Rendering Contents Resolvers in Sitecore
Related Sitecore Blogs