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

Add NextFetchRequestConfig, such as next.revalidate, to fetch requests #761

Open
davidwhthomas opened this issue May 19, 2024 · 1 comment
Labels
area: next-drupal enhancement New feature or request

Comments

@davidwhthomas
Copy link

davidwhthomas commented May 19, 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

@davidwhthomas davidwhthomas added question Question asked by a user triage A new issue that needs triage labels May 19, 2024
@JohnAlbin JohnAlbin added enhancement New feature or request area: next-drupal and removed question Question asked by a user triage A new issue that needs triage labels May 22, 2024
@JohnAlbin JohnAlbin added this to the next-drupal 2.0.0 milestone May 22, 2024
@JohnAlbin
Copy link
Collaborator

We definitely need to add this before a 2.0.0 release is made. Thanks for creating the issue!

@JohnAlbin 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: next-drupal enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants