enhance(executor-http): ensure subgraph name is present in the upstream HTTP error extensions#792
enhance(executor-http): ensure subgraph name is present in the upstream HTTP error extensions#792
Conversation
…am HTTP error extensions
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe changes introduce a new changeset file documenting updates to several GraphQL-related dependencies, including minor and patch version updates. A new interface for upstream error extensions has been added, while a local definition has been removed in favor of an external re-export. The HTTP executor options now include a new optional property for a service name, and related runtime code and tests have been updated to reflect changes in error extension properties. Changes
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used📓 Path-based instructions (3)`e2e/**`: This directory includes end-to-end tests for the g...
`**`: For all PRs, we would like to verify that a Linear iss...
`packages/**`: In this directory we keep all packages releva...
⏰ Context from checks skipped due to timeout of 90000ms (22)
🔇 Additional comments (2)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
.changeset/clean-games-film.md(1 hunks)packages/executors/common/src/index.ts(1 hunks)packages/executors/http/src/index.ts(5 hunks)packages/runtime/src/plugins/useUpstreamTimeout.ts(1 hunks)packages/runtime/tests/upstream-retry.test.ts(2 hunks)packages/transports/common/src/types.ts(1 hunks)packages/transports/http/src/index.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
`packages/**`: In this directory we keep all packages releva...
packages/**: In this directory we keep all packages relevant to the gateway.In most cases, when changes are made to the source code / dependencies in these directories, we also require to have a corresponding changeset file, created using
yarn changesetwith a full description on the changes with an example.
Also, when new features are added the packages, the changeset file should mentionminorsemver change. When a bug is fixed,patchneeds to be used. Themajorbump is used for a PR that has breaking changes.
packages/executors/common/src/index.tspackages/transports/common/src/types.tspackages/runtime/tests/upstream-retry.test.tspackages/runtime/src/plugins/useUpstreamTimeout.tspackages/transports/http/src/index.tspackages/executors/http/src/index.ts
`**`: For all PRs, we would like to verify that a Linear iss...
**: For all PRs, we would like to verify that a Linear issue is linked. Check if there's a mention for "GW-*" in the PR description, and the us know when it's missing.In most cases, when a PR adds a new functionality, we would like to make sure it has documentation in the corresponding
consoleproject.
Use the global knowledge feature to search for PRs ingraphql-hive/consolerepository that adds documentation. Suggest to create a follow up issue to add the missing documentation.
packages/executors/common/src/index.tspackages/transports/common/src/types.tspackages/runtime/tests/upstream-retry.test.tspackages/runtime/src/plugins/useUpstreamTimeout.tspackages/transports/http/src/index.tspackages/executors/http/src/index.ts
`packages/transports/**`: The transports configures how to d...
packages/transports/**: The transports configures how to deal with requests that are made from the GraphQL gateway to the GraphQL subgraphs. Transports manipulates the calls, headers, protocols and others.
packages/transports/common/src/types.tspackages/transports/http/src/index.ts
🪛 GitHub Check: Types
packages/transports/common/src/types.ts
[failure] 57-57:
Re-exporting a type when 'isolatedModules' is enabled requires using 'export type'.
⏰ Context from checks skipped due to timeout of 90000ms (10)
- GitHub Check: Leaks / Node v23
- GitHub Check: Leaks / Node v22
- GitHub Check: Leaks / Node v20
- GitHub Check: Leaks / Node v18
- GitHub Check: Benchmark / bun / 1000 items
- GitHub Check: Benchmark / bun / 100 items
- GitHub Check: Benchmark / bun / 10 items
- GitHub Check: Benchmark / node / 1000 items
- GitHub Check: Benchmark / node / 100 items
- GitHub Check: Benchmark / node / 10 items
🔇 Additional comments (11)
.changeset/clean-games-film.md (1)
1-9: Changeset properly documents the dependency updates and feature addition.The changeset correctly indicates:
- Minor version update for
@graphql-tools/executor-http- Patch updates for the other affected packages
- A clear description of the feature addition to include subgraph name in error extensions
This aligns with the PR objectives to enhance error reporting.
packages/executors/common/src/index.ts (1)
60-73: Well-structured interface for consistent error handling.The new
UpstreamErrorExtensionsinterface provides a standardized structure for error reporting in upstream HTTP requests, including the optionalserviceNameproperty which is the core enhancement of this PR.The interface is designed with appropriate optional fields to accommodate various error scenarios, properly typing the request and response information.
packages/runtime/tests/upstream-retry.test.ts (2)
93-93: Test updated to verify subgraph name in error extensions.The test now verifies that the subgraph name is included in the error extensions, validating the core functionality added by this PR.
194-194: Consistent error format across different error scenarios.The second test case is also properly updated to include the subgraph name in error extensions, ensuring consistent error reporting regardless of the error type (standard error vs rate limiting).
packages/runtime/src/plugins/useUpstreamTimeout.ts (1)
152-152: LGTM! Property renamed to improve consistency.The change from
subgraphtoserviceNamefor the property inupstreamErrorExtensionsaligns with the Apollo Gateway naming convention and creates better consistency across error handling in the codebase.packages/transports/http/src/index.ts (1)
59-59: LGTM! Properly passing subgraph name to HTTP executor.This addition correctly passes the subgraph name to the HTTP executor, ensuring it's available for error reporting. This change is aligned with the PR objective to include subgraph names in upstream HTTP error extensions.
packages/executors/http/src/index.ts (5)
5-5: LGTM! Using imported type instead of local definition.Importing
UpstreamErrorExtensionsfrom the common package promotes consistency and reduces duplication.
59-63: LGTM! Well-documented new property.The added
serviceNameproperty is properly documented with a clear description of its purpose.
165-165: LGTM! Proper extraction of the service name.Correctly extracts the service name from options to be used in error reporting.
238-238: LGTM! Including service name in upstream error extensions.Adding the service name to upstream error extensions provides valuable context for debugging and error handling.
447-447: LGTM! Consistent with Apollo Gateway naming.Using the service name as the value for the
subgraphproperty in downstream error extensions aligns with Apollo Gateway conventions as mentioned in the PR objectives.
🚀 Snapshot Release (
|
| Package | Version | Info |
|---|---|---|
@graphql-tools/batch-delegate |
9.0.32-alpha-97aa61c442facee49ab18af23145184fd1cb236c |
npm ↗︎ unpkg ↗︎ |
@graphql-tools/batch-execute |
9.0.13-alpha-97aa61c442facee49ab18af23145184fd1cb236c |
npm ↗︎ unpkg ↗︎ |
@graphql-tools/delegate |
10.2.14-alpha-97aa61c442facee49ab18af23145184fd1cb236c |
npm ↗︎ unpkg ↗︎ |
@graphql-tools/executor-common |
0.0.4-alpha-97aa61c442facee49ab18af23145184fd1cb236c |
npm ↗︎ unpkg ↗︎ |
@graphql-tools/executor-graphql-ws |
2.0.4-alpha-97aa61c442facee49ab18af23145184fd1cb236c |
npm ↗︎ unpkg ↗︎ |
@graphql-tools/executor-http |
1.3.0-alpha-97aa61c442facee49ab18af23145184fd1cb236c |
npm ↗︎ unpkg ↗︎ |
@graphql-tools/federation |
3.1.5-alpha-97aa61c442facee49ab18af23145184fd1cb236c |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/fusion-runtime |
0.11.3-alpha-97aa61c442facee49ab18af23145184fd1cb236c |
npm ↗︎ unpkg ↗︎ |
@graphql-hive/gateway |
1.11.0-alpha-97aa61c442facee49ab18af23145184fd1cb236c |
npm ↗︎ unpkg ↗︎ |
@graphql-hive/logger-json |
0.0.3-alpha-97aa61c442facee49ab18af23145184fd1cb236c |
npm ↗︎ unpkg ↗︎ |
@graphql-hive/logger-winston |
1.0.2-alpha-97aa61c442facee49ab18af23145184fd1cb236c |
npm ↗︎ unpkg ↗︎ |
@graphql-hive/nestjs |
1.0.0-alpha-97aa61c442facee49ab18af23145184fd1cb236c |
npm ↗︎ unpkg ↗︎ |
@graphql-hive/plugin-aws-sigv4 |
1.0.0-alpha-97aa61c442facee49ab18af23145184fd1cb236c |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/hmac-upstream-signature |
1.2.22-alpha-97aa61c442facee49ab18af23145184fd1cb236c |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/plugin-opentelemetry |
1.3.45-alpha-97aa61c442facee49ab18af23145184fd1cb236c |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/plugin-prometheus |
1.3.33-alpha-97aa61c442facee49ab18af23145184fd1cb236c |
npm ↗︎ unpkg ↗︎ |
@graphql-hive/gateway-runtime |
1.5.0-alpha-97aa61c442facee49ab18af23145184fd1cb236c |
npm ↗︎ unpkg ↗︎ |
@graphql-tools/stitch |
9.4.19-alpha-97aa61c442facee49ab18af23145184fd1cb236c |
npm ↗︎ unpkg ↗︎ |
@graphql-tools/stitching-directives |
3.1.29-alpha-97aa61c442facee49ab18af23145184fd1cb236c |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transport-common |
0.7.31-alpha-97aa61c442facee49ab18af23145184fd1cb236c |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transport-http |
0.6.35-alpha-97aa61c442facee49ab18af23145184fd1cb236c |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transport-http-callback |
0.5.22-alpha-97aa61c442facee49ab18af23145184fd1cb236c |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transport-ws |
1.0.5-alpha-97aa61c442facee49ab18af23145184fd1cb236c |
npm ↗︎ unpkg ↗︎ |
@graphql-tools/wrap |
10.0.32-alpha-97aa61c442facee49ab18af23145184fd1cb236c |
npm ↗︎ unpkg ↗︎ |
🚀 Snapshot Release (Node Docker Image)The latest changes of this PR are available as image on GitHub Container Registry (based on the declared |
🚀 Snapshot Release (Bun Docker Image)The latest changes of this PR are available as image on GitHub Container Registry (based on the declared |
Ref GW-241
Subgraph name exists as
serviceNamein case ofDOWNSTREAM_SERVICE_ERRORas in Apollo Gateway.