You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently new to both nextjs and apollo client so there is a possibility that I have not set the project in a right way. Even though product/[slug].js has revalidate: 1 property set in getStaticProps, it seems that apollo client caches its results, resulting in same results on sequential refreshes on the same product page. So, nextjs triggers the getStaticProps after I refresh the browser, but apollo client does not fetch the new data from wordpress/graphql. After I added fetchPolicy: "no-cache", in client.query(options), it started working, I mean I changed product title, product price in wordpress and I was getting the changes immediately after every second refresh of the browser.
Is this an issue ?
The text was updated successfully, but these errors were encountered:
entropyfever
changed the title
Apollo client cache overwrites nextjs revalidate property
Apollo client cache overwrites/negates getStaticProps revalidate property
Jul 17, 2021
I am currently new to both nextjs and apollo client so there is a possibility that I have not set the project in a right way. Even though
product/[slug].js
hasrevalidate: 1
property set ingetStaticProps
, it seems that apollo client caches its results, resulting in same results on sequential refreshes on the same product page. So, nextjs triggers thegetStaticProps
after I refresh the browser, but apollo client does not fetch the new data fromwordpress/graphql
. After I addedfetchPolicy: "no-cache"
, inclient.query(options)
, it started working, I mean I changed product title, product price in wordpress and I was getting the changes immediately after every second refresh of the browser.Is this an issue ?
The text was updated successfully, but these errors were encountered: