tinacms / tinacms

A fully open-source headless CMS that supports Markdown and Visual Editing
https://tina.io
Apache License 2.0
11.19k stars 564 forks source link

Add fetch options to generated client #4469

Closed jeffsee55 closed 1 month ago

jeffsee55 commented 1 month ago

You can now pass through fetchOptions to the generated client request. This is especially useful for working with the Next.js app router.

  const tinaProps = await client.queries.contentQuery(
    {
      relativePath: `${params.filename}.md`,
    },
    {
      fetchOptions: {
        headers: { 'x-hello': 'world' },
        cache: 'force-cache'
      },
    }
  )
changeset-bot[bot] commented 1 month ago

🦋 Changeset detected

Latest commit: 216cfff0ceff093093be3313c596d177a590d451

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 15 packages | Name | Type | | ---------------------------- | ----- | | @tinacms/cli | Patch | | tinacms | Patch | | starter-basic-iframe | Patch | | starter-empty | Patch | | e2e-next | Patch | | @tinacms/self-hosted-starter | Patch | | kitchen-sink-starter | Patch | | @tinacms/starter | Patch | | next-tinacms-cloudinary | Patch | | next-tinacms-dos | Patch | | next-tinacms-s3 | Patch | | tinacms-authjs | Patch | | tinacms-clerk | Patch | | @tinacms/app | Patch | | @tinacms/vercel-previews | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR