5 votes
Accepted

Cannot query field \"search\" on type \"Query\"

The App_Config\Sitecore\Services.GraphQL\Sitecore.Services.GraphQL.Content.config is from the JSS package, no need the change there somethings. It is about your GraphQL endpoint, In your end point ...
Jan Bluemink's user avatar
  • 1,165
4 votes

JSS layout service, how to restrict public access

Well you can't. The one mechanism that could lock that service down with something that could not just be picked up on the network tab and restrict access to the service to only those people you ...
Mark Cassidy's user avatar
3 votes

How do you render Headless ASP.NET to present a Sitecore page as 404?

You can use: return Redirect("/ErrorPages/404"); or return Redirect("http://myErrorPage"); instead of: return View("NotFound", request.Response.Content.Sitecore.Context); ...
Alexander's user avatar
  • 1,273
3 votes
Accepted

Prevent Sitecore from creating the sitename#lang cookie in jss/nextjs app

Here is an example of how you can create a custom processor to remove the lang cookie for Layout Service requests: Create a new class that inherits from JssGetLayoutServiceContextProcessor. Override ...
Vishal Khera's user avatar
3 votes
Accepted

How to add a custom header in every JSS layout service request in Node JS reverse proxy solution template

This is doable in Node JS reverse proxy template. Go to \src\config.ts Under the ProxyConfig => proxyOptions. Basically, this is http-proxy-middleware, so you can customize it like here. Add the ...
Andi AR's user avatar
  • 723
3 votes
Accepted

ProcessItem when extending JssGetLayoutServiceContextProcessor

Since you are extending the JssGetLayoutServiceContextProcessor, you will not have access to the ProcessItems method from the RenderingContentsResolver. One thing you can do is to implement it within ...
Hishaam Namooya's user avatar
3 votes
Accepted

When JSS component is hidden via personalization Experience Editor show warning about missing "Hidden Rendering" implementation

To fix the issue you need to implement React component for this rendering. The problem is that layout service returns it with space in name, so your componentFactory.js should have following generated ...
whuu's user avatar
  • 615
3 votes
Accepted

Why JSS Layout Service default resolver differently resolves reference fields of the same item, leaving some with the reference item context or ID?

This looks similar to the issue we had in our solution which was identified as a bug in Layout Service and fixed for us by Sitecore Support in both 9.3 and 10.0. You can check it with Sitecore Support ...
whuu's user avatar
  • 615
3 votes
Accepted

How to get ContentBlockModel/Component Model from PageModel directly using asp.net core rendering sdk

Once you get a Component from the Placeholder, you can use the ReadFields<T>() method or other Read methods to get strongly-typed values from it. Keep in mind that this is just JSON ...
nickwesselman's user avatar
2 votes
Accepted

Relative item path in layout service call is not working

We have discussed the issue in a private chat and figured out, that the /CustomHome item are placed on the same level with a site start item which makes it impossible to resolved by relative path. In ...
Artem Prashkovich's user avatar
2 votes

Using Layout Service with master db

JSS Layout Service take a database based on the current site which is resolved by a domain name in your URL. Your site, that stays behind jssapp domain, is configured to use the web database. Update ...
Artem Prashkovich's user avatar
2 votes
Accepted

Sitecore.LayoutService.dll version mismatch between NuGet and Headless Services package

I agree NuGet Packages for Layout Services are confusing here. But You need to use sc-packages - Sitecore.LayoutService 7.1.0 here. PM> Install-Package Sitecore.LayoutService -Version 7.1.0 -Source ...
Mahendra Shekhawat's user avatar
2 votes
Accepted

Why is JSS rendering items of template Sample Item but not of any other template?

Following some testing locally, the reason you may be getting an Error 404 is when there is no layout set on the item. So, my test cases were as follows: 1st Test Case Create an template without any ...
Hishaam Namooya's user avatar
2 votes
Accepted

How to get 404 status code on Rendering host

When a new Next.js app is create a default 404 Page file is created. This file is statically generated at build time. import NotFound from 'src/NotFound'; const Custom404 = (): JSX.Element => <...
Vlad Iobagiu's user avatar
  • 18.2k
2 votes

How do you render Headless ASP.NET to present a Sitecore page as 404?

We have implemented it as a custom Pipeline with Sitecore JSS therefore it will work also with ASP.NET Headless. Of course in integrated mode. In headless mode you need to approach this with different ...
Peter Procházka's user avatar
2 votes

Layout Service performance optimisation

Few ideas for troubleshooting. They are not really related to JSS, but still worth trying: Where are the servers located? When providing TTFB values are these from a region nearby? E.g. you are ...
vzaverugo's user avatar
  • 831
1 vote

GraphQL Component Query does not effect Layout Service response

Had the same issue and found another solution (to what probably is a bug - still working with Sitecore support on that). Based on what Chet already found I checked my config and noticed I had 2 ...
Gatogordo's user avatar
  • 19.9k
1 vote

GraphQL Component Query does not effect Layout Service response

Workaround The expectation is that the GraphQLAwareRenderingContentsResolver should be the default for any Json Renderings. With that said, I've identified a workaround that might help others with the ...
Chet Cheeto's user avatar
1 vote

Layout Service returns 404 on CD Servers for Sitecore 10.2 XM

This is likely caused by one of two issues: The API key is incorrectly configured (less likely given the symptoms) The Headless Services package is missing required configuration on the CD role. (...
Chet Cheeto's user avatar
1 vote

Extending LayoutService RenderingContentsResolver class to configure default LayoutService response

First potential issue: It looks like you're creating an entirely new config called "jss-rendering". Was this intentional, and did you set up your site to use this config? If using JSS+SXA ...
Davy8's user avatar
  • 171
1 vote
Accepted

How to add a new property in the route object of the JSS Layout Service?

I have performed an investigation on how Sitecore adds the values to the route. As of now, I've found 2 ways of adding custom data to the route node: Extend the GetJsLayoutRenderer and override the ...
Hishaam Namooya's user avatar
1 vote

Skip standard fields in GraphQL query results without strongly-typed items

Without a sample query reference to tailor my answer, I think what you could leverage here are query fragments to help with multiple templates. For example: fragment itemDetails on Item { id name ...
Julius A's user avatar
  • 750
1 vote

Asp.Net Model binding is not working for any node that is under "placeholders" using Sitecore ASP.NET Rendering SDK

If you are talking about the OOTB code, you can see index.cshtml. Here the name of the placeholder is jss-main. You should be adding the placeholder Settings with the same name on the Sitecore page ...
Jitendra's user avatar
  • 1,028
1 vote
Accepted

Adding a list of objects to Context Data returned by Layout Service

This can be done in following way. protected override void DoProcess(GetLayoutServiceContextArgs args, AppConfiguration application) { args.ContextData.Add("items", new[] { ...
Arvind Gehlot's user avatar
1 vote

Layout Service Sending Sitecore Item Name instead of Component Name

So I've updated JSS to 15.0.1 and it fixes the componentName issue. It seems there's a bug in Sitecore 10 and Jss that was fixed in 15.0.1. Strange that it wasn't mentioned anywhere in the release ...
Jeeby's user avatar
  • 251
1 vote

JSS Layout Service fails an item resolving by path with virtual directory

Layout Service can not resolve a virtual directory by default. Sitecore recommends to always populate sc_site parameter in the calls to Layout Service to use this technique. But, if you have more than ...
Artem Prashkovich's user avatar
1 vote
Accepted

Method not found: 'Sitecore.JavaScriptServices.ViewEngine.Pipelines.GetRenderEngineFactory.GetRenderEngineFactoryArgs.get_RenderEngineType()

You appear to have an inconsistent JSS installation. Ensure all Sitecore.JavaScriptServices assemblies are of the same version. If you are referencing JSS assemblies via NuGet, ensure you are ...
nickwesselman's user avatar
1 vote

How tracking works for Layout service used for Mobile apps (API-Only Mode)?

As mentioned, Sitecore's session tracking is cookie-based, so for native/mobile apps you will need to use a HTTP client that is capable of storing cookies. For instance, if using React Native, it has ...
Adam Weber's user avatar
  • 2,265
1 vote

How tracking works for Layout service used for Mobile apps (API-Only Mode)?

The Layout Service executes within the Sitecore MVC rendering engine, and thus retains all Sitecore analytics tracking and functionality. So if you use the Layout Service for routing in your JSS app, ...
Mahendra Shekhawat's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible