Skip to content

Commit

Permalink
fix(toSDL): remove trailing spaces in descriptions (affects old graph…
Browse files Browse the repository at this point in the history
…ql versions)
  • Loading branch information
nodkz committed May 11, 2021
1 parent a773d67 commit 8aa88fd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/utils/schemaPrinter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -445,11 +445,14 @@ export function printDescription(
indentation: string = '',
firstInBlock: boolean = true
): string {
const { description } = def;
let { description } = def;
if (description == null || options?.omitDescriptions) {
return '';
}

// remove trailing spaces for old GraphQL versions
description = (description as string).trimRight();

if (options && options.commentDescriptions) {
return printDescriptionWithComments(description, indentation, firstInBlock);
}
Expand Down

0 comments on commit 8aa88fd

Please sign in to comment.