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

#3114 Set fetch policy and next fetch policy for cms block query #3131

Conversation

vasilii-b
Copy link

Description

This PR sets the fetch policy for CMS Block.

Related Issue

Closes #3114.

Acceptance

N/A

Verification Stakeholders

Specification

Screenshots / Screen Captures (if appropriate)

N/A

Checklist

  • I have added tests to cover my changes, if necessary.
  • I have added translations for new strings, if necessary.
  • I have updated the documentation accordingly, if necessary.

@PWAStudioBot
Copy link
Contributor

PWAStudioBot commented Apr 17, 2021

Fails
🚫 A version label is required. A maintainer must add one.
🚫 Missing "Verification Steps" section. Please add it back, with detail.
Messages
📖 DangerCI Failures related to missing labels/description/linked issues/etc will persist until the next push or next nightly build run (assuming they are fixed).
📖

Access a deployed version of this PR here. Make sure to wait for the "pwa-pull-request-deploy" job to complete.

If your PR is missing information, check against the original template here. At a minimum you must have the section headers from the template and provide some information in each section.

Generated by 🚫 dangerJS against f86391e

variables: { identifiers }
variables: { identifiers },
fetchPolicy: 'cache-and-network',
nextFetchPolicy: 'cache-first'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't cache-first mean that updated content would not show if it was edited again?
https://medium.com/@galen.corey/understanding-apollo-fetch-policies-705b5ad71980?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't cache-first mean that updated content would not show if it was edited again?

On first load, cache-and-network always updates with network (server) data. But if that data ever changes on the client, the query makes another call to the server. We applied the nextFetchPolicy to avoid excessive server calls as it allows the initial network fetch but then always trusts the cache from then on (for this page load).

@m2-community-project m2-community-project bot moved this from Ready for Review to Review in Progress in Pull Request Progress Apr 18, 2021
@fooman fooman removed their assignment Apr 19, 2021
@m2-community-project m2-community-project bot moved this from Review in Progress to Ready for Review in Pull Request Progress Apr 19, 2021
@m2-community-project m2-community-project bot moved this from Ready for Review to Review in Progress in Pull Request Progress Apr 19, 2021
@m2-community-project m2-community-project bot moved this from Review in Progress to Reviewer Approved in Pull Request Progress May 4, 2021
@dpatil-magento
Copy link
Contributor

QA Approved.

@dpatil-magento dpatil-magento merged commit 5be20e3 into magento:develop May 6, 2021
@m2-community-project m2-community-project bot moved this from Reviewer Approved to Done in Pull Request Progress May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

[bug]: useCmsPage nextFetchPolicy: 'cache-first'? (also cmsBlock)
7 participants