Open InsidersByte opened 12 hours ago
try 4.3.0-alpha-20241204113935-074a093b359d2947f263679eac8596958876a3b6
graphql-eslint
should parse federation subgraphs without parse errors and you could even use known-directives
rule which previously reported errors about unknown @link
directive.
But for linting federation subgraphs schemas optional peer dependency @apollo/subgraph
should be installed (you'll get runtime error in case of missing it)
I just tried it and it worked great!
Thanks
Issue workflow progress
Progress of the issue based on the Contributor Workflow
[ ] 1. The issue provides a reproduction available on GitHub, Stackblitz or CodeSandbox
[ ] 2. A failing test has been provided
[ ] 3. A local solution has been provided
[ ] 4. A pull request is pending review
Describe the bug
When attempting to lint a federation v2 schema with
v4
of graphql-eslint that includes a federation directive e.g.@key
. It fails with the error below.It was possible to lint with
v3
of graphql-eslint by settingparserOptions.schemaOptions.assumeValid
to true, but it doesn't seem possible to do this inv4
.To Reproduce Steps to reproduce the behavior:
You can see an example failing schema here on the playground.
Expected behavior
To be able to lint federation v2 schemas.
Environment:
@graphql-eslint/eslint-plugin
: 4.2.1Additional context
I did see both of the following and while they are related it might not be the only way to resolve this issue hence I raised another one. Feel free to close if you think its appropriate: