-
Notifications
You must be signed in to change notification settings - Fork 25
Update federation audit suite and fix some cases #1588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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.
const argsHash = selection.arguments | ||
.map( | ||
(arg) => | ||
arg.name.value + | ||
// TODO: slow? faster hash? | ||
memoizedASTPrint(arg.value).replace( | ||
/[^a-zA-Z0-9]/g, | ||
'', | ||
), | ||
) | ||
.join(''); |
There was a problem hiding this comment.
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.
🚀 Snapshot Release (
|
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 ↗︎ |
@ardatan suggestions with how to proceede with requires args conflict audit (read the descritpion for more info)? |
requires-with-argument-conflict
federation-gateway-audit#138requires
does not work