houdini icon indicating copy to clipboard operation
houdini copied to clipboard

Implement cache policy "NoCache"

Open MattiasMartens opened this issue 1 year ago • 3 comments

Fixes #356

Implement the policy "NoCache", mirroring Apollo, which serves a request without reading from or writing to the cache.

Tests are failing for me locally with messages like this:

TypeError: Cannot read properties of undefined (reading 'on')
 ❯ vitest.setup.ts:12:1
     10| process.env.HOUDINI_TEST = 'true'
     11| 
     12| beforeEach(clearMock)
       | ^
     13| 
     14| const config = testConfig()

This happens even without my changes, but it means I'm not able to write tests for the change.

To help everyone out, please make sure your PR does the following:

  • [X] Update the first line to point to the ticket that this PR fixes
  • [X] Add a message that clearly describes the fix ~~- [ ] If applicable, add a test that would fail without this fix ~~- [ ] Make sure the unit and integration tests pass locally with pnpm run tests and cd integration && pnpm run tests
  • [X ] Includes a changeset if your fix affects the user with pnpm changeset

MattiasMartens avatar Feb 20 '24 19:02 MattiasMartens

🦋 Changeset detected

Latest commit: b019b16ccca4bac5d080a296b20d4fd36abf0fbb

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

This PR includes changesets to release 8 packages
Name Type
houdini Minor
houdini-adapter-auto Minor
houdini-adapter-cloudflare Minor
houdini-adapter-node Minor
houdini-react Minor
houdini-svelte Minor
houdini-plugin-svelte-global-stores Minor
create-houdini Minor

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

changeset-bot[bot] avatar Feb 20 '24 19:02 changeset-bot[bot]

Deploy Preview for houdini-docs-next canceled.

Name Link
Latest commit b019b16ccca4bac5d080a296b20d4fd36abf0fbb
Latest deploy log https://app.netlify.com/sites/houdini-docs-next/deploys/65d859414ca1b3000877e2b3

netlify[bot] avatar Feb 20 '24 19:02 netlify[bot]

Deploy Preview for houdinigraphql canceled.

Name Link
Latest commit b019b16ccca4bac5d080a296b20d4fd36abf0fbb
Latest deploy log https://app.netlify.com/sites/houdinigraphql/deploys/65d85941435dcf0008e2adb5

netlify[bot] avatar Feb 20 '24 19:02 netlify[bot]

@AlecAivazis Great! Test snapshots are now updated.

MattiasMartens avatar Feb 21 '24 17:02 MattiasMartens

@SeppahBaws As I said above, I am not able to write or run tests for this branch! I get this error for most tests:

TypeError: Cannot read properties of undefined (reading 'on')
 ❯ vitest.setup.ts:12:1
     10| process.env.HOUDINI_TEST = 'true'
     11| 
     12| beforeEach(clearMock)
       | ^
     13| 
     14| const config = testConfig()

MattiasMartens avatar Feb 21 '24 20:02 MattiasMartens

@MattiasMartens yes of course, was more of a question in general :) I can take a look at writing a test when I have some spare time, or maybe @AlecAivazis can if he can find the time before I do.

SeppahBaws avatar Feb 21 '24 20:02 SeppahBaws

I had a few moments tonight so I pushed up a test 👍

AlecAivazis avatar Feb 23 '24 08:02 AlecAivazis