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

Eslint with remote schema not working in runtime #1721

Closed
1 of 4 tasks
Flashantik opened this issue Jun 30, 2023 · 4 comments · Fixed by #1725
Closed
1 of 4 tasks

Eslint with remote schema not working in runtime #1721

Flashantik opened this issue Jun 30, 2023 · 4 comments · Fixed by #1725
Labels
stage/6-released The issue has been solved on a released version of the library

Comments

@Flashantik
Copy link

Flashantik commented Jun 30, 2023

Issue workflow progress

Progress of the issue based on the
Contributor Workflow

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

    For example, you can start off by editng the
    'basic' example on Stackblitz.

    Please make sure the graphql-eslint 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
eslint not working in runtime with remote graphql schema
(https://github.com/Flashantik/graphql-eslint/tree/remote)

Screenshot 2023-07-01 at 01 01 37

But run lint work fine:

Screenshot 2023-07-01 at 01 14 02

with local schema all works fine
(https://github.com/Flashantik/graphql-eslint/tree/local)
Screenshot 2023-07-01 at 01 15 02

eslint with remote schema not working in runtime

To Reproduce Steps to reproduce the behavior:

  1. git clone https://github.com/Flashantik/graphql-eslint/tree/remote
  2. npm i

Expected behavior

eslint in runtime works

Environment:

  • OS: MacOs
  • @graphql-eslint/eslint-plugin: 3.19.1
  • Node.js: 18.13.0

Additional context
vscode 1.79.2 ( with "eslint.validate": ["graphql"] ) + eslint v2.4.2 (https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)

@dimaMachina
Copy link
Owner

Since there are no problems in cli, problem goes from upstream vscode-eslint

@Flashantik
Copy link
Author

Since there are no problems in cli, problem goes from upstream vscode-eslint

Of course. But it is definitely related to graphql-eslint.

And even if I have to create an issue on vscode-eslint I would like to understand how a remote circuit affects this

@dimaMachina
Copy link
Owner

@Flashantik
I fixed the broken error message Parsing error: Cannot read properties of undefined (reading '0') in @graphql-eslint/[email protected]

Now you should have the correct error message
image

that is produced due by #1091 (comment) and microsoft/vscode-eslint#1485

image

And to fix it, add .vscode/settings.json file with the following content (node path you can get by which node in terminal)

{
  "eslint.runtime": "/Users/dmytro/.nvm/versions/node/v18.16.1/bin/node"
}

now you should have working graphql-eslint with remote schema too
image

... tadaaam

@dimaMachina dimaMachina added the stage/6-released The issue has been solved on a released version of the library label Jul 2, 2023
@Flashantik
Copy link
Author

@Flashantik I fixed the broken error message Parsing error: Cannot read properties of undefined (reading '0') in @graphql-eslint/[email protected]

Now you should have the correct error message image

that is produced due by #1091 (comment) and microsoft/vscode-eslint#1485

image And to fix it, add `.vscode/settings.json` file with the following content (node path you can get by `which node` in terminal)
{
  "eslint.runtime": "/Users/dmytro/.nvm/versions/node/v18.16.1/bin/node"
}

now you should have working graphql-eslint with remote schema too image

... tadaaam

You are awesome! Thx you for your attention and help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage/6-released The issue has been solved on a released version of the library
Projects
None yet
2 participants