cjoudrey / graphql-schema-linter

Validate GraphQL schema definitions against a set of rules
MIT License
694 stars 62 forks source link

Support ignoring a rule for all types. #274

Open tmc opened 3 years ago

cjoudrey commented 3 years ago

Hey @tmc, thanks for opening this issue.

Can you provide a bit more clarity on the issue you're reporting?

Thanks!

scags9876 commented 3 years ago

I am curious about this as well. If i want to completely ignore a rule for all fields and all types, is that possible? with the following config file:

{
  "ignore": {
    "types-have-descriptions": ["Movie"], 
    "enum-values-have-descriptions": ["Genre"]
  },
}

only disables these rules for Movie types and Genre enums. I want to just not see these rule active for any type or field. If i add a new enum and don't add descriptions for the values, schema linting should pass without me updating my schema linter config.

cjoudrey commented 3 years ago

If you want to completely disable enum-values-have-descriptions, you can configure what rules to be run using "rules": ["..."] (or --rules ...). For example: https://github.com/cjoudrey/graphql-schema-linter#in-packagejson.

This is an opt-in list though and not an ignore list.

Let me know if I misunderstood your request.