vtex-apps / reviews-and-ratings

5 stars 20 forks source link

Improve GraphQL caching #216

Closed polishq closed 1 year ago

polishq commented 1 year ago

What problem is this solving?

The previous GraphQL cache configuration was resulting in poor UX in the reviews admin. For example, if the user approved a review, it might not appear in the Approved Reviews tab immediately, and could actually continue to appear under the Pending tab, leading to confusion.

This PR adds an appropriate amount of caching to each GraphQL query, and adjusts the admin queries to use a "network-only" fetch policy.

How to test it?

Linked here: https://arthur--sandboxusdev.myvtex.com/admin/reviews-ratings/pending/

Approving one of the pending reviews should now cause it to immediately appear in the Approved tab.

vtex-io-ci-cd[bot] commented 1 year ago

Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖

Please select which version do you want to release:

And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.

sonarcloud[bot] commented 1 year ago

[vtex-apps_reviews-and-ratings-ts] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

sonarcloud[bot] commented 1 year ago

[vtex-apps_reviews-and-ratings-dotnet] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

vtex-io-ci-cd[bot] commented 1 year ago

Your PR has been merged! App is being published. :rocket: Version 3.10.9 → 3.11.0

After the publishing process has been completed (check #vtex-io-releases) and doing A/B tests with the new version, you can deploy your release by running:

vtex deploy vtex.reviews-and-ratings@3.11.0

After that your app will be updated on all accounts.

For more information on the deployment process check the docs. :book: