Skip to content

Conversation

ardatan
Copy link
Member

@ardatan ardatan commented Sep 24, 2025

@Copilot Copilot AI review requested due to automatic review settings September 24, 2025 14:35
@ardatan ardatan force-pushed the batch-delegation-error branch from 41866b5 to d83adff Compare September 24, 2025 14:36
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes error path handling in batch delegation scenarios where the same error occurs multiple times. The fix ensures that error paths are correctly preserved when using batch delegation, preventing duplicate error reporting while maintaining proper error location information.

  • Changed error tracking from WeakMap to WeakSet for more appropriate duplicate detection
  • Added error path relocation handling in batch delegation to preserve GraphQL error paths
  • Added comprehensive test coverage to verify error path preservation in both regular and batch delegation

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
packages/delegate/src/resolveExternalValue.ts Optimizes error tracking by switching from WeakMap to WeakSet
packages/batch-delegate/src/batchDelegateToSchema.ts Adds error path relocation handling for batch delegation
packages/batch-delegate/tests/errorPaths.test.ts Adds test coverage for error path preservation in delegation scenarios
.changeset/breezy-weeks-camp.md Documents the patch changes for both affected packages

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@ardatan ardatan force-pushed the batch-delegation-error branch 3 times, most recently from ef70193 to bb9905f Compare September 24, 2025 14:41
@theguild-bot
Copy link
Collaborator

theguild-bot commented Sep 24, 2025

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@graphql-tools/batch-delegate 10.0.2-alpha-14e4b0ce773be2d357065c1e138a2b8366018c51 npm ↗︎ unpkg ↗︎
@graphql-tools/delegate 11.0.2-alpha-14e4b0ce773be2d357065c1e138a2b8366018c51 npm ↗︎ unpkg ↗︎
@graphql-tools/federation 4.0.6-alpha-14e4b0ce773be2d357065c1e138a2b8366018c51 npm ↗︎ unpkg ↗︎
@graphql-mesh/fusion-runtime 1.2.6-alpha-14e4b0ce773be2d357065c1e138a2b8366018c51 npm ↗︎ unpkg ↗︎
@graphql-hive/gateway 2.1.11-alpha-14e4b0ce773be2d357065c1e138a2b8366018c51 npm ↗︎ unpkg ↗︎
@graphql-hive/nestjs 2.0.16-alpha-14e4b0ce773be2d357065c1e138a2b8366018c51 npm ↗︎ unpkg ↗︎
@graphql-hive/plugin-aws-sigv4 2.0.11-alpha-14e4b0ce773be2d357065c1e138a2b8366018c51 npm ↗︎ unpkg ↗︎
@graphql-hive/plugin-opentelemetry 1.0.13-alpha-14e4b0ce773be2d357065c1e138a2b8366018c51 npm ↗︎ unpkg ↗︎
@graphql-mesh/plugin-prometheus 2.0.14-alpha-14e4b0ce773be2d357065c1e138a2b8366018c51 npm ↗︎ unpkg ↗︎
@graphql-hive/gateway-runtime 2.1.10-alpha-14e4b0ce773be2d357065c1e138a2b8366018c51 npm ↗︎ unpkg ↗︎
@graphql-tools/stitch 10.0.3-alpha-14e4b0ce773be2d357065c1e138a2b8366018c51 npm ↗︎ unpkg ↗︎
@graphql-tools/stitching-directives 4.0.2-alpha-14e4b0ce773be2d357065c1e138a2b8366018c51 npm ↗︎ unpkg ↗︎
@graphql-tools/wrap 11.0.2-alpha-14e4b0ce773be2d357065c1e138a2b8366018c51 npm ↗︎ unpkg ↗︎

@ardatan ardatan enabled auto-merge (squash) September 24, 2025 14:45
@theguild-bot
Copy link
Collaborator

theguild-bot commented Sep 24, 2025

🚀 Snapshot Release (Binary for Linux-X64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@theguild-bot
Copy link
Collaborator

theguild-bot commented Sep 24, 2025

🚀 Snapshot Release (Binary for Linux-ARM64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@theguild-bot
Copy link
Collaborator

theguild-bot commented Sep 24, 2025

🚀 Snapshot Release (Binary for macOS-ARM64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@theguild-bot
Copy link
Collaborator

theguild-bot commented Sep 24, 2025

🚀 Snapshot Release (Binary for Windows-X64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@theguild-bot
Copy link
Collaborator

theguild-bot commented Sep 24, 2025

🚀 Snapshot Release (Binary for macOS-X64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@theguild-bot
Copy link
Collaborator

theguild-bot commented Sep 24, 2025

🚀 Snapshot Release (Node Docker Image)

The latest changes of this PR are available as image on GitHub Container Registry (based on the declared changesets):

ghcr.io/graphql-hive/gateway:2.1.11-alpha-14e4b0ce773be2d357065c1e138a2b8366018c51

@theguild-bot
Copy link
Collaborator

theguild-bot commented Sep 24, 2025

🚀 Snapshot Release (Bun Docker Image)

The latest changes of this PR are available as image on GitHub Container Registry (based on the declared changesets):

ghcr.io/graphql-hive/gateway:2.1.11-alpha-14e4b0ce773be2d357065c1e138a2b8366018c51-bun

@ardatan ardatan disabled auto-merge October 9, 2025 16:01
@ardatan ardatan requested a review from enisdenjo October 9, 2025 16:09
@ardatan ardatan enabled auto-merge (squash) October 9, 2025 16:09
@ardatan ardatan force-pushed the batch-delegation-error branch 2 times, most recently from 48ddf6c to 4f0794c Compare October 9, 2025 16:39
@ardatan ardatan force-pushed the batch-delegation-error branch from 4f0794c to 14e4b0c Compare October 14, 2025 12:10
@ardatan ardatan merged commit 058ef2f into main Oct 14, 2025
62 checks passed
@ardatan ardatan deleted the batch-delegation-error branch October 14, 2025 12:55
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.

[batch-delegate] Error paths use their batched indices

3 participants