-
-
Notifications
You must be signed in to change notification settings - Fork 207
feat(core): add escapeSingleQuotes option for enum change messages #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
base: master
Are you sure you want to change the base?
Conversation
🚀 Snapshot Release (
|
| Package | Version | Info |
|---|---|---|
@graphql-inspector/action |
5.0.9-alpha-20251106163027-1170e5ffdb51e87c07ba7290e5ec949460591b5c |
npm ↗︎ unpkg ↗︎ |
@graphql-inspector/cli |
5.0.9-alpha-20251106163027-1170e5ffdb51e87c07ba7290e5ec949460591b5c |
npm ↗︎ unpkg ↗︎ |
@graphql-inspector/audit-command |
5.0.9-alpha-20251106163027-1170e5ffdb51e87c07ba7290e5ec949460591b5c |
npm ↗︎ unpkg ↗︎ |
@graphql-inspector/coverage-command |
6.1.3-alpha-20251106163027-1170e5ffdb51e87c07ba7290e5ec949460591b5c |
npm ↗︎ unpkg ↗︎ |
@graphql-inspector/diff-command |
5.0.9-alpha-20251106163027-1170e5ffdb51e87c07ba7290e5ec949460591b5c |
npm ↗︎ unpkg ↗︎ |
@graphql-inspector/introspect-command |
5.0.9-alpha-20251106163027-1170e5ffdb51e87c07ba7290e5ec949460591b5c |
npm ↗︎ unpkg ↗︎ |
@graphql-inspector/similar-command |
5.0.9-alpha-20251106163027-1170e5ffdb51e87c07ba7290e5ec949460591b5c |
npm ↗︎ unpkg ↗︎ |
@graphql-inspector/validate-command |
5.0.9-alpha-20251106163027-1170e5ffdb51e87c07ba7290e5ec949460591b5c |
npm ↗︎ unpkg ↗︎ |
@graphql-inspector/core |
6.3.0-alpha-20251106163027-1170e5ffdb51e87c07ba7290e5ec949460591b5c |
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
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.