Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facets Disappear when Content Is Published #25

Open
MineshS opened this issue Jul 15, 2024 · 1 comment
Open

Facets Disappear when Content Is Published #25

MineshS opened this issue Jul 15, 2024 · 1 comment

Comments

@MineshS
Copy link

MineshS commented Jul 15, 2024

When utilising facets on Graph Queries lets say for Listing Pages, in this case blog-listing-block when we publish the content the facets disappear as demonstrated in this video:

https://www.loom.com/share/a4bc9f5b5be54e4b8b44d2b7b4d90fd9?sid=10d20d68-14e4-4412-994c-8c8794df2a6f

@MineshS
Copy link
Author

MineshS commented Aug 5, 2024

So I have had some great feedback from @remkoj regarding this issue for those who run into something similar it could be worth disabling the cached stored query execution.

e.g.

const { CmsPage, generateMetadata, generateStaticParams } = OptimizelyCmsPage.createPage(getFactory(), { getContentByPath: getContentByPath as OptimizelyCmsPage.GetContentByPathMethod, client: () => { const client = getServerClient() client.updateFlags({ queryCache: false // We're depending on @recursive & cursors, which don't work with the queryCache }) return client } })

Some notes from Remko;

There's a difference in how the queries are sent to Graph, especially with regards to cache - I've put in some defaults in the ContentGraphClient to be pretty aggressive with caching to ensure the best possible performance.

So by default I have the query cache (i.e. the transformation of the GraphQL query to the underlying data query) as well as the output cache (i.e. the GraphQL query to GraphQL response) enabled.

The fact that a recompilation fixes the problem (i.e. the query changes) and the problem is not present in the explorer suggests it has to do with the query cache.

Can you verify this by disabling the query cache on the client? An example of how to do this can be found here: https://github.com/remkoj/optimizely-saas-starter/blob/25cbd9049d9ca9a3a84db0cb0c74795d3496f77e/src/app/%5B%5B...path%5D%5D/page.tsx#L10

Basically use the 'updateFlags({})' method on the client to disable this cache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant