JSS Integrated GraphQL Upgrade

Created: 21 Dec 2018, last update: 30 Jan 2022

Sitecore JSS Integrated GraphQL Upgrade

Today it is useful to know something about GraphQL as Sitecore Backend Developer. We can use Integrated GraphQL in or renderings and we can configure an endpoint for the frontend developers. See Starting with Sitecore JSS Integrated GraphQL and JSS Integrated GraphQL Queries

Upgrade from Tech preview on Sitecore 9.0 to Sitecore JSS 11.0 for Sitecore 9.1
I ran against the following issues:

GraphQL endpoint config, JSS FormatException: DebugOnly
Sitecore was broken because my GraphQL endpoint config, String was not recognized as a valid Boolean. [FormatException: DebugOnly (follow web.config compilation setting) is not a valid value for Boolean.]

See JSS FormatException: DebugOnly to fix this

HTML caching.
In the JSS techpreview I used, the HTML caching on my integrated GraphQL was just not caching, but with the release version 11. I Get this error when I hit it the second time. (I think it is because I have also SXA installed, on a fresh installation it works)

HTTP Error 500.0 - Rendering data contained rendering reference ID 016783c1-b831-4c57-8c95-25a13baafd68 but that rendering ID was not present in the rendered renderings context. This ought not to occur.

Where the GUID is random? and changed when I flush the cache.

Current workaround don't install SXA and JSS on the same Sitecore, or no HTML output caching on intergrated GraphQL, the JSS query cache is working.

From Sitecore Support:
We can confirm that some of the JSS features have an overlapping equivalent feature in SXA which makes them incompatible.
For instance, Sitecore Layout Service which is similar to the Layout Service in SXA and they both can't co-exist.
Therefore, we can say SXA and JSS are not compatible at the moment.

However, the integration JSS + SXA planned for implementation in the future, but so far we can not give any predictions.

So, please use JSS on the instance without SXA installed.

My sample search query’s are broken.GraphQL.ExecutionError: Error trying to resolve search. System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.

   at System.ThrowHelper.ThrowKeyNotFoundException()

I found a workaround on https://www.adamlamarre.com/sitecore-jss-graphql-executionerror-error-trying-to-resolve-search-system-collections-generic-keynotfoundexception/