Skip to content

docs: add docs for requires in connect#2675

Merged
Noroth merged 5 commits intomainfrom
ludwig/eng-8644-add-documentation-for-requires-in-cosmo-connect
Mar 30, 2026
Merged

docs: add docs for requires in connect#2675
Noroth merged 5 commits intomainfrom
ludwig/eng-8644-add-documentation-for-requires-in-cosmo-connect

Conversation

@Noroth
Copy link
Copy Markdown
Contributor

@Noroth Noroth commented Mar 20, 2026

Summary by CodeRabbit

  • Documentation
    • Added comprehensive guides for GraphQL Federation directives: @key, @external, @provides, and @requires
    • Published an implementation guide for @requires in the Cosmo Connect gRPC integration, detailing request/response patterns, batching, and runtime flow
    • Updated GraphQL-in-gRPC feature matrix to mark @requires as supported
    • Improved documentation navigation and added "Tone and Style" writing guidelines

Checklist

  • I have discussed my proposed changes in an issue and have received approval to proceed.
  • I have followed the coding standards of the project.
  • Tests or benchmarks have been added or updated.
  • Documentation has been updated on https://github.com/wundergraph/docs-website.
  • I have read the Contributors Guide.

Open Source AI Manifesto

This project follows the principles of the Open Source AI Manifesto. Please ensure your contribution aligns with its principles.

@Noroth Noroth requested review from a team as code owners March 20, 2026 10:35
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 20, 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: 90ca4267-a25b-4f9a-a75f-35473b8fd7b4

📥 Commits

Reviewing files that changed from the base of the PR and between 38c26d4 and 26c2f2d.

📒 Files selected for processing (1)
  • docs-website/docs.json
✅ Files skipped from review due to trivial changes (1)
  • docs-website/docs.json

Walkthrough

Adds documentation for GraphQL Federation directives (@key, @external, @provides, @requires), updates docs navigation and directive index links, introduces a “Tone and Style” writing guideline, and adds Cosmo Connect gRPC-specific documentation for @requires (RPC generation, batching, and runtime behavior).

Changes

Cohort / File(s) Summary
Documentation Guidelines
docs-website/CLAUDE.md
Added a "Tone and Style" subsection and inserted the ### Format header; constraints on voice, punctuation, hedging, sentence/list structure specified.
Documentation Navigation / Manifest
docs-website/docs.json
Added new docs manifest entries: router/gRPC/requires and four federation directive pages (federation/directives/key, .../external, .../provides, .../requires).
Federation Directives Overview
docs-website/federation/directives.mdx, docs-website/federation/federation-directives-index.mdx
Inserted four directive cards (@key, @external, @provides, @requires) with links/icons; converted directive names in the directives index to linkified entries.
Federation Directive Pages
docs-website/federation/directives/key.mdx, docs-website/federation/directives/external.mdx, docs-website/federation/directives/provides.mdx, docs-website/federation/directives/requires.mdx
Added four full directive reference pages covering signatures, semantics, rules, examples, router/composition behavior, and cross-links.
Router gRPC docs
docs-website/router/gRPC/graphql-support.mdx, docs-website/router/gRPC/requires.mdx
Marked @requires as supported in GraphQL-in-gRPC feature matrix; added a gRPC-specific @requires guide describing generated RPC names, protobuf request/response shapes (batched context), ordering requirements, runtime flow, and limitations.

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 'docs: add docs for requires in connect' directly describes the main objective of the PR, which is to add documentation for the @requires directive in Cosmo Connect. However, it is somewhat vague in scope.
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.


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

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 (2)
docs-website/federation/directives/provides.mdx (1)

60-60: Minor style improvement: prefer concise phrasing.

Per the new tone guidelines in CLAUDE.md, prefer shorter phrasing where possible.

✏️ Suggested fix
-When a client queries `confirmedTickets { event { venueName } }`, the router knows the ticketing subgraph is able to resolve venueName under the confirmedTickets path and skips the round-trip to the scheduling subgraph. For `cancelledTickets { event { venueName } }`, the router still fetches `venueName` from scheduling.
+When a client queries `confirmedTickets { event { venueName } }`, the router knows the ticketing subgraph can resolve venueName under the confirmedTickets path and skips the round-trip to the scheduling subgraph. For `cancelledTickets { event { venueName } }`, the router still fetches `venueName` from scheduling.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs-website/federation/directives/provides.mdx` at line 60, Rewrite the
sentence to a more concise phrasing: replace the two-sentence example with a
single concise line that uses the existing symbols (confirmedTickets,
cancelledTickets, event, venueName) and actors (router, ticketing subgraph,
scheduling) — e.g., state that the router can resolve
confirmedTickets.event.venueName from the ticketing subgraph and will still
fetch cancelledTickets.event.venueName from scheduling, keeping punctuation and
inline code formatting for confirmedTickets, cancelledTickets, event, and
venueName.
docs-website/federation/directives/key.mdx (1)

103-133: Optional: Consider adding performance note for compound keys.

The documentation provides helpful performance warnings for multiple keys (lines 64-66). Since compound keys can also impact query planning complexity and payload size (especially with deeply nested structures), you might consider adding a brief note about when compound keys are appropriate versus when a simpler single-field key would suffice.

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

In `@docs-website/federation/directives/key.mdx` around lines 103 - 133, Add a
brief performance note after the "Compound Keys" section (the paragraph showing
the Session type with `@key`(fields: "id event { id }") and the representation
JSON) explaining that compound keys increase query-planning complexity and
representation payload size for deeply nested fields, advise preferring
single-field keys when possible, and list when compound keys are appropriate
(e.g., uniquely identifying across nested objects) versus when to avoid them to
reduce payload and planning overhead.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@docs-website/federation/directives/key.mdx`:
- Around line 103-133: Add a brief performance note after the "Compound Keys"
section (the paragraph showing the Session type with `@key`(fields: "id event { id
}") and the representation JSON) explaining that compound keys increase
query-planning complexity and representation payload size for deeply nested
fields, advise preferring single-field keys when possible, and list when
compound keys are appropriate (e.g., uniquely identifying across nested objects)
versus when to avoid them to reduce payload and planning overhead.

In `@docs-website/federation/directives/provides.mdx`:
- Line 60: Rewrite the sentence to a more concise phrasing: replace the
two-sentence example with a single concise line that uses the existing symbols
(confirmedTickets, cancelledTickets, event, venueName) and actors (router,
ticketing subgraph, scheduling) — e.g., state that the router can resolve
confirmedTickets.event.venueName from the ticketing subgraph and will still
fetch cancelledTickets.event.venueName from scheduling, keeping punctuation and
inline code formatting for confirmedTickets, cancelledTickets, event, and
venueName.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c0154f6c-884a-4900-af33-ddb6d80b76b7

📥 Commits

Reviewing files that changed from the base of the PR and between 3806e20 and 38c26d4.

📒 Files selected for processing (10)
  • docs-website/CLAUDE.md
  • docs-website/docs.json
  • docs-website/federation/directives.mdx
  • docs-website/federation/directives/external.mdx
  • docs-website/federation/directives/key.mdx
  • docs-website/federation/directives/provides.mdx
  • docs-website/federation/directives/requires.mdx
  • docs-website/federation/federation-directives-index.mdx
  • docs-website/router/gRPC/graphql-support.mdx
  • docs-website/router/gRPC/requires.mdx

@Noroth Noroth changed the title chore: add docs for requires in connect docs: add docs for requires in connect Mar 20, 2026
@Noroth Noroth enabled auto-merge (squash) March 27, 2026 11:35
@Noroth Noroth merged commit 63db070 into main Mar 30, 2026
7 checks passed
@Noroth Noroth deleted the ludwig/eng-8644-add-documentation-for-requires-in-cosmo-connect branch March 30, 2026 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants