graphql-eslint
graphql-eslint copied to clipboard
`no-unreachable-types` doesn't seem to work properly when Query/Mutation types are defined in a separate file
Issue workflow progress
Progress of the issue based on the Contributor Workflow
- [ ] 1. The issue provides a reproduction available on GitHub, Stackblitz or CodeSandbox
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
Hi π
We're trying to use this library to lint some of our subgraphs (in an Apollo Federation) and as per the sandbox below, we are getting an error for all of our types from no-unreachable-types
rule. Are we doing something wrong, or is there a real issue here? π€
Thanks.
To Reproduce Steps to reproduce the behavior:
CodeSandbox
Run yarn lint
in the console
Expected behavior
Book
is reachable and it shouldn't throw an Error for it.
Environment:
- OS: MacOS
-
@graphql-eslint/eslint-plugin
: 3.10.7 - Node.js: 16.15
Itβs works perfectly fine, provide full schema for graphql-eslint
parserOptions:
schema:
- './src/schema.graphql'
+ - './src/subgraph.graphql'
@B2o5T Thanks for the quick response. Yes, it seems to be working now. It is a bit strange that you have to add the file being linted to the schema as well π€ But, I am glad it is working π