Posts

Showing posts with the label Edge Schema

Extending Edge GraphQl Schema To Support Custom Fields In XM Cloud

Hello everyone! In this blog, we'll explore how to extend the GraphQL schema to support custom fields. In XM Cloud, when using the preview endpoint and running a search GQL query, all item versions are returned rather than just the latest ones. This can be challenging for authors who need to verify results in the page builder, as it relies on the preview endpoint for executing GQL queries. In this blog, we will add _latestversion to supported field types in GQL schema. We will extend Sitecore.Services.GraphQL.EdgeSchema.Services.SearchService . Below is the code for your references. namespace Foundation.Services { using System; using System.Collections; using System.Linq.Expressions; using System.Reflection; using Sitecore; using Sitecore.Services.GraphQL.Content.GraphTypes.ContentSearch; using Sitecore.Services.GraphQL.EdgeSchema.GraphTypes.Search.Models; using Sitecore.Services.GraphQL.EdgeSchema.Services; using Sitecore.Services.GraphQL.EdgeSchema.S...