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
We definitely need to add this before a 2.0.0 release is made. Thanks for creating the issue!
JohnAlbin
changed the title
How can we pass NextFetchRequestConfig, such as next.revalidate, to fetch requests for Next.JS App Router
Add NextFetchRequestConfig, such as next.revalidate, to fetch requests
May 22, 2024
Package
next-drupal (NPM package)
Ask the question
Next.JS App Router supports useful custom fetch request options related to caching such as
fetch("https://...", { next: { revalidate: false | 0 | number } })
fetch("https://...", { next: { tags: ['node:1', 'tag:2'] } })
fetch("https://...", { cache: 'force-cache' | 'no-store' })
However it's not clear how or if we can pass those with the fetch requests from
next-drupal
requests.It would be great if we could pass those per request, e.g for JSON:API requests but appears we perhaps can't pass those options at the moment.
I'm currently using
"next-drupal": "^2.0.0-beta.0"
Do you have any recommendations on this?
With thanks for the excellent Next.JS and Drupal integration module.
Additional context
NextFetchRequestConfig
that may be available to set infetch
init
here https://github.com/chapter-three/next-drupal/blob/main/packages/next-drupal/src/next-drupal-base.ts#L176The text was updated successfully, but these errors were encountered: