Skip to content
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

Ignore "extend schema" in .graphql files #1910

Closed
gituserjava opened this issue Oct 4, 2023 · 8 comments
Closed

Ignore "extend schema" in .graphql files #1910

gituserjava opened this issue Oct 4, 2023 · 8 comments
Labels
kind/bug Bug :-( stage/6-released The issue has been solved on a released version of the library

Comments

@gituserjava
Copy link

gituserjava commented Oct 4, 2023

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?

@dimaMachina
Copy link
Collaborator

this issue will be fixed after adding federation support #1824

@gituserjava
Copy link
Author

Ok thank you @B2o5T, is there a tentative plan when this will be available?

@dimaMachina
Copy link
Collaborator

Until end of year

@gituserjava
Copy link
Author

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.

@dimaMachina
Copy link
Collaborator

@gunes-sayin
Copy link

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?

@MarcCoquand
Copy link

Hi! Since this is reported as a parsing error, eslint directives are ignored. Is there any workaround?

@dimaMachina
Copy link
Collaborator

@MarcCoquand @gunes-sayin @gituserjava fixed in 4.3.0, your federation subgraphs should be parsed without parsing errors now #2812 (comment)

@dimaMachina dimaMachina added stage/6-released The issue has been solved on a released version of the library kind/bug Bug :-( labels Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Bug :-( stage/6-released The issue has been solved on a released version of the library
Development

No branches or pull requests

4 participants