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

feat: add cache option to fetch #817

Merged
merged 6 commits into from
Nov 19, 2024

Conversation

backlineint
Copy link
Collaborator

@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).
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
Collaborator Author

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

@backlineint
Copy link
Collaborator 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