graphql-eslint
graphql-eslint copied to clipboard
Ignore "extend schema" in .graphql files
We use below extend
line in our .graphql file for federation and we get below error.
Code snippet:
extend schema @link(url: "https://specs.apollo.dev/federation/v2.3", import: ["@key"])
type Query {
myQuery: String
}
Error:
0:0 error Parsing error: [graphql-eslint] Error while loading schema: Directive "@link" may not be used on SCHEMA
Could you please advise on how this issue can be bypassed during graph ql eslint process?
this issue will be fixed after adding federation support https://github.com/B2o5T/graphql-eslint/issues/1824
Ok thank you @B2o5T, is there a tentative plan when this will be available?
Until end of year
Meanwhile is there a work around? I tried # eslint-disable-next-line
and # eslint-ignore
and both are not recognized by the library for .graphql files. Please advise.
They should works fine https://github.com/B2o5T/graphql-eslint/blob/master/packages/plugin/tests/eslint-directives.spec.ts
The directives work fine with files without parsing errors (extend in this case). But, they don't work with files that have extend on top. Is there a work around to ignore this part from parsing, until this feature is implemented?
Hi! Since this is reported as a parsing error, eslint directives are ignored. Is there any workaround?