Skip to content

Conversation

ardatan
Copy link
Member

@ardatan ardatan commented Aug 26, 2025

Fixes #1404

@Copilot Copilot AI review requested due to automatic review settings August 26, 2025 12:25
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 handling of @oneOf directives in GraphQL schema stitching by ensuring the directive is properly preserved when merging subschemas. The fix addresses issue #1404 where @oneOf directives were being lost during the schema stitching process.

  • Adds early return for single candidate types to avoid unnecessary processing
  • Preserves @oneOf directive on both ObjectType and InputObjectType during merging
  • Includes test coverage to verify the fix works correctly

Reviewed Changes

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

File Description
packages/stitch/tests/mergeOneOfs.test.ts Adds test case verifying @oneOf directives are preserved during schema stitching
packages/stitch/src/mergeCandidates.ts Implements the fix to preserve @oneOf directive when merging type candidates
.changeset/rare-chairs-itch.md Documents the change for release notes

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

@theguild-bot
Copy link
Collaborator

theguild-bot commented Aug 27, 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/federation 3.2.9-alpha-839e44c6b10873589b9c073d8abb795059199006 npm ↗︎ unpkg ↗︎
@graphql-mesh/fusion-runtime 0.12.0-alpha-839e44c6b10873589b9c073d8abb795059199006 npm ↗︎ unpkg ↗︎
@graphql-hive/gateway 1.16.4-alpha-839e44c6b10873589b9c073d8abb795059199006 npm ↗︎ unpkg ↗︎
@graphql-hive/logger-json 0.0.8-alpha-839e44c6b10873589b9c073d8abb795059199006 npm ↗︎ unpkg ↗︎
@graphql-hive/logger-pino 1.0.4-alpha-839e44c6b10873589b9c073d8abb795059199006 npm ↗︎ unpkg ↗︎
@graphql-hive/logger-winston 1.0.5-alpha-839e44c6b10873589b9c073d8abb795059199006 npm ↗︎ unpkg ↗︎
@graphql-hive/nestjs 1.0.23-alpha-839e44c6b10873589b9c073d8abb795059199006 npm ↗︎ unpkg ↗︎
@graphql-hive/plugin-aws-sigv4 1.0.19-alpha-839e44c6b10873589b9c073d8abb795059199006 npm ↗︎ unpkg ↗︎
@graphql-hive/plugin-deduplicate-request 1.0.5-alpha-839e44c6b10873589b9c073d8abb795059199006 npm ↗︎ unpkg ↗︎
@graphql-mesh/hmac-upstream-signature 1.2.32-alpha-839e44c6b10873589b9c073d8abb795059199006 npm ↗︎ unpkg ↗︎
@graphql-mesh/plugin-jwt-auth 1.5.9-alpha-839e44c6b10873589b9c073d8abb795059199006 npm ↗︎ unpkg ↗︎
@graphql-mesh/plugin-opentelemetry 1.3.67-alpha-839e44c6b10873589b9c073d8abb795059199006 npm ↗︎ unpkg ↗︎
@graphql-mesh/plugin-prometheus 1.3.55-alpha-839e44c6b10873589b9c073d8abb795059199006 npm ↗︎ unpkg ↗︎
@graphql-hive/gateway-runtime 1.11.0-alpha-839e44c6b10873589b9c073d8abb795059199006 npm ↗︎ unpkg ↗︎
@graphql-tools/stitch 9.4.29-alpha-839e44c6b10873589b9c073d8abb795059199006 npm ↗︎ unpkg ↗︎
@graphql-mesh/transport-common 0.7.39-alpha-839e44c6b10873589b9c073d8abb795059199006 npm ↗︎ unpkg ↗︎
@graphql-mesh/transport-http 0.7.3-alpha-839e44c6b10873589b9c073d8abb795059199006 npm ↗︎ unpkg ↗︎
@graphql-mesh/transport-http-callback 0.7.3-alpha-839e44c6b10873589b9c073d8abb795059199006 npm ↗︎ unpkg ↗︎
@graphql-mesh/transport-ws 1.1.3-alpha-839e44c6b10873589b9c073d8abb795059199006 npm ↗︎ unpkg ↗︎

@theguild-bot
Copy link
Collaborator

theguild-bot commented Aug 27, 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 Aug 27, 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 Aug 27, 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 Aug 27, 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 Aug 27, 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:1.16.4-alpha-839e44c6b10873589b9c073d8abb795059199006-bun

@theguild-bot
Copy link
Collaborator

theguild-bot commented Aug 27, 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:1.16.4-alpha-839e44c6b10873589b9c073d8abb795059199006

@theguild-bot
Copy link
Collaborator

theguild-bot commented Aug 27, 2025

🚀 Snapshot Release (Binary for Windows-X64)

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

Download

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.

@graphql-tools/stitch doesn't preserve @oneOf
2 participants