graphql-schema-linter
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -11,2 +11,8 @@ # Changelog | ||
## 0.1.5 (April 7th, 2017) | ||
### New features | ||
- Add `--old-implements-syntax` option to support the old SDL syntax for `implements`. [#124](https://github.com/cjoudrey/graphql-schema-linter/pull/124). (Thanks @ruiaraujo for initial report.) | ||
## 0.1.4 (April 7th, 2017) | ||
@@ -13,0 +19,0 @@ |
@@ -44,2 +44,3 @@ 'use strict'; | ||
- commentDescriptions: [boolean] use old way of defining descriptions in GraphQL SDL | ||
- oldImplementsSyntax: [boolean] use old way of defining implemented interfaces in GraphQL SDL | ||
*/ | ||
@@ -55,3 +56,4 @@ function Configuration() { | ||
customRulePaths: [], | ||
commentDescriptions: false | ||
commentDescriptions: false, | ||
oldImplementsSyntax: false | ||
}; | ||
@@ -76,2 +78,7 @@ var configOptions = loadOptionsFromConfig(options.configDirectory); | ||
}, { | ||
key: 'getOldImplementsSyntax', | ||
value: function getOldImplementsSyntax() { | ||
return this.options.oldImplementsSyntax; | ||
} | ||
}, { | ||
key: 'getSchema', | ||
@@ -78,0 +85,0 @@ value: function getSchema() { |
@@ -27,3 +27,3 @@ 'use strict'; | ||
function run(stdout, stdin, stderr, argv) { | ||
var commander = new _commander.Command().usage('[options] [schema.graphql ...]').option('-r, --rules <rules>', 'only the rules specified will be used to validate the schema. Example: fields-have-descriptions,types-have-descriptions').option('-f, --format <format>', 'choose the output format of the report. Possible values: json, text').option('-s, --stdin', 'schema definition will be read from STDIN instead of specified file.').option('-c, --config-directory <path>', 'path to begin searching for config files.').option('-p, --custom-rule-paths <paths>', 'path to additional custom rules to be loaded. Example: rules/*.js').option('--comment-descriptions', 'use old way of defining descriptions in GraphQL SDL') | ||
var commander = new _commander.Command().usage('[options] [schema.graphql ...]').option('-r, --rules <rules>', 'only the rules specified will be used to validate the schema. Example: fields-have-descriptions,types-have-descriptions').option('-f, --format <format>', 'choose the output format of the report. Possible values: json, text').option('-s, --stdin', 'schema definition will be read from STDIN instead of specified file.').option('-c, --config-directory <path>', 'path to begin searching for config files.').option('-p, --custom-rule-paths <paths>', 'path to additional custom rules to be loaded. Example: rules/*.js').option('--comment-descriptions', 'use old way of defining descriptions in GraphQL SDL').option('--old-implements-syntax', 'use old way of defining implemented interfaces in GraphQL SDL') | ||
// DEPRECATED - This code should be removed in v1.0.0. | ||
@@ -120,2 +120,6 @@ .option('-o, --only <rules>', 'This option is DEPRECATED. Use `--rules` instead.') | ||
if (commander.oldImplementsSyntax) { | ||
options.oldImplementsSyntax = commander.oldImplementsSyntax; | ||
} | ||
if (commander.args && commander.args.length) { | ||
@@ -122,0 +126,0 @@ options.schemaPaths = commander.args; |
@@ -18,4 +18,10 @@ 'use strict'; | ||
var ast = void 0; | ||
var parseOptions = {}; | ||
if (configuration.getOldImplementsSyntax()) { | ||
parseOptions.allowLegacySDLImplementsInterfaces = true; | ||
} | ||
try { | ||
ast = (0, _graphql.parse)(schemaDefinition); | ||
ast = (0, _graphql.parse)(schemaDefinition, parseOptions); | ||
} catch (e) { | ||
@@ -22,0 +28,0 @@ if (e instanceof _error.GraphQLError) { |
{ | ||
"name": "graphql-schema-linter", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": | ||
@@ -5,0 +5,0 @@ "Command line tool and package to validate GraphQL schemas against a set of rules.", |
@@ -47,6 +47,2 @@ # graphql-schema-linter [](https://travis-ci.org/cjoudrey/graphql-schema-linter) [](https://yarnpkg.com/en/package/graphql-schema-linter) | ||
--comment-descriptions | ||
use old way of defining descriptions in GraphQL SDL | ||
-c, --config-direction <path> | ||
@@ -60,2 +56,10 @@ | ||
--comment-descriptions | ||
use old way of defining descriptions in GraphQL SDL | ||
--old-implements-syntax | ||
use old way of defining implemented interfaces in GraphQL SDL | ||
--version | ||
@@ -62,0 +66,0 @@ |
729825
1088
329