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

Error: File .graphql doesn't match any project #479

Closed
tobiasdiez opened this issue Jun 3, 2021 · 2 comments
Closed

Error: File .graphql doesn't match any project #479

tobiasdiez opened this issue Jun 3, 2021 · 2 comments
Labels
stage/0-issue-prerequisites Needs more information before we can start working on it

Comments

@tobiasdiez
Copy link
Contributor

Describe the bug
After following the installation instructions, every graphql reports the following error:

JabRefOnline\api\documents\schema.graphql
0:0 error Parsing error: File 'JabRefOnline\api\documents\schema.graphql' doesn't match any project

To Reproduce
Install the linter as described in the readme, and run it.
In particular, this is in the eslint config:

  overrides: [
    {
      files: ['*.graphql'],
      parser: '@graphql-eslint/eslint-plugin',
      plugins: ['@graphql-eslint'],
      rules: {
        '@graphql-eslint/known-directives': 'error',
      },
    },
    {
      files: ['*.tsx', '*.ts', '*.jsx', '*.js'],
      processor: '@graphql-eslint/graphql',
    },
  ],

(I also tried to pass the schema using parserOptions with no success)
and the graphql.config is

const config = {
  schema: ['api/**/*.graphql'],
  extensions: {
    codegen: { ... },
  },
}

The full set of changes/code can be found at https://github.com/JabRef/JabRefOnline/pull/166/files.

I investigated this problem a bit and the error is thrown here:
https://github.com/kamilkisiela/graphql-config/blob/89767c8b3dc56a930f42e5e96bcbc43bd5644f41/src/config.ts#L225-L227
However, I don't understand why the project is not found - as you see above I only have one, and this one also doesn't have any include or exclude statements.

Expected behavior
No error, but linting of the graphql file.

Environment:

  • OS: Win 10
  • @graphql-eslint/...: 1.0.1
  • NodeJS: 14.14.37

Additional context

@dimaMachina
Copy link
Owner

Thanks for the detailed reports!

I'm not adding a lot here but I'm just labeling it according to our new Contribution Guide and issue flow.

It looks like already got it into stage 0! thank you for that!

Now in order to advance to stage 1 we'll need a running reproduction. Please keep in mind to remove unnecessary dependencies, code, packages and so on which are not related to the issue.

@dimaMachina dimaMachina added the stage/0-issue-prerequisites Needs more information before we can start working on it label Jun 4, 2021
@tobiasdiez
Copy link
Contributor Author

I tried it again, and the error disappeared after updating to the latest version (of this plugin, as well as other graphql-related dependencies). So I'll close this issue. Sorry for the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage/0-issue-prerequisites Needs more information before we can start working on it
Projects
None yet
Development

No branches or pull requests

2 participants