-
-
Notifications
You must be signed in to change notification settings - Fork 197
InputFieldAddedChange when adding a non-null type field with a default value is not a breaking change #2881
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: master
Are you sure you want to change the base?
Conversation
Summary: update cases. Reviewers: ureview JIRA Issues: RF-19036 Differential Revision: https://code.uberinternal.com/D17076739
@@ -37,6 +40,12 @@ describe('input', () => { | |||
expect(change.d.message).toEqual( | |||
"Input field 'd' of type 'String' was added to input object type 'Foo'", | |||
); | |||
// Non-nullable with default | |||
expect(change.e.criticality.level).toEqual(CriticalityLevel.Dangerous); |
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.
Why is this dangerous? This seems simply non-breaking to me. What's the definition of dangerous vs critical?
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.
Dangerous is the original criticality level defined by core for this rule. So I would like to keep it as the same. For our internal rule, we will override it as non-breaking.
expect(change.e.criticality.level).toEqual(CriticalityLevel.Dangerous); | ||
expect(change.e.type).toEqual('INPUT_FIELD_ADDED'); | ||
expect(change.e.message).toEqual( | ||
"Input field 'e' of type 'String!' was added to input object type 'Foo'", |
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.
Should this message include include that is has a default?
Input field 'e' of type 'String!' with a default value was added to input object type 'Foo'
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.
ack. Updated the logic to handle this.
Hi, @kamilkisiela Appreciate your eyes on this PR. |
Description
Updated InputFieldAddedChange logic to correctly handle non-null fields with default values. Previously, adding such fields was flagged as breaking; this change ensures they are recognized as not breaking.
Fixes # (#2880)
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Updated input.test.ts to cover this change.
Provide instructions so we can reproduce.
Reproduce step is provided in reported issue.
Please also list any relevant details for your test configuration
Test Environment:
@graphql-inspector/...
: