Skip to content

chore(docs): add docs for Cosmo Connect field args + @requires#2751

Merged
dkorittki merged 4 commits intomainfrom
dominik/eng-9351-extend-docs-for-requires-on-fields-with-args
Apr 9, 2026
Merged

chore(docs): add docs for Cosmo Connect field args + @requires#2751
dkorittki merged 4 commits intomainfrom
dominik/eng-9351-extend-docs-for-requires-on-fields-with-args

Conversation

@dkorittki
Copy link
Copy Markdown
Contributor

@dkorittki dkorittki commented Apr 8, 2026

This adds some information for Cosmo Connects support of field arguments on fields having the @requires directive. It was added via #2731. I added a new section in router -> Cosmo Connect -> @requires, where this directive is explained in detail.

Summary by CodeRabbit

  • Documentation
    • Describes that field arguments are provided at the request level for batched operations.
    • Adds practical examples demonstrating how subgraphs can read and apply those request-level arguments when processing batched entities.
    • Clarifies limitations: a field cannot act as both a requiring field and a field resolver simultaneously.

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.

@mintlify
Copy link
Copy Markdown
Contributor

mintlify bot commented Apr 8, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
wundergraphinc 🟢 Ready View Preview Apr 8, 2026, 11:59 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 8, 2026

Walkthrough

Documentation updated for gRPC @requires fields with arguments. Adds the request-level field_args message shape, shows subgraph examples using req.GetFieldArgs() alongside iterating req.Context, and clarifies that a field cannot be both @requires and @connect__fieldResolver simultaneously.

Changes

Cohort / File(s) Summary
gRPC Documentation
docs-website/router/gRPC/requires.mdx
Added documentation for field arguments in gRPC @requires implementation. Updated request protobuf/message shape to include a request-level field_args message, added subgraph example using req.GetFieldArgs() while iterating req.Context, and revised limitations to remove the "field arguments" restriction and state mutual exclusivity between @requires and @connect__fieldResolver.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore(docs): add docs for Cosmo Connect field args + @requires' directly and clearly describes the main change: documentation additions for field arguments support with the @requires directive.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
docs-website/router/gRPC/requires.mdx (1)

227-231: Use a structured list and remove em dashes in limitations.

This section presents multiple distinct items, so list formatting is preferred. Also replace em dashes with periods or colons.

🧹 Suggested edit
 Two limitations currently apply to `@requires` in Cosmo Connect.
 
-**Abstract types** — `@requires` on fields of interface or union types is not yet supported.
-
-**Combined `@requires` and `@connect__fieldResolver`** — A field cannot be both a requiring field (`@requires`) and a field resolver (`@connect__fieldResolver`) at the same time.
+- **Abstract types**: `@requires` on fields of interface or union types is not yet supported.
+- **Combined `@requires` and `@connect__fieldResolver`**: A field cannot be both a requiring field (`@requires`) and a field resolver (`@connect__fieldResolver`) at the same time.

As per coding guidelines "Avoid em dashes. Use periods or restructure the sentence instead." and "Use structured lists when presenting multiple distinct items. Do not pack them into a single paragraph."

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

In `@docs-website/router/gRPC/requires.mdx` around lines 227 - 231, Convert the
two limitations into a structured list (each limitation as its own list item)
rather than a single paragraph and remove the em dashes; for the first item
rename "Abstract types — `@requires` on fields of interface or union types is
not yet supported." to something like "Abstract types: `@requires` on fields of
interface or union types is not yet supported." and for the second item rename
"Combined `@requires` and `@connect__fieldResolver` — A field cannot be both a
requiring field (`@requires`) and a field resolver (`@connect__fieldResolver`)
at the same time." to a separate list item using a period or colon (e.g.,
"Combined `@requires` and `@connect__fieldResolver`: a field cannot be both a
requiring field and a field resolver."). Ensure the two items remain distinct
and preserve the exact symbols `@requires` and `@connect__fieldResolver`.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs-website/router/gRPC/requires.mdx`:
- Line 188: The sentence mistakenly says "requests `GetFieldArgs()`" — update
the text to use the possessive or clearer phrasing by changing it to either
"request's `GetFieldArgs()`" or "request `GetFieldArgs()` method" so the
`GetFieldArgs()` reference (GetFieldArgs()) grammatically attaches to the
request object.

---

Nitpick comments:
In `@docs-website/router/gRPC/requires.mdx`:
- Around line 227-231: Convert the two limitations into a structured list (each
limitation as its own list item) rather than a single paragraph and remove the
em dashes; for the first item rename "Abstract types — `@requires` on fields of
interface or union types is not yet supported." to something like "Abstract
types: `@requires` on fields of interface or union types is not yet supported."
and for the second item rename "Combined `@requires` and
`@connect__fieldResolver` — A field cannot be both a requiring field
(`@requires`) and a field resolver (`@connect__fieldResolver`) at the same
time." to a separate list item using a period or colon (e.g., "Combined
`@requires` and `@connect__fieldResolver`: a field cannot be both a requiring
field and a field resolver."). Ensure the two items remain distinct and preserve
the exact symbols `@requires` and `@connect__fieldResolver`.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ed70c6e8-a2a1-4224-ac9f-1e32a894bc2a

📥 Commits

Reviewing files that changed from the base of the PR and between 956e27e and ecb186e.

📒 Files selected for processing (1)
  • docs-website/router/gRPC/requires.mdx

@dkorittki dkorittki marked this pull request as ready for review April 8, 2026 12:10
@dkorittki dkorittki requested review from a team as code owners April 8, 2026 12:10
@dkorittki dkorittki merged commit 37a6a50 into main Apr 9, 2026
7 checks passed
@dkorittki dkorittki deleted the dominik/eng-9351-extend-docs-for-requires-on-fields-with-args branch April 9, 2026 06:44
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.

2 participants