Skip to content

Commit 66f3c97

Browse files
committed
close #10
1 parent ad9748d commit 66f3c97

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

plugins/document.schema/index.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,22 +150,21 @@ export default class SchemaPlugin extends Plugin implements PluginInterface {
150150
}
151151

152152
argumentDescription(arg: InputValue): string[] {
153-
154-
const desc = arg.description === null ?
153+
const desc = !arg.description ?
155154
'[' + this.html.highlight('Not documented') + ']' : arg.description;
156155

157156
return this.description(this.html.highlight(arg.name) + ': ' + desc);
158157
}
159158

160159
argumentsDescription(fieldOrDirectives: Field | Directive): string[] {
161-
162-
if (fieldOrDirectives.args.length === 0) {
160+
const argsWithDescriptions = fieldOrDirectives.args.filter(arg => arg.description);
161+
if (argsWithDescriptions.length === 0) {
163162
return [];
164163
}
165164

166165
const reduceArguments = (descriptions: string[], arg: InputValue) => descriptions.concat(this.argumentDescription(arg));
167166

168-
return fieldOrDirectives.args
167+
return argsWithDescriptions
169168
.reduce(reduceArguments, [this.html.comment('Arguments')]);
170169
}
171170

0 commit comments

Comments
 (0)