这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@asadamatic
Copy link
Contributor

Using cache is important to reduce the load on APIs, and to reduce loading times, but for things that may change frequently during the runtime, it would be better to go with network-only policy.

The ShopifyConfig.fetchPolicy sets the policy for all the queries, so if you want to use cache for products and collections, you'll have to opt-in to cache-first policy for all the queries. In case of currentUser query, I think this policy is not good, as the user will update their profile from the app. Some updates can be handled locally, but others may result in inconsistent data.

To resolve this, I have hardcoded the fetchPolicy for the currentUser query, as FetchPolicy.networkOnly.

@imsujan276 imsujan276 merged commit 72c04f4 into imsujan276:main Jun 24, 2024
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

Successfully merging this pull request may close these issues.

2 participants