-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
loadGraphQLConfig
searches for graphqlrc files relative to CWD, not the linted files
#899
Comments
Hey, sorry, I don't remember any of my PRs in this repo. Only this one, but it's from 2020 #176 |
Oops, wrong mention :) |
hey @lennyburdette , thanks again for the wonderful contribution! Your PR is merged and released as If it's ok, I wanted to ask you about https://github.com/apollographql/eslint-plugin-graphql - what is the future of that library from Apollo's perspective? It has been unmaintained for a while but is still very popular. We saw that some new projects at Apollo use Also, if there are more changes or things you would want us to solve on Thank you so much and we are looking forward to more ways we could collaborate together! |
Hi @dotansimha ! Thanks for the review and for shepherding this through! I can't speak directly for the open source maintainers within Apollo, but personally I think that we should deprecate our library and direct future linting efforts towards graphql-eslint. I'll start some conversations internally and get back to you. I've spent some time over the last few weeks trying to put together some examples of using graphql-eslint for our customers. The most common ask is for enforcing standards and best practices for schema authors. It's proven a bit more challenging than I expected because of the rules that require an instance of the full schema, like no-unknown-types. Issue #593 seems related — generating and refreshing the schema for real-time feedback in an IDE is tricky! But I still want to recommend graphql-eslint as a command line/continuous integration tool. I've noticed that some error messages lack enough context to fix the issue, but I'll file some bugs or PRs about that soon. I'm also looking forward to collaborating! Thanks for taking on this project! |
Describe the bug
When running rules that need access to the schema, and using a .graphqlrc file to locate the schema, the search for the .graphqlrc file always starts from
process.cwd()
(see graphql-config docs forrootDir
).To Reproduce
Runnable reproduction: https://stackblitz.com/edit/node-6fhvcm?file=README.md
Original steps to reproduce the behavior:
Expected behavior
Graphql-eslint should search for .graphqlrc files relative to the file being linted. This is a relatively simple change:
Environment:
@graphql-eslint/[email protected]
:Additional context
There's also an issue with declaring the schema in .eslintrc with the
"parserOptions.schema"
option, where it looks for the file relative to process.cwd instead of relative to the .eslintrc, but that would be a different fix.The text was updated successfully, but these errors were encountered: