Skip to content

BlockString: print multi line for trailing backslash#2560

Merged
IvanGoncharov merged 1 commit intographql:masterfrom
0xnmn:master
May 18, 2020
Merged

BlockString: print multi line for trailing backslash#2560
IvanGoncharov merged 1 commit intographql:masterfrom
0xnmn:master

Conversation

@0xnmn
Copy link
Copy Markdown
Contributor

@0xnmn 0xnmn commented May 17, 2020

Fixes: #2512

\""" is not allowed inside a BlockString, so handled it by putting a \n between the backslash and triple quotes. The trailing '\n' are already handled.

Thanks for the help @IvanGoncharov .

Copy link
Copy Markdown
Member

@IvanGoncharov IvanGoncharov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hereisnaman Looks great 👍
The next step is to write tests.

@IvanGoncharov IvanGoncharov changed the title [Issue: 2512] BlockString: print multi line for trailing backslash BlockString: print multi line for trailing backslash May 17, 2020
@0xnmn
Copy link
Copy Markdown
Contributor Author

0xnmn commented May 17, 2020

@hereisnaman Looks great 👍
The next step is to write tests.

Added a test.

expect(printBlockString(str, '', true)).to.equal(
joinLines('"""', 'backslash \\', '"""'),
);
});
Copy link
Copy Markdown
Member

@IvanGoncharov IvanGoncharov May 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes more sense to move it one test up since it has the same logic as those tests.
Also joinLines make sense only in tests related to "indent".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@IvanGoncharov IvanGoncharov merged commit 15e43b8 into graphql:master May 18, 2020
@IvanGoncharov
Copy link
Copy Markdown
Member

@hereisnaman Merged 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: bug fix 🐞 requires increase of "patch" version number

Projects

None yet

Development

Successfully merging this pull request may close these issues.

printSchema produces incorrect AST for descriptions ending in \ (backslash)

2 participants