You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functionrequireGraphQLSchemaFromContext(ruleId,context){const{ schema }=context.sourceCode.parserServices;if(!schema)thrownewError(`Rule \`${ruleId}\` requires graphql-config \`schema\` field to be set and loaded. See https://the-guild.dev/graphql/config/docs/user/schema for more info`);returnschema;}
and interestingly, if we change context.sourceCode to context.getSourceCode() everything starts working normally.
Similar issue for us, but with documents. getSourceCode() doesn't seem to help either. Sprinkled some console.logs, and looks like the wrong graphql.config.* is being loaded/used. It's a monorepo and we have more than one, and one of them doesn't have documents, because there aren't any in that particular package, only schemas.
Appears to happen only via LSP (in VSCode), not CLI.
Issue workflow progress
We are on
@graphql-eslint/[email protected]
.This is our
eslintrc
.graphqlrc.yml
the above error is coming from
and interestingly, if we change
context.sourceCode
tocontext.getSourceCode()
everything starts working normally.Appreciate any helps. Thanks
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
To Reproduce Steps to reproduce the behavior:
Expected behavior
Environment:
@graphql-eslint/eslint-plugin
:Additional context
The text was updated successfully, but these errors were encountered: