Skip to content

Conversation

enisdenjo
Copy link
Member

@Copilot Copilot AI review requested due to automatic review settings October 6, 2025 15:49
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 updates the federation audit suite and fixes several federation-related issues, particularly around handling circular @requires directives and alias deduplication in GraphQL federation.

  • Updated the federation audit test suite to remove core vs gateway duplicate testing
  • Fixed alias deduplication by incorporating argument hashes into field aliases
  • Improved handling of circular @requires dependencies between subgraphs

Reviewed Changes

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

Show a summary per file
File Description
packages/federation/tests/federation-compatibility.test.ts Simplified test structure by removing duplicate core executor tests and unnecessary imports
packages/federation/src/supergraph.ts Enhanced alias generation to include argument hashes for proper field deduplication
packages/federation/package.json Updated federation audit suite repository reference
packages/delegate/src/defaultMergedResolver.ts Added logic to handle circular @requires dependencies and improved deferred field resolution
.changeset/wet-bugs-double.md Added changelog entry for the circular @requires fix

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

Comment on lines +809 to +819
const argsHash = selection.arguments
.map(
(arg) =>
arg.name.value +
// TODO: slow? faster hash?
memoizedASTPrint(arg.value).replace(
/[^a-zA-Z0-9]/g,
'',
),
)
.join('');
Copy link
Preview

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

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

The current hashing approach using memoizedASTPrint followed by regex replacement could be inefficient for large argument sets. Consider using a proper hash function like crypto.createHash or a lightweight hash library for better performance.

Copilot uses AI. Check for mistakes.

@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-2f1daa6f6a537c7d932249b5986d11acf759821d npm ↗︎ unpkg ↗︎
@graphql-tools/delegate 11.0.2-alpha-2f1daa6f6a537c7d932249b5986d11acf759821d npm ↗︎ unpkg ↗︎
@graphql-tools/federation 4.0.6-alpha-2f1daa6f6a537c7d932249b5986d11acf759821d npm ↗︎ unpkg ↗︎
@graphql-mesh/fusion-runtime 1.2.6-alpha-2f1daa6f6a537c7d932249b5986d11acf759821d npm ↗︎ unpkg ↗︎
@graphql-hive/gateway 2.1.10-alpha-2f1daa6f6a537c7d932249b5986d11acf759821d npm ↗︎ unpkg ↗︎
@graphql-hive/nestjs 2.0.15-alpha-2f1daa6f6a537c7d932249b5986d11acf759821d npm ↗︎ unpkg ↗︎
@graphql-hive/plugin-aws-sigv4 2.0.10-alpha-2f1daa6f6a537c7d932249b5986d11acf759821d npm ↗︎ unpkg ↗︎
@graphql-hive/plugin-opentelemetry 1.0.12-alpha-2f1daa6f6a537c7d932249b5986d11acf759821d npm ↗︎ unpkg ↗︎
@graphql-mesh/plugin-prometheus 2.0.13-alpha-2f1daa6f6a537c7d932249b5986d11acf759821d npm ↗︎ unpkg ↗︎
@graphql-hive/gateway-runtime 2.1.9-alpha-2f1daa6f6a537c7d932249b5986d11acf759821d npm ↗︎ unpkg ↗︎
@graphql-tools/stitch 10.0.3-alpha-2f1daa6f6a537c7d932249b5986d11acf759821d npm ↗︎ unpkg ↗︎
@graphql-tools/stitching-directives 4.0.2-alpha-2f1daa6f6a537c7d932249b5986d11acf759821d npm ↗︎ unpkg ↗︎
@graphql-tools/wrap 11.0.2-alpha-2f1daa6f6a537c7d932249b5986d11acf759821d 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 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 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-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 Windows-X64)

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

Download

@enisdenjo enisdenjo requested a review from ardatan October 8, 2025 10:48
@enisdenjo
Copy link
Member Author

@ardatan suggestions with how to proceede with requires args conflict audit (read the descritpion for more info)?

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