Closed qrsor closed 4 years ago
Hello @qrsor, I'm glad you managed to get it to work.
The rules are named with hyphens (-
) as per: https://github.com/cjoudrey/graphql-schema-linter#built-in-rules
Here's an example: https://github.com/cjoudrey/graphql-schema-linter#in-packagejson
In your case, this should work:
module.exports = {
rules: ["defined-types-are-used"],
};
In case you're curious, the reason "DefinedTypesAreUsed"
also works is because internally they are named with camel-cases. The hyphen names get converted to camel case here: https://github.com/cjoudrey/graphql-schema-linter/blob/e21bcefe9d6cd68cdb9e12fe77433f3060bb9f8d/src/configuration.js#L170-L175.
Feel free to re-open this if you have other issues.
Node version: 12.16.3 Command executed:
npx graphql-schema-linter aws_appsync.graphql schema.graphql
Configuration file: graphql-schema-linter.config.jsExpected: schema is validated using a single rule Actual: A message is being displayed:
I was able to get it working by replacing the rule name with "DefinedTypesAreUsed".