Skip to content

Conversation

@emileriksson
Copy link

@emileriksson emileriksson commented Oct 6, 2025

Description

GraphQL Inspector don't support Federation V2. This PR adds the directives as well as a new argument --federationV2 to support this functionality.

Fixes # (issue)
#2683

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

  • Added unit tests for the loader
  • Tested on a 1k+ types 10k+ field schema

Test Environment:

  • OS: Mac
  • @graphql-inspector/:
  • NodeJS: v22.19.0

Checklist:

  • I have followed the
    CONTRIBUTING doc and the
    style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@emileriksson
Copy link
Author

@dotansimha @ardatan Any chance this can be prioritized?

@emileriksson emileriksson changed the title Added Apollo Federation V2 support Add Apollo Federation V2 support Oct 7, 2025
@dotansimha
Copy link
Member

Thanks @emileriksson ! I added 1 comment about the static schema, otherwise this look good to me.

@dotansimha
Copy link
Member

@emileriksson any idea why CI is failing with latest changes? 👀 I think that's the only blocker we have now

@emileriksson
Copy link
Author

emileriksson commented Oct 16, 2025

Try trigger it again @dotansimha. The Node jobs go green when I ran this PR on my fork: emileriksson#2

@dotansimha
Copy link
Member

Yeah, this seems great. Thank you @emileriksson.

Can you please add a changeset file? Just run pnpm changeset in the root workspace and it will guide you. We'll need a minor version bump for the affected packages. Once added, we can merge and proceed. Thank you!

@emileriksson
Copy link
Author

Awesome! I added a changeset file with minors to all affected packages @dotansimha 😄

@dotansimha
Copy link
Member

Thanks @emileriksson !

Sorry for the additional requests, but two things came to mind when I discussed this with the team:

  • Specifying both --federation and --federationV2 will conflict and yield bad schema. Maybe it can be checked?
  • Federation v2 allow the user to use @link directive are rename some of the scalars/directive names. This will fall short for sure with the current implementation. We discussed the need for non-static schema and I think it might be relevant again? 🤔 (I'm ok with addressing this later in a follow up PR, but just wanted to hear your thoughts).

@dotansimha dotansimha requested a review from jdolle October 20, 2025 08:08
@dotansimha
Copy link
Member

cc @jdolle

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