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 ability to refresh a record #891

Open
AlecAivazis opened this issue Feb 3, 2023 · 1 comment
Open

Add ability to refresh a record #891

AlecAivazis opened this issue Feb 3, 2023 · 1 comment
Labels
Enhancement A new feature or improvement to Houdini's public API

Comments

@AlecAivazis
Copy link
Collaborator

AlecAivazis commented Feb 3, 2023

Describe the feature

Right now the only way to manage invalid data is to mark it as stale. We should add a way to tell the cache to reload a particular record by notifying every current subscriber of that record to refetch.

Not sure on the exact name of the method yet but it could look something like

function applyMutation() {
    const { data } = await MyMutation.mutate()
    
    const user = cache.get("User", { id: data.updateUser.user.id })

    // options are things like "invalidate", "refresh", etc
    user.refetch()
}

Criticality

cool improvement, my projects will benefit from it

@AlecAivazis AlecAivazis added the Enhancement A new feature or improvement to Houdini's public API label Feb 3, 2023
@knd775
Copy link
Contributor

knd775 commented Oct 12, 2023

For us, this would be the single largest improvement that could be made. We have so much weird code to work around this right now.

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

No branches or pull requests

2 participants