cjoudrey / graphql-schema-linter

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

Error raised while using inline linter configuration #335

Open vykulakov opened 2 months ago

vykulakov commented 2 months ago

Code sample:

type Invoice @goModel(model: "package.Invoice"){
    id: UUID!
    number: Int! # lint-disable
}

Error stack trace:

It looks like you may have hit a bug in graphql-schema-linter.
It would be super helpful if you could report this here: https://github.com/cjoudrey/graphql-schema-linter/issues/new
TypeError: Cannot read properties of undefined (reading 'split')
    at parseRulesArg (/usr/local/lib/nodejs/node-v16.19.0-linux-x64/lib/node_modules/graphql-schema-linter/lib/inline_configuration.js:55:16)
    at parseInlineComment (/usr/local/lib/nodejs/node-v16.19.0-linux-x64/lib/node_modules/graphql-schema-linter/lib/inline_configuration.js:41:16)
    at extractInlineConfigs (/usr/local/lib/nodejs/node-v16.19.0-linux-x64/lib/node_modules/graphql-schema-linter/lib/inline_configuration.js:18:27)
    at inlineConfigErrorFilter (/usr/local/lib/nodejs/node-v16.19.0-linux-x64/lib/node_modules/graphql-schema-linter/lib/validator.js:100:72)
    at validateSchemaDefinition (/usr/local/lib/nodejs/node-v16.19.0-linux-x64/lib/node_modules/graphql-schema-linter/lib/validator.js:78:25)
    at run (/usr/local/lib/nodejs/node-v16.19.0-linux-x64/lib/node_modules/graphql-schema-linter/lib/runner.js:68:58)
vykulakov commented 2 months ago

Seems like a haven't passed any rule name to the directive in the inline configuration.