Skip to content

docs: document inline (colocated) named fragments#80

Open
rellampec wants to merge 2 commits into
github-community-projects:masterfrom
rellampec:docs/inline-named-fragments
Open

docs: document inline (colocated) named fragments#80
rellampec wants to merge 2 commits into
github-community-projects:masterfrom
rellampec:docs/inline-named-fragments

Conversation

@rellampec

@rellampec rellampec commented Jun 15, 2026

Copy link
Copy Markdown

What this does

Documents that standard named GraphQL fragments defined inline — a fragment Name on Type { … } definition placed in the same parse string as the operation that spreads it — are supported, and their fields are directly accessible on the result (no ImplicitlyFetchedFieldError, no re-wrapping through a fragment constant).

This is documentation only — the behaviour already exists in Client#parse (the local fragment definition is kept and the fields flow through source_document); it just wasn't documented anywhere.

Files

  • README.md — new "Named fragments defined inline" section, with a note that this follows Apollo Client's colocating fragments convention.
  • guides/implicitly-fetched-field-error.md — new "When isolation does not apply" section clarifying that inline fragments are not subject to the component-isolation error.
  • CHANGELOG.md — one line under ## Unreleased.

Why

Resolves the confusion raised in #76: fragments can be used purely for reuse, Apollo-style, without forcing a parent–child component hierarchy. The constant-bound style remains for when you do want ImplicitlyFetchedFieldError to guard cross-module access — the two are complementary, and the docs spell out the distinction.

Addresses #76. (Deliberately not "Closes" — see below.)

Scope / notes for reviewers

Introduce a CHANGELOG (reconstructed from merged PRs and release tags back
to 0.23.0, with an Unreleased section) and a CONTRIBUTING guide documenting
the fork -> topic-branch -> test (Minitest) -> CHANGELOG -> PR flow.

Upstream master previously had neither file.
Document that standard named GraphQL fragments defined inline in the same
parse string as the operation are supported, with fields directly accessible
on the result (no enforced component isolation). Mirrors Apollo Client's
colocating-fragments convention. Addresses github-community-projects#76.

- README: 'Named fragments defined inline' section + Apollo reference
- guides/implicitly-fetched-field-error.md: 'When isolation does not apply'
- CHANGELOG: Unreleased entry referencing github-community-projects#76
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