Skip to content

Conversation

@adambenhassen
Copy link
Collaborator

@adambenhassen adambenhassen commented Nov 3, 2025

Description

Adds a useDoubleQuotes configuration option to ConsiderUsageConfig that allows users to control whether enum change messages use double quotes or single quotes. When enabled, enum-related changes will format values and names with double quotes (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 in utils/string.ts that 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.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Screenshots/Sandbox:

Current behavior causes this issue, where an example UI fails to discriminate when to labelize single quoted words/messages:
Screenshot 2025-10-30 at 12 04 41

How Has This Been Tested?

  • Added comprehensive unit tests for the fmt() utility function covering all scenarios (default, undefined config, explicit true/false)
  • Added tests for all enum change types with useDoubleQuotes: true option
  • Verified existing tests pass to ensure backward compatibility
  • Ran pnpm test to verify all tests pass

Checklist:

  • I have followed the CONTRIBUTING doc and the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

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 in ConsiderUsageConfig to maintain consistency with other diff configuration options.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 2025

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@graphql-inspector/action 5.0.9-alpha-20251103115505-502fe78325e0e6a3f48a9df87d594b801d0462ce npm ↗︎ unpkg ↗︎
@graphql-inspector/cli 5.0.9-alpha-20251103115505-502fe78325e0e6a3f48a9df87d594b801d0462ce npm ↗︎ unpkg ↗︎
@graphql-inspector/audit-command 5.0.9-alpha-20251103115505-502fe78325e0e6a3f48a9df87d594b801d0462ce npm ↗︎ unpkg ↗︎
@graphql-inspector/coverage-command 6.1.3-alpha-20251103115505-502fe78325e0e6a3f48a9df87d594b801d0462ce npm ↗︎ unpkg ↗︎
@graphql-inspector/diff-command 5.0.9-alpha-20251103115505-502fe78325e0e6a3f48a9df87d594b801d0462ce npm ↗︎ unpkg ↗︎
@graphql-inspector/introspect-command 5.0.9-alpha-20251103115505-502fe78325e0e6a3f48a9df87d594b801d0462ce npm ↗︎ unpkg ↗︎
@graphql-inspector/similar-command 5.0.9-alpha-20251103115505-502fe78325e0e6a3f48a9df87d594b801d0462ce npm ↗︎ unpkg ↗︎
@graphql-inspector/validate-command 5.0.9-alpha-20251103115505-502fe78325e0e6a3f48a9df87d594b801d0462ce npm ↗︎ unpkg ↗︎
@graphql-inspector/core 6.3.0-alpha-20251103115505-502fe78325e0e6a3f48a9df87d594b801d0462ce npm ↗︎ unpkg ↗︎

@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 2025

💻 Website Preview

The latest changes are available as preview in: https://pr-2904.graphql-inspector.pages.dev

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant