sveltejs / sveltejs/kit

refreshAll should work with <mutation>.updates()

Open
#14,078 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
20.8k
Forks
2.3k
Avg merge
1d 16h
Merged PRs (30d)
156

Description

Describe the problem

.updates() allows you to opt for a single flight mutation instead of needing two round trips, but only if you refresh the queries individually, on screens with many queries, this is a problem
There is a utility that refreshes all active queries, but it doesn't work with .updates()
Additionally, it would be nice if it were also possible to refresh active queries on the server side, also avoiding the need to refresh each query individually
Assuming there is some record of active queries (or whatever refreshAll uses) mutations could receive this record when triggered and then be given the option to refresh these queries on the server, enabling single-flight-mutations by default for such query

Describe the proposed solution

That refreshAll works with .updates() for single flight mutations and some api to do the same inside mutations

Alternatives considered

Keep a mental map of active queries and refresh them individually

Importance

nice to have

Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing refreshAll behavior and the .updates() flow, then read the linked discussion for the proposed server-side API. Determine how active queries are tracked and define what support for refreshing them from mutations should look like on both client and server.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend-api-design, full-stack
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.