graphql-inspector icon indicating copy to clipboard operation
graphql-inspector copied to clipboard

commands with --federation not working.

Open anandwali opened this issue 1 year ago • 4 comments

Issue workflow progress

Progress of the issue based on the Contributor Workflow

  • [ ] 1. The issue provides a reproduction available on GitHub, Stackblitz or CodeSandbox

    Make sure to fork this template and run pnpm generate in the terminal.

    Please make sure the Codegen and plugins version under package.json matches yours.

  • [ ] 2. A failing test has been provided
  • [ ] 3. A local solution has been provided
  • [ ] 4. A pull request is pending review

Describe the bug

graphql-inspector diff not working for schemas with federated directives like @link, @key, @shareable.

I tried supplying --federation tag to the command, still it does not work. Any other way to make it work is helpful..

To Reproduce Steps to reproduce the behavior:

Expected behavior

Environment:

  • OS:
  • @graphql-inspector/...:
  • graphql:
  • NodeJS:

Additional context

anandwali avatar Jan 10 '24 01:01 anandwali

Hi @anandwali, I appreciate you bringing up this new issue :)

Could you kindly provide more details? I attempted to reproduce it, but everything seemed to be working perfectly fine.

TuvalSimha avatar Jan 16 '24 16:01 TuvalSimha

I think the issue is Apollo Federation support was added back in 2020 for v1 of Federation and hasn't been updated since for v2.0 or newer

cgriego avatar Apr 17 '24 19:04 cgriego

It seems you are right @cgriego. The code to handle federated schemas only considers v1 directives. More directives needs to be included to support v2 and especially the @link directive which is present in all federated schemas using v2 or newer, see apollo.

oskargotte avatar Jun 05 '24 09:06 oskargotte