Hot answers tagged

6

I have some code to offer to start the node process(es) with custom arguments, e.g. --prof. However, I'd first like to highlight the following bits of information about GraphQL and JSS that might provide some insight. Sitecore GraphQL includes some built-in diagnostics features that can help diagnose API performance issues: https://jss.sitecore.com/docs/...


6

Find the schema configuration for the JSS app GraphQL endpoint in config files, and add the "search" query reference. <sitecore> <api> <GraphQL> <endpoints> <jss-app-nameGraphQLEndpoint> <schema hint="list:AddSchemaProvider"> <content type="Sitecore.Services.GraphQL.Content....


5

From the looks of it, the configuration was not patched correctly. The /sitecore/api/graph/items/master/… is the default JSS endpoint which has search query enabled, while the default JSS project setup does not have search query enabled (it has only Item query enabled by default). Check your configuration in http://yourdomain/sitecore/admin/showconfig....


4

I found 2 solution for this issue and I ended using method 1 for the "hashed url" convenience. Method 1: Using rendered(fieldRendererParameters) query ($datasource: String){ item (path:$datasource){ field (name:"Image") { rendered(fieldRendererParameters:"w=100&h=160") } } } The result of this query is... { "data": { "item":...


4

You don't need a JSS license to use the Sitecore.Services.GraphQL package, which is essentially the "core" part of using GraphQL with Sitecore. So you are free to create your own schemas, extenders, etc... or use the built-in options. There is a Sitecore.JavaScriptServices.GraphQL package as well. This package is primarily used to provide a custom JSS ...


4

I want to make it clear that Sitecore did not invent or create GraphQL. GraphQL is a pre-existing standard: https://graphql.org/ The Sitecore GraphQL API is an implementation of that standard with some Sitecore-specific bits. As I understand it, the endpoint is running C# code on the server that is defined for schemas and extenders. It wraps around ...


3

Ok, having spent some time trying to figure out how this whole thing works in Sitecore, I can now say, that SXA-JSS does not support integrated GQL. The problem lies in the sxa-jss configuration for the LayoutService, which is selected by default when you create a new SXA JSS site. The configuration above comes from this file: \App_Config\Modules\JSS SXA\...


3

You can use an index search and filter whatever, Use somethings like this: { search( fieldsEqual:[{name:"title", value:"Sit*" }] rootItem:"/sitecore/content" ) { results { items { item { id name path url field(name : "title") { title: value } } ...


2

You can easily add extra items to a query. give them a unique name for example: { item1: item(path:"/sitecore") { id name } item2: item(path:"/sitecore/content") { id path displayName } } This Query get 2 items by path and and calls them item1 and item2. See also Starting with Sitecore JSS Integrated GraphQL and Sitecore JSS ...


2

In order to easily use the field value in a <Text /> field helper component, you will need to adjust your query a bit: query { contextItem: item(path: "{22C1A19D-CEE3-5E4E-ADB5-373A0E225C91}") { id path ...on AppRoute { articleTag { jss } } } } The result of the query will give you something like this for the ...


2

Generally speaking user generated content should not be stored on a Sitecore item because: The content is subject to publishing, if stored in the master db, and subject to deletion during publishing if stored in web The master database is generally not exposed to the content delivery servers, thus making it impossible to write there in production Generally ...


2

Yes you can resolve a Sitecore Droplink to an Item in one query, a Droplink has a targetItem that is the way to access the fields of the reference in GraphQL. GraphQL Example: query getArticles($item: String = "{02E9F5E2-8CDE-4A52-B260-62B628692BF8}") { item(path: $item) { ...articleFields } } fragment articleFields on ArticlePage { productarea{ ...


1

This is a problem that falls on the unfortunate spot in between SXA, JSS, and Sitecore Services Client. I know it doesn't help you to know that these are somewhat separate development teams inside Sitecore, but I do believe that's where this falls. Using the new SXA/JSS features in 9.2 and above, we've also found that some Api calls and GraphQL calls fail ...


1

Using a GraphQL query with a predefined hierarchy for a breadcrumb component can be difficult to manage. This is because You will already limit the query's depth to a certain level in the content tree. So, if tomorrow you change the content tree structure, you'll need to update your GraphQL. With OOTB GraphQL query, it is difficult to remove items that ...


1

Your query looks good, I test it on Sitecore 9.1, SOLR with a Text field, that work with this adjustment. It is now facetOn "_category" looks like because the field(name: "Category") your field is named "Category" so use search(rootItem: "92B4F8E7-6324-4C01-B873-7FDC992EDDEE" facetOn:["Category"] ) It is not giving a count per facet. you can do that by ...


1

There is an includeTemplateIDs filtering option on children: topItem: item(path: $datasource) { children(includeTemplateIDs: "{C6F6A81A-F9C9-45D8-AF4E-3E818C470F53}") { name url ... on CustomTemplate { customField { value } } } }


1

The query would not work on Sitecore 9.1 initial version. You can use somethings like this: query{ search(keyword:"smart" fieldsEqual:[{name:"_fullpath", value:"/sitecore/content/*" }]){ results{ totalCount } } } It is necessary to have a fieldsEqual. fixed in JSS 11.0.1 Below \App_Config\Sitecore\Services.GraphQL you can found a sample ...


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