I have the Nextjs
sample app running in connected mode to my existing Sitecore v10.2 implementation using JSS v19. It's all working correctly - I'm able to create new components and edit them in the Experience Editor.
In another component I want to make a GraphQL
request to get some data from Sitecore. Following the sample component GraphQL-ConnectedDemo.dynamic.tsx
I have created a .graphql
file with a query I've tested in Sitecore GraphQL editor <url>/sitecore/api/graph/edge/ui
and the data is returned.
I have run graphql:update
to update the ./src/temp/GraphQLIntrospectionResult.json
file so that my GraphQL
query has types. This updates the file from ~22,000 lines of code to ~615,000 as it now has representations for all the Templates
from my existing Sitecore implementation.
Now when I run jss bootstrap
to generate a .graphql.d.ts
for my new query I receive the following error at the graphql-let
step
[ graphql-let ] Generating .d.ts...
<--- Last few GCs --->
[38180:0000028409EEB070] 79499 ms: Scavenge 4048.3 (4120.0) -> 4045.5 (4137.8) MB, 8.7 / 0.0 ms (average mu
[38180:0000028409EEB070] 80903 ms: Mark-sweep 4058.3 (4137.8) -> 4051.3 (4147.0) MB, 1385.9 / 0.0 ms (averagght not succeed
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
...
The issue is due to the size of GraphQLIntrospectionResult.json
- if I undo changes to that file jss bootstrap
completes successfully.
Therefore, is there a way to limit the scope of graphql:update
such that it only generates for templates relating to my JSS App?