-
-
Notifications
You must be signed in to change notification settings - Fork 831
feat(utils): Add subgraphName
to ExecutionRequest
type
#7281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(utils): Add subgraphName
to ExecutionRequest
type
#7281
Conversation
🦋 Changeset detectedLatest commit: fde1c74 The changes in this PR will be included in the next version bump. This PR includes changesets to release 26 packages
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 |
📝 WalkthroughSummary by CodeRabbit
WalkthroughAn optional property named Changes
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
packages/utils/src/Interfaces.tsOops! Something went wrong! :( ESLint: 9.30.1 ESLint couldn't find an eslint.config.(js|mjs|cjs) file. From ESLint v9.0.0, the default configuration file is now eslint.config.js. https://eslint.org/docs/latest/use/configure/migration-guide If you still have problems after following the migration guide, please stop by ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
packages/utils/src/Interfaces.ts (1)
92-93
: Consider adding a short JSDoc forsubgraphName
.Everything looks correct, but every other optional field in
ExecutionRequest
is accompanied by a clarifying comment or JSDoc. A one-liner such as “/** Target subgraph, when executing within a Gateway */
” keeps the public API self-documenting and consistent with existing style..changeset/three-impalas-love.md (1)
5-6
: Typo: “preoperty” → “property”.-Add optional `subgraphName` preoperty to the `ExecutionRequest` interface for usage in Gateways like +Add optional `subgraphName` property to the `ExecutionRequest` interface for usage in Gateways like
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.changeset/three-impalas-love.md
(1 hunks)packages/utils/src/Interfaces.ts
(1 hunks)
🧰 Additional context used
🪛 LanguageTool
.changeset/three-impalas-love.md
[grammar] ~5-~5: Ensure spelling is correct
Context: ... minor --- Add optional subgraphName
preoperty to the ExecutionRequest
interface for...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
- GitHub Check: alpha / snapshot
- GitHub Check: deployment
- GitHub Check: Unit Test on Bun
- GitHub Check: Unit Test on Node 18 (windows-latest) and GraphQL v16
- GitHub Check: Unit Test on Node 24 (ubuntu-latest) and GraphQL v16
- GitHub Check: Full Check on GraphQL v16
- GitHub Check: Unit Test on Node 18 (ubuntu-latest) and GraphQL v15
- GitHub Check: Unit Test on Node 22 (ubuntu-latest) and GraphQL v16
- GitHub Check: Unit Test on Node 18 (ubuntu-latest) and GraphQL v16
💻 Website PreviewThe latest changes are available as preview in: https://pr-7281.graphql-tools.pages.dev |
Description
This PR aims to ease the development of GraphQL Gateways (like Hive Gateway) by adding an optional
subgraphName
property to theExecutionRequest
type. This property can be populated with the targeted subgraph name by the Gateway to make it easier to identify them.Related to graphql-hive/gateway#1311
Type of change
Checklist:
CONTRIBUTING doc and the
style guidelines of this project
Further comments
This will allow to remove an annoying point in Hive Gateway Plugin development: The subgraph name can't be access directly from
onFetch
hook. It has to be retrieve from a global weak map with the execution request as a key. With this change, the subgraph name will be directly accessible and easy to find for new developers.