-
-
Notifications
You must be signed in to change notification settings - Fork 206
feat(core): escape single quotes in all enum descriptions and deprecation reasons #2904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🚀 Snapshot Release (
|
| Package | Version | Info |
|---|---|---|
@graphql-inspector/action |
5.0.9-alpha-20251110124301-d9ebc84fc931e306c8b3270eae87ddd08256441a |
npm ↗︎ unpkg ↗︎ |
@graphql-inspector/cli |
5.0.9-alpha-20251110124301-d9ebc84fc931e306c8b3270eae87ddd08256441a |
npm ↗︎ unpkg ↗︎ |
@graphql-inspector/audit-command |
5.0.9-alpha-20251110124301-d9ebc84fc931e306c8b3270eae87ddd08256441a |
npm ↗︎ unpkg ↗︎ |
@graphql-inspector/coverage-command |
6.1.3-alpha-20251110124301-d9ebc84fc931e306c8b3270eae87ddd08256441a |
npm ↗︎ unpkg ↗︎ |
@graphql-inspector/diff-command |
5.0.9-alpha-20251110124301-d9ebc84fc931e306c8b3270eae87ddd08256441a |
npm ↗︎ unpkg ↗︎ |
@graphql-inspector/introspect-command |
5.0.9-alpha-20251110124301-d9ebc84fc931e306c8b3270eae87ddd08256441a |
npm ↗︎ unpkg ↗︎ |
@graphql-inspector/similar-command |
5.0.9-alpha-20251110124301-d9ebc84fc931e306c8b3270eae87ddd08256441a |
npm ↗︎ unpkg ↗︎ |
@graphql-inspector/validate-command |
5.0.9-alpha-20251110124301-d9ebc84fc931e306c8b3270eae87ddd08256441a |
npm ↗︎ unpkg ↗︎ |
@graphql-inspector/core |
6.3.0-alpha-20251110124301-d9ebc84fc931e306c8b3270eae87ddd08256441a |
npm ↗︎ unpkg ↗︎ |
💻 Website PreviewThe latest changes are available as preview in: https://pr-2904.graphql-inspector.pages.dev |
b7571e3 to
502fe78
Compare
|
It seems to me like we could instead just escape the output of the description in |
893520f to
9740de8
Compare
9740de8 to
2f72ce9
Compare
2f72ce9 to
69aae28
Compare
4937326 to
e50dffa
Compare
|
I think it'd be reasonable to escape all descriptions/string values, and not bother with adding a config. |
e50dffa to
1170e5f
Compare
4d5d0d6 to
098be67
Compare
098be67 to
f9ade20
Compare
f9ade20 to
e987cbd
Compare
e987cbd to
26c93da
Compare
n1ru4l
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good!
26c93da to
d9ebc84
Compare
Description
Adds a
escapeSingleQuotesconfiguration option toConsiderUsageConfigthat allows users to control whether enum change messages single-quotes should be escaped or not. When enabled, enum-related changes messages containing single-quotes will be escaped (e.g., Enum value 'C' was deprecated with reason 'don\'t use this anymore or else!!1').When disabled or omitted, the default behavior of single quotes is maintained for backward compatibility. The implementation adds a
fmt()utility function inutils/string.tsthat handles the quote formatting based on the configuration, and updates all enum change message builders to use this utility.Addresses #2903
Type of change
Please delete options that are not relevant.
Screenshots/Sandbox:
Current behavior causes this issue, where an example UI fails to discriminate when to labelize single quoted words/messages:

How Has This Been Tested?
fmt()utility function covering all scenarios (default, undefined config, explicit true/false)escapeSingleQuotes: trueoptionpnpm testto verify all tests passChecklist:
Further comments
The
fmt()utility is designed to be easily extensible to other change types beyond enums if needed in the future. The configuration option is placed inConsiderUsageConfigto maintain consistency with other diff configuration options.