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 way to mark data as stale/invalid #287

Closed
AlecAivazis opened this issue Apr 25, 2022 · 8 comments · Fixed by #849 or #871
Closed

Add way to mark data as stale/invalid #287

AlecAivazis opened this issue Apr 25, 2022 · 8 comments · Fixed by #849 or #871
Labels
Enhancement A new feature or improvement to Houdini's public API

Comments

@AlecAivazis
Copy link
Collaborator

Discussed in https://github.com/HoudiniGraphql/houdini/discussions/286

Originally posted by frederikhors April 23, 2022
Is there an invalidate() api like https://formidable.com/open-source/urql/docs/graphcache/cache-updates/#invalidating-entities?

@fehnomenal
Copy link
Contributor

Maybe https://kit.svelte.dev/docs/loading#output-dependencies can be used? I.e. the generated load would put all query names into the dependencies array and the user would be able to invalidate individual queries (but I guess it would execute the whole load function again?).

@AlecAivazis AlecAivazis added the Enhancement A new feature or improvement to Houdini's public API label Jun 24, 2022
@jycouet
Copy link
Contributor

jycouet commented Jul 4, 2022

I think that this one might get a priority. What do you think?

To move forward, what do we want to support?

  • invalidate("TYPE")
  • invalidate("TYPE", "KEY")

@frederikhors
Copy link
Contributor

I think we should support everything. The invalidation is CRITICAL.

Btw thanks for all your work @jycouet @AlecAivazis!

@AlecAivazis
Copy link
Collaborator Author

AlecAivazis commented Jul 4, 2022

I think this is part of a larger conversation concerning how we want to organize the imperative API. Ideally we need to invalidate all instances of a type, a type with a specific id, and a field within a particular type. I think the API for doing this can get quite unwieldy unless we impose a little organization into the overall structure. I started fleshing out some of my thoughts here: #58

@jycouet
Copy link
Contributor

jycouet commented Nov 10, 2022

Let's close this one in favor of #58 which will take care of this.

@jycouet jycouet closed this as completed Nov 10, 2022
@AlecAivazis
Copy link
Collaborator Author

AlecAivazis commented Dec 9, 2022

I'm going to reopen this since it will come as a second effort after #748 gets merged

@AlecAivazis AlecAivazis reopened this Dec 9, 2022
@frederikhors
Copy link
Contributor

@AlecAivazis is this available as of today?

@jycouet
Copy link
Contributor

jycouet commented Jan 20, 2023

Tests are passing, PR will be done later today 🥳

A lot of cool things will happen in the coming days 👀

This was referenced Jan 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement A new feature or improvement to Houdini's public API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants