Issue: GraphQL Not Working for "Load More" Functionality on Published Environment
Summary:
The "Load More" functionality using GraphQL queries works correctly in preview mode and local environments but fails on the published GraphQL endpoint. The error message indicates an execution issue with the children query, specifically with the endCursor value.
Root Cause:
- Incorrect Context ID: The published environment may be using the
PreviewContext ID instead of theLiveContext ID in the configuration. - Unpublished Items: Items referenced in the query might not be published or available in the
LiveExperience Edge. - Incorrect Cursor Value: The
endCursorvalue may not be valid for the published environment, potentially copied from thePreviewenvironment.
Solution:
Update Context ID:
- Set the correct
SITECORE_EDGE_CONTEXT_IDfor theLiveenvironment in your hosting provider's environment variables (e.g., Vercel). - Redeploy the application to ensure the correct configuration.
- Set the correct
Verify Published Items:
- Confirm that all required items are published and available in the
LiveEdge endpoint.
- Confirm that all required items are published and available in the
Use Correct Cursor:
- Run the initial query (
children (first: 4)) without theafterparameter on theLiveendpoint to retrieve the correctendCursorvalue. - Use the returned
endCursorfor subsequent queries.
- Run the initial query (
Test Queries in Published Environment:
- Verify the GraphQL query directly in the published GraphQL IDE to ensure the configuration works correctly.
By following these steps, the "Load More" functionality should work as expected in the published environment.


