Skip to content

feat(core): add deferred fragment utilities - #3906

Open
JoviDeCroock wants to merge 2 commits into
mainfrom
feat/deferred-fragment-core
Open

feat(core): add deferred fragment utilities#3906
JoviDeCroock wants to merge 2 commits into
mainfrom
feat/deferred-fragment-core

Conversation

@JoviDeCroock

@JoviDeCroock JoviDeCroock commented Aug 22, 2026

Copy link
Copy Markdown
Member

Summary

  • add beta fragment utilities to @urql/core: maskFragment, getFragments, and makeFragmentSource
  • the Client now associates stable sidecar promises with missing fields in streamed @defer query results inside its result pipeline, resolving them as patches arrive or on operation teardown — bindings need no wiring
  • makeFragmentSource issues masked fragment snapshots and re-emits as deferred patches stream in, giving non-Suspense frameworks (Vue/Svelte/Solid) the same primitive
  • evaluate @include, @skip, and @defer(if:) against operation variables
  • keep internal promise metadata out of GraphQL result data (WeakMap sidecar)
  • public surface is intentionally minimal: maskFragment, getFragments, makeFragmentSource + their types; the deferred-state machinery stays internal

This is the core-only first part of the split of #3888. Framework integrations follow in separate stacked PRs.

@changeset-bot

changeset-bot Bot commented Aug 22, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 808921f

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

This PR includes changesets to release 1 package
Name Type
@urql/core 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

The Client now associates and resolves deferred sidecar promises for
streamed query results inside makeResultSource, so bindings need no
per-binding wiring. The per-client deferred cache is removed, and the
new makeFragmentSource primitive exposes masked fragment snapshots that
re-emit as deferred patches arrive. Public exports are reduced to
maskFragment, getFragments, and makeFragmentSource.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying urql with  Cloudflare Pages  Cloudflare Pages

Latest commit: 808921f
Status: ✅  Deploy successful!
Preview URL: https://30ed27a6.urql.pages.dev
Branch Preview URL: https://feat-deferred-fragment-core.urql.pages.dev

View logs

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.

1 participant