Sitecore GraphQL schema and query cache reset

As you know GraphQL requires schema to execute your queries. In Sitecore implementation the schema is regenerated every time you touch templates.

What we recently discovered, that if you have separate CD and CM, schema on CD node will not be refreshed after publish.

Luckily, this is quite easy to fix. You need to create an event handler and subscribe it to publish:end:remote event.


public class TemplateUpdateHandler : Sitecore.Services.GraphQL.Content.EventHandlers.TemplateUpdateHandler
{
public TemplateUpdateHandler(IGraphQLEndpointManager endpointManager) : base(endpointManager)
{
}

public void OnPublishEndRemote(object sender, EventArgs e)
{
base.Reset(null);
}
}

Sitecore GraphQL schema and query cache reset

Mixing Sitecore JSS and SXA

This investigation of Sitecore JSS and SXA was done quite a while ago, but I didn’t get a chance to post it here. I need to go back to validation of this setup so this will be a living post and I’ll be updating as new findings arrive.

You might ask why would you need to mix them, but the reason is pretty simple. SXA brings a lot of functionality outside of presentation configuration (which I’m not a fan of) that can be useful for any site, like sites management, wizards for sites creation, local data sources, various site settings, etc.

Continue reading “Mixing Sitecore JSS and SXA”

Mixing Sitecore JSS and SXA