Skip to content

Conversation

ardatan
Copy link
Member

@ardatan ardatan commented Sep 24, 2025

Closes ardatan/graphql-tools#4994

When there is a computed field in the extension field's return type, there was a bug causing the type merging skipped.
This PR solves that issue.

@Copilot Copilot AI review requested due to automatic review settings September 24, 2025 16:09
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 an issue with type-merging in extension fields within the delegate package. The fix ensures that transformed schemas with extension fields can properly resolve merged types by implementing additional lookup logic.

  • Added fallback logic to find merged type information when the initial lookup fails
  • Added comprehensive test case covering schema stitching with extensions and subscriptions
  • Updated changeset to document the fix for type-merging in extended fields

Reviewed Changes

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

File Description
packages/delegate/src/resolveExternalValue.ts Added fallback logic to find merged type info by searching through possible type names and matching subschema names
packages/stitch/tests/stitchSchemas.test.ts Added comprehensive test case demonstrating schema extension with stitching directives and subscription handling
.changeset/big-dryers-sniff.md Added changeset documenting the type-merging fix

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

@theguild-bot
Copy link
Collaborator

🚀 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-56acbbb5a57e8d136b9efa99c1b7c87a5ccd64b7 npm ↗︎ unpkg ↗︎
@graphql-tools/delegate 11.0.2-alpha-56acbbb5a57e8d136b9efa99c1b7c87a5ccd64b7 npm ↗︎ unpkg ↗︎
@graphql-tools/federation 4.0.6-alpha-56acbbb5a57e8d136b9efa99c1b7c87a5ccd64b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/fusion-runtime 1.2.5-alpha-56acbbb5a57e8d136b9efa99c1b7c87a5ccd64b7 npm ↗︎ unpkg ↗︎
@graphql-hive/gateway 2.1.8-alpha-56acbbb5a57e8d136b9efa99c1b7c87a5ccd64b7 npm ↗︎ unpkg ↗︎
@graphql-hive/nestjs 2.0.13-alpha-56acbbb5a57e8d136b9efa99c1b7c87a5ccd64b7 npm ↗︎ unpkg ↗︎
@graphql-hive/plugin-aws-sigv4 2.0.8-alpha-56acbbb5a57e8d136b9efa99c1b7c87a5ccd64b7 npm ↗︎ unpkg ↗︎
@graphql-hive/plugin-opentelemetry 1.0.11-alpha-56acbbb5a57e8d136b9efa99c1b7c87a5ccd64b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/plugin-prometheus 2.0.12-alpha-56acbbb5a57e8d136b9efa99c1b7c87a5ccd64b7 npm ↗︎ unpkg ↗︎
@graphql-hive/gateway-runtime 2.1.8-alpha-56acbbb5a57e8d136b9efa99c1b7c87a5ccd64b7 npm ↗︎ unpkg ↗︎
@graphql-tools/stitch 10.0.3-alpha-56acbbb5a57e8d136b9efa99c1b7c87a5ccd64b7 npm ↗︎ unpkg ↗︎
@graphql-tools/stitching-directives 4.0.2-alpha-56acbbb5a57e8d136b9efa99c1b7c87a5ccd64b7 npm ↗︎ unpkg ↗︎
@graphql-tools/wrap 11.0.2-alpha-56acbbb5a57e8d136b9efa99c1b7c87a5ccd64b7 npm ↗︎ unpkg ↗︎

@theguild-bot
Copy link
Collaborator

🚀 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

🚀 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

🚀 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

🚀 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

🚀 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

🚀 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.8-alpha-56acbbb5a57e8d136b9efa99c1b7c87a5ccd64b7-bun

@theguild-bot
Copy link
Collaborator

🚀 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.8-alpha-56acbbb5a57e8d136b9efa99c1b7c87a5ccd64b7

@ardatan ardatan enabled auto-merge (squash) September 25, 2025 02:23
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.

2 participants