cjoudrey/graphql-schema-linter

Some rules seem impossible to ignore

Opened this issue · 0 comments

A bit of background, we're working with a Federated Schema, built using TypeGraphQL and Apollo. As a quality measure, I want to implement schema linting, to help us maintain this rather large, and growing graph.

We have a large monolith graph that we are migrating away from, and are no longer making changes to that old schema. Thus, I don't want to include it in our linting, but rather just ignore everything in it. This is where ignore rules come into play.

I've successfully ignored quite a few of the rules, using a graphql-schema-linter.config.js that imports a set of rules that are related to the legacy schema, like this:

const legacy = require('./path/to/legacy-schema-linter.config.js');
module.exports = {
  ignore: {
    "arguments-have-descriptions": [
      "Query._entities",
      ...legacy.ignore["arguments-have-descriptions"]
    ],
    ...
 }
}

I'm having issues with the arguments-have-descriptions and input-object-values-are-camel-cased rules specifically.

Here's an example of two such errors:

14:5    The `SERVICEID` argument of `conditionFilterQuery` is missing a description.   arguments-have-descriptions        
14:5    The input value `conditionFilterQuery.SERVICEID` is not camel cased.           input-object-values-are-camel-cased

My problem is that neither of these ignore rules (or combinations of them) have any effect:

module.exports = {
  ignore: {
    "arguments-have-descriptions": ["SERVICEID"],
    "input-object-values-are-camel-cased": ["SERVICEID"]
  }
}
module.exports = {
  ignore: {
    "arguments-have-descriptions": ["conditionFilterQuery.SERVICEID"],
    "input-object-values-are-camel-cased": ["conditionFilterQuery.SERVICEID"]
  }
}
module.exports = {
  ignore: {
    "arguments-have-descriptions": ["conditionFilterQuery"],
    "input-object-values-are-camel-cased": ["conditionFilterQuery"]
  }
}

Any idea on what I'm doing wrong?