Skip to content

Conversation

@backlineint
Copy link
Contributor

@backlineint backlineint commented Nov 8, 2024

Fixes #809

Add support for the cache option in the Next Drupal client.

  • Add cache option to JsonApiWithNextFetchOptions type in packages/next-drupal/src/types/options.ts.
  • Update fetch method in packages/next-drupal/src/next-drupal.ts to pass the cache option as part of the init object if provided.
  • Add tests for the cache option in fetch and getResource methods in packages/next-drupal/tests/NextDrupalBase/fetch-methods.test.ts and packages/next-drupal/tests/NextDrupal/resource-methods.test.ts.
  • Adds cache option to getResource calls in basic starter.

For more details, open the Copilot Workspace session.

Fixes chapter-three#809

Add support for the `cache` option in the Next Drupal client.

* Add `cache` option to `JsonApiWithNextFetchOptions` type in `packages/next-drupal/src/types/options.ts`.
* Update `fetch` method in `packages/next-drupal/src/next-drupal.ts` to pass the `cache` option as part of the `init` object if provided.
* Add tests for the `cache` option in `fetch` and `getResource` methods in `packages/next-drupal/tests/NextDrupalBase/fetch-methods.test.ts` and `packages/next-drupal/tests/NextDrupal/resource-methods.test.ts`.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/chapter-three/next-drupal/issues/809?shareId=XXXX-XXXX-XXXX-XXXX).
@vercel
Copy link

vercel bot commented Nov 8, 2024

@backlineint is attempting to deploy a commit to the Chapter Three Team on Vercel.

A member of the Team first needs to authorize it.

@backlineint backlineint marked this pull request as draft November 8, 2024 20:36
@backlineint
Copy link
Contributor Author

First draft via copilot workspaces, will test and refine locally.

@backlineint
Copy link
Contributor Author

Reminder to address this: Use the cache option in the basic starter.

@backlineint backlineint marked this pull request as ready for review November 19, 2024 16:09
@backlineint backlineint changed the title Add cache option to fetch feat: add cache option to fetch Nov 19, 2024
Copy link
Member

@robdecker robdecker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM

@backlineint backlineint merged commit f8561b1 into chapter-three:main Nov 19, 2024
2 of 16 checks passed
@backlineint backlineint deleted the add-cache-option branch November 19, 2024 23:36
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.

Add Next Cache Option to Fetch

2 participants