@graphql-inspector/core
Changelog for @graphql-inspector/core: every release with its changes and the pull requests behind them.
8.0.0
Major Changes
-
#2965
f640d71Thanks @n1ru4l! - Add support forgraphql-js@17.BREAKING Drop support for Node.js 20
BREAKING Drop support for GraphQL 14 and 15
7.1.3
Patch Changes
- #2952
3b341d4Thanks @jdolle! - “INPUT_FIELD_ADDED” is now classified as Dangerous (was NonBreaking) when the added field has a default value, since rolling deploys can expose consumers to the default before producers are ready.
7.1.2
Patch Changes
- #2934
14b4410Thanks @jdolle! - Add support for “extend schema” syntax to@graphql-inspector/core’sdifffunction and@graphql/inspector/patch. This allows directives to be defined on the schema such asextend schema @link(...)for federation
7.1.1
Patch Changes
- #2930
4a37c05Thanks @jdolle! - Add directive definition changes first; adjust adding repeat directive change
7.1.0
Minor Changes
-
#2923
9bfc094Thanks @jdolle! - Adjust SCHEMA_*_TYPE_CHANGED changes to use null instead of ‘unknown’ when these types are not defined and improve the change messages. -
#2923
9bfc094Thanks @jdolle! - diff can be passed null schemas. This lets it output the full list of additions on the new schema.
7.0.4
Patch Changes
-
#2924
74fcea7Thanks @adambenhassen! - Escape single quotes in diff change messages for descriptions and deprecation reasonsImprove description change messages to show “was added” or “was removed” instead of “changed from ‘undefined’ to X”
7.0.3
Patch Changes
- #2921
088cd4fThanks @jdolle! - Fix simplifyChanges for sibling changes. E.g. if User.foo and User.bar were added, then the later would be filtered out when it shouldn’t be filtered.
7.0.2
Patch Changes
- #2919
511afb5Thanks @jdolle! - export directiveRepeatableAddedFromMeta and directiveRepeatableRemovedFromMeta
7.0.1
Patch Changes
- #2916
91b8450Thanks @jdolle! - export DirectiveRepeatableAddedChange and DirectiveRepeatableRemovedChange
7.0.0
Major Changes
-
#2893
ef13125Thanks @jdolle! - This is a major change to@graphql-inspector/coreand introduces a new@graphql-inspector/patchpackage, which applies changes output fromdiffon top of a schema — essentially rebasing these changes onto any schema.These changes include:
- Numerous adjustments to Change types to create more accurate severity levels, such as a boolean indicating if the change applies to a new type or an existing type.
- Adjustmented the “path” on several change types in order to consistently map to the exact AST
node being changed. For example,
EnumValueDeprecationReasonAdded’s path previously referenced the enumValue (e.g.EnumName.value), not the deprecated directive (e.g.EnumName.value.@deprecated). - Added new attributes in order to provide enough context for a new “@graphql-inspector/patch” function to apply changes accurately.
- Added support for repeatable directives
- Includes all nested changes in
diffoutput when a new node is added. This can dramatically increase the number of changes listed which can be noisy, but it makes it possible for “@graphql-inspector/patch” to apply all changes from a schema. This can be optionally filtered using a newly exportedDiffRule.simplifyChangesrule.
For example, given an existing schema:
type User { id: ID! name: String! }And a diff schema:
type User { id: ID! name: String! address: Address } type Address { line1: String! line2: String! }Then previously the output would be:
[ { "criticality": { "level": "NON_BREAKING" }, "message": "Type 'Address' was added", "meta": { "addedTypeKind": "ObjectTypeDefinition", "addedTypeName": "Address" }, "path": "Address", "type": "TYPE_ADDED" }, { "criticality": { "level": "NON_BREAKING" }, "message": "Field 'address' was added to object type 'User'", "meta": { "addedFieldName": "address", "addedFieldReturnType": "Address", "typeName": "User", "typeType": "object type" }, "path": "User.address", "type": "FIELD_ADDED" } ]But now the output also includes the fields inside the new
Addresstype:[ { "criticality": { "level": "NON_BREAKING" }, "message": "Type 'Address' was added", "meta": { "addedTypeKind": "ObjectTypeDefinition", "addedTypeName": "Address" }, "path": "Address", "type": "TYPE_ADDED" }, { "criticality": { "level": "NON_BREAKING" }, "message": "Field 'line1' was added to object type 'Address'", "meta": { "addedFieldName": "line1", "addedFieldReturnType": "String!", "typeName": "Address", "typeType": "object type" }, "path": "Address.line1", "type": "FIELD_ADDED" }, { "criticality": { "level": "NON_BREAKING" }, "message": "Field 'line2' was added to object type 'Address'", "meta": { "addedFieldName": "line2", "addedFieldReturnType": "String!", "typeName": "Address", "typeType": "object type" }, "path": "Address.line2", "type": "FIELD_ADDED" }, { "criticality": { "level": "NON_BREAKING" }, "message": "Field 'address' was added to object type 'User'", "meta": { "addedFieldName": "address", "addedFieldReturnType": "Address", "typeName": "User", "typeType": "object type" }, "path": "User.address", "type": "FIELD_ADDED" } ]These additional changes can be filtered using a new rule:
import { diff, DiffRule } from '@graphql-inspector/core' const changes = await diff(a, b, [DiffRule.simplifyChanges])
Minor Changes
- #2900
2fc8b25Thanks @emileriksson! - Apollo Federation v2 support. Introduced built-in Federation v2 directives and a new CLI flag —federationV2 to enable processing schemas that use them.
6.4.1
Patch Changes
- #2908
4f1e1c1Thanks @adambenhassen! - fix payload missing directive change type
6.4.0
Minor Changes
- #2904
ad7e04bThanks @adambenhassen! - Escape single quotes in all enum descriptions and deprecation reasons
6.3.0
Minor Changes
-
#2906
2d22d32Thanks @adambenhassen! - add missing change detection of directive field usage and exports ‘directiveUsageFieldAddedFromMeta’ & ‘directiveUsageFieldRemovedFromMeta’ -
#2838
416a9ceThanks @egoodwinx! - Updated removing field message to contain more information on why its a breaking change such as if the field is a union or indirectly referenced.
6.2.1
Patch Changes
- #2831
5854b64Thanks @TuvalSimha! - Change CriticalityLevel to Dangerous when directive removed
6.2.0
Minor Changes
- #2827
60d674dThanks @TuvalSimha! - Added missing types to Change type and fix typo “DirectiveUsageInputObjectdRemovedChange” to “DirectiveUsageInputObjectRemovedChange”
6.1.0
Minor Changes
-
#2775
0e40ebdThanks @DanteUkraine! - Fix: coverage calculation improvements: Covered Queries & Covered Mutations & Covered Subscriptions -
#2773
6e3ccc9Thanks @TuvalSimha! - Fix exportChangeTypefrom core package.
Patch Changes
- #2765
27edee1Thanks @renovate! - dependencies updates:- Updated dependency
dependency-graph@1.0.0↗︎ (from0.11.0, independencies)
- Updated dependency
6.0.1
Patch Changes
- #2747
9c36138Thanks @TuvalSimha! - dependencies updates:- Updated dependency
object-inspect@1.13.1↗︎ (from1.12.3, independencies)
- Updated dependency
6.0.0
Major Changes
- #2719
50874f2Thanks @TuvalSimha! - Upgrade the Node version from 16 to 18, as the minimum required version is now 18. Additionally, ensure that GraphQL Yoga is upgraded to version 5.
5.1.0
Minor Changes
-
#2673
831703ccThanks @kamilkisiela! - Add metadata (with change field in it) to checkUsage function of ConsiderUsage rule -
#2667
06581e0dThanks @TuvalSimha! - Replace ChangeType enum with const strings
5.0.2
Patch Changes
-
#2638
533ebfd4Thanks @TuvalSimha! - dependencies updates:- Updated dependency
tslib@2.6.2↗︎ (from2.6.0, independencies)
- Updated dependency
-
#2638
533ebfd4Thanks @TuvalSimha! - Patch update - dependencies
5.0.1
Patch Changes
-
#2569
bed4c437Thanks @TuvalSimha! - dependencies updates:- Updated dependency
tslib@2.6.0↗︎ (from2.5.3, independencies)
- Updated dependency
-
#2569
bed4c437Thanks @TuvalSimha! - Update dependencies for all packages.
5.0.0
Major Changes
- #2510
7944118eThanks @TuvalSimha! - Update major dependcies & drop node 14
Patch Changes
-
#2510
7944118eThanks @TuvalSimha! - dependencies updates:- Updated dependency
tslib@2.5.3↗︎ (from2.5.0, independencies)
- Updated dependency
-
#2425
cc303a99Thanks @jirikuncar! - Fix typo for numFiledsCovered to numFieldsCovered
4.2.2
Patch Changes
- #2452
1b1b954cThanks @TuvalSimha! - Add a new stats display for coverage command + display new Total queries / mutations / Sub
4.2.1
Patch Changes
- #2461
53dae663Thanks @TuvalSimha! - Fix complexity importing for validate
4.2.0
Minor Changes
- #2210
1180f761Thanks @taitruong007! - Support validate by complexity score
4.1.1
Patch Changes
-
#2435
09214509Thanks @TuvalSimha! - dependencies updates:- Updated dependency
tslib@2.5.0↗︎ (from^2.0.0, independencies)
- Updated dependency
-
#2435
09214509Thanks @TuvalSimha! - Update dependencies
4.1.0
Minor Changes
-
#2392
3184249bThanks @n1ru4l! - Wrap string values in quotes, so they can be differentiated from types.- Input field 'Foo.b' default value changed from 'undefined' to 'Bbb' + Input field 'Foo.b' default value changed from 'undefined' to '"Bbb"' -
#2392
3184249bThanks @n1ru4l! - AddisSafeBasedOnUsagetoCriticalitytype. This value is set totruein case the criticality is set toCriticalityLevel.Dangerousbased on usage. This is helpful for statistics. -
#2392
3184249bThanks @n1ru4l! - include meta data in the changes that are machine processable. This is useful if you want to efficiently store the changes in some database and later-on reconstruct the full change objects.export type FieldDescriptionChangedChange = { type: ChangeType.FieldDescriptionChanged meta: { typeName: string fieldName: string oldDescription: string newDescription: string } }You can construct the full
Changeobject from thetypeandmetaproperties.import { ChangeType, fieldDescriptionChangedFromMeta } from '@graphql-inspector/core' console.log( fieldDescriptionChangedFromMeta({ type: ChangeType.FieldDescriptionChanged, meta: { typeName: 'Foo', fieldName: 'bar', oldDescription: 'This is the old description', newDescription: 'This is the new description' } }) )console.log output:
{ type: 'FIELD_DESCRIPTION_CHANGED', criticality: { level: 'NON_BREAKING' }, message: "Field 'Foo.bar' description changed from 'This is the old description' to 'This is the new description'", meta: { typeName: 'Foo', fieldName: 'bar', oldDescription: 'This is the old description', newDescription: 'This is the new description' }, path: 'Foo.bar' }
4.0.3
Patch Changes
- #2419
34f84e8fThanks @TuvalSimha! - Updatebobversion -> change the way we build the packages (Dist folder build now esm and cjs versions)
4.0.2
Patch Changes
- #2412
5b275450Thanks @dotansimha! - Bump all packages to fix issues with previous release
4.0.1
Patch Changes
-
#2393
c00cb09bThanks @TuvalSimha! - dependencies updates:- Updated dependency
graphql@^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0↗︎ (from^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0, inpeerDependencies)
- Updated dependency
-
#2404
948981efThanks @dotansimha! - dependencies updates:- Updated dependency
graphql@^14.0.0 || ^15.0.0 || ^16.0.0↗︎ (from^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0, inpeerDependencies)
- Updated dependency
4.0.0
Major Changes
3.5.1
Patch Changes
- #2302
dd840130Thanks @renovate! - dependencies updates:- Updated dependency
object-inspect@1.12.3↗︎ (from1.10.3, independencies)
- Updated dependency