Skip to content

docs(composition): fix README inaccuracies for federateSubgraphs#2648

Merged
comatory merged 2 commits intomainfrom
ondrej/fix-composition-readme
Mar 18, 2026
Merged

docs(composition): fix README inaccuracies for federateSubgraphs#2648
comatory merged 2 commits intomainfrom
ondrej/fix-composition-readme

Conversation

@comatory
Copy link
Copy Markdown
Contributor

@comatory comatory commented Mar 14, 2026

Summary by CodeRabbit

  • Documentation

    • Updated composition docs and examples to match the new public API shapes and import paths.
  • Refactor

    • Changed federateSubgraphs to accept an options object with a subgraphs list.
    • Renamed public result types for clarity (FederationSuccess / FederationFailure).
    • Expanded and clarified publicly visible result properties (more schema, configuration and diagnostic info).

Fixes several inaccuracies in the composition package README that had drifted from the actual implementation.

Changes:

  • Fix federateSubgraphs call signature: was documented as taking a plain array, now correctly shows a params object { subgraphs, options?, version? }
  • Rename FederationResultSuccess/FederationResultFailureFederationSuccess/FederationFailure to match the actual exported types
  • Add missing FederationSuccess properties to the table: directiveDefinitionByName, fieldConfigurations, federatedGraphClientSchema, parentDefinitionDataByTypeName, subgraphConfigBySubgraphName, shouldIncludeClientSchema
  • Fix import path typo: @wundergraph.composition@wundergraph/composition
  • Fix stale FederationResultFailure.errors reference in prose

Checklist

- fix call signature: array arg -> params object { subgraphs, options?, version? }
- rename FederationResultSuccess/Failure -> FederationSuccess/Failure
- add missing FederationSuccess properties to table
- fix import path typo (@wundergraph.composition -> @wundergraph/composition)
- fix stale FederationResultFailure.errors reference

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 14, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1a31c64a-6688-427e-8758-4039e97a6250

📥 Commits

Reviewing files that changed from the base of the PR and between 086d71f and 2fec27a.

📒 Files selected for processing (1)
  • composition/README.md

Walkthrough

Updates the @wundergraph/composition documentation to reflect a changed federateSubgraphs signature (now accepts an options object), renames FederationResultSuccess/FederationResultFailure to FederationSuccess/FederationFailure, and documents expanded public properties for those result types.

Changes

Cohort / File(s) Summary
Documentation / Public API
composition/README.md
Changed federateSubgraphs usage from federateSubgraphs([subgraphA, subgraphB]) to federateSubgraphs({ subgraphs: [...] }); renamed FederationResultSuccessFederationSuccess and FederationResultFailureFederationFailure; updated union FederationResult references; expanded documented public properties (e.g., directiveDefinitionByName, fieldConfigurations, federatedGraphAST, federatedGraphClientSchema, federatedGraphSchema, parentDefinitionDataByTypeName, subgraphConfigBySubgraphName, shouldIncludeClientSchema, errorserrors in failure shape); adjusted example import paths to @wundergraph/composition and example invocation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: fixing README inaccuracies in the composition package documentation for the federateSubgraphs API.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 41.37%. Comparing base (d43aa40) to head (2fec27a).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2648      +/-   ##
==========================================
- Coverage   45.45%   41.37%   -4.08%     
==========================================
  Files        1027      783     -244     
  Lines      138084   111952   -26132     
  Branches     8573     8573              
==========================================
- Hits        62765    46325   -16440     
+ Misses      73615    65264    -8351     
+ Partials     1704      363    -1341     

see 244 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
composition/README.md (1)

56-57: Optional: include an explicit signature snippet for federateSubgraphs params.

A compact inline signature (including options? and version?) near this section would reduce future drift and make the contract immediately scannable.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@composition/README.md` around lines 56 - 57, Add a compact inline
TypeScript-style signature for the federateSubgraphs function near the paragraph
describing FederationResult to make the contract explicit; include the function
name and parameter names with optional markers (e.g.,
federateSubgraphs(subgraphs: Subgraph[], options?: FederationOptions, version?:
string): Promise<FederationResult>) and reference the union types
FederationResult, FederationSuccess, and FederationFailure so readers can
immediately see that options and version are optional and what return types to
expect.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@composition/README.md`:
- Around line 56-57: Add a compact inline TypeScript-style signature for the
federateSubgraphs function near the paragraph describing FederationResult to
make the contract explicit; include the function name and parameter names with
optional markers (e.g., federateSubgraphs(subgraphs: Subgraph[], options?:
FederationOptions, version?: string): Promise<FederationResult>) and reference
the union types FederationResult, FederationSuccess, and FederationFailure so
readers can immediately see that options and version are optional and what
return types to expect.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0f5f972a-1ce9-49ba-8878-cf03dc484a17

📥 Commits

Reviewing files that changed from the base of the PR and between cd38084 and 086d71f.

📒 Files selected for processing (1)
  • composition/README.md

@comatory comatory changed the title 📚docs(composition): fix README inaccuracies for federateSubgraphs docs(composition): fix README inaccuracies for federateSubgraphs Mar 14, 2026
@comatory comatory enabled auto-merge (squash) March 16, 2026 14:51
Copy link
Copy Markdown
Contributor

@StarpTech StarpTech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@comatory comatory merged commit 0b76c8c into main Mar 18, 2026
26 checks passed
@comatory comatory deleted the ondrej/fix-composition-readme branch March 18, 2026 08:27
Noroth pushed a commit that referenced this pull request Mar 18, 2026
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

2 participants