@graphql-inspector/core
Advanced tools
Comparing version 6.2.0-alpha-20241112103543-a90e1d92dfaa16080e66c0c89e829a11fbd5b072 to 6.2.0-alpha-20241112112337-f1cd302bf97c02915ee2fd06d4ffc8254b71ae01
@@ -17,4 +17,2 @@ "use strict"; | ||
exports.directiveUsageFieldDefinitionRemovedFromMeta = directiveUsageFieldDefinitionRemovedFromMeta; | ||
exports.directiveUsageUnionMemberAddedFromMeta = directiveUsageUnionMemberAddedFromMeta; | ||
exports.directiveUsageUnionMemberRemovedFromMeta = directiveUsageUnionMemberRemovedFromMeta; | ||
exports.directiveUsageEnumValueAddedFromMeta = directiveUsageEnumValueAddedFromMeta; | ||
@@ -26,2 +24,4 @@ exports.directiveUsageEnumValueRemovedFromMeta = directiveUsageEnumValueRemovedFromMeta; | ||
exports.directiveUsageScalarRemovedFromMeta = directiveUsageScalarRemovedFromMeta; | ||
exports.directiveUsageUnionMemberAddedFromMeta = directiveUsageUnionMemberAddedFromMeta; | ||
exports.directiveUsageUnionMemberRemovedFromMeta = directiveUsageUnionMemberRemovedFromMeta; | ||
exports.directiveUsageAdded = directiveUsageAdded; | ||
@@ -149,3 +149,2 @@ exports.directiveUsageRemoved = directiveUsageRemoved; | ||
} | ||
// ChangeType.DirectiveUsageInputFieldDefinitionAdded | ||
function buildDirectiveUsageInputFieldDefinitionAddedMessage(args) { | ||
@@ -166,3 +165,2 @@ return `Directive '${args.addedDirectiveName}' was added to input field '${args.inputFieldName}' in input object '${args.inputObjectName}'`; | ||
} | ||
// ChangeType.DirectiveUsageInputFieldDefinitionRemoved | ||
function buildDirectiveUsageInputFieldDefinitionRemovedMessage(args) { | ||
@@ -217,3 +215,2 @@ return `Directive '${args.removedDirectiveName}' was removed from input field '${args.inputFieldName}' in input object '${args.inputObjectName}'`; | ||
} | ||
// ChangeType.DirectiveUsageEnumAdded | ||
function buildDirectiveUsageEnumAddedMessage(args) { | ||
@@ -234,3 +231,2 @@ return `Directive '${args.addedDirectiveName}' was added to enum '${args.enumName}'`; | ||
} | ||
// ChangeType.DirectiveUsageEnumRemoved | ||
function buildDirectiveUsageEnumRemovedMessage(args) { | ||
@@ -251,5 +247,4 @@ return `Directive '${args.removedDirectiveName}' was removed from enum '${args.enumName}'`; | ||
} | ||
// ChangeType.DirectiveUsageFieldDefinitionAdded | ||
function buildDirectiveUsageFieldDefinitionAddedMessage(args) { | ||
return `Directive '${args.addedDirectiveName}' was added to field '${args.fieldName}' in type '${args.typeName}'`; | ||
return `Directive '${args.addedDirectiveName}' was added to field '${args.typeName}.${args.fieldName}'`; | ||
} | ||
@@ -268,5 +263,4 @@ function directiveUsageFieldDefinitionAddedFromMeta(args) { | ||
} | ||
// ChangeType.DirectiveUsageFieldDefinitionRemoved | ||
function buildDirectiveUsageFieldDefinitionRemovedMessage(args) { | ||
return `Directive '${args.removedDirectiveName}' was removed from field '${args.fieldName}' in type '${args.typeName}'`; | ||
return `Directive '${args.removedDirectiveName}' was removed from field '${args.typeName}.${args.fieldName}'`; | ||
} | ||
@@ -285,43 +279,2 @@ function directiveUsageFieldDefinitionRemovedFromMeta(args) { | ||
} | ||
// ChangeType.DirectiveUsageUnionMemberAdded | ||
function buildDirectiveUsageUnionMemberAddedMessage(args) { | ||
return `Directive '${args.addedDirectiveName}' was added to union member '${args.addedUnionMemberTypeName}' in union '${args.unionName}'`; | ||
} | ||
function directiveUsageUnionMemberAddedFromMeta(args) { | ||
return { | ||
criticality: { | ||
level: addedSpecialDirective(args.meta.addedDirectiveName, change_js_1.CriticalityLevel.Dangerous), | ||
reason: `Directive '${args.meta.addedDirectiveName}' was added to union member '${args.meta.addedUnionMemberTypeName}'`, | ||
}, | ||
type: change_js_1.ChangeType.DirectiveUsageUnionMemberAdded, | ||
message: buildDirectiveUsageUnionMemberAddedMessage(args.meta), | ||
path: [ | ||
args.meta.unionName, | ||
args.meta.addedUnionMemberTypeName, | ||
args.meta.addedDirectiveName, | ||
].join('.'), | ||
meta: args.meta, | ||
}; | ||
} | ||
// ChangeType.DirectiveUsageUnionMemberRemoved | ||
function buildDirectiveUsageUnionMemberRemovedMessage(args) { | ||
return `Directive '${args.removedDirectiveName}' was removed from union member '${args.removedUnionMemberTypeName}' in union '${args.unionName}'`; | ||
} | ||
function directiveUsageUnionMemberRemovedFromMeta(args) { | ||
return { | ||
criticality: { | ||
level: removedSpecialDirective(args.meta.removedDirectiveName, change_js_1.CriticalityLevel.Dangerous), | ||
reason: `Directive '${args.meta.removedDirectiveName}' was removed from union member '${args.meta.removedUnionMemberTypeName}'`, | ||
}, | ||
type: change_js_1.ChangeType.DirectiveUsageUnionMemberRemoved, | ||
message: buildDirectiveUsageUnionMemberRemovedMessage(args.meta), | ||
path: [ | ||
args.meta.unionName, | ||
args.meta.removedUnionMemberTypeName, | ||
args.meta.removedDirectiveName, | ||
].join('.'), | ||
meta: args.meta, | ||
}; | ||
} | ||
// ChangeType.DirectiveUsageEnumValueAdded | ||
function buildDirectiveUsageEnumValueAddedMessage(args) { | ||
@@ -342,3 +295,2 @@ return `Directive '${args.addedDirectiveName}' was added to enum value '${args.enumName}.${args.enumValueName}'`; | ||
} | ||
// ChangeType.DirectiveUsageEnumValueRemoved | ||
function buildDirectiveUsageEnumValueRemovedMessage(args) { | ||
@@ -359,3 +311,2 @@ return `Directive '${args.removedDirectiveName}' was removed from enum value '${args.enumName}.${args.enumValueName}'`; | ||
} | ||
// ChangeType.DirectiveUsageSchemaAdded | ||
function buildDirectiveUsageSchemaAddedMessage(args) { | ||
@@ -376,3 +327,2 @@ return `Directive '${args.addedDirectiveName}' was added to schema '${args.schemaTypeName}'`; | ||
} | ||
// ChangeType.DirectiveUsageSchemaRemoved | ||
function buildDirectiveUsageSchemaRemovedMessage(args) { | ||
@@ -393,3 +343,2 @@ return `Directive '${args.removedDirectiveName}' was removed from schema '${args.schemaTypeName}'`; | ||
} | ||
// ChangeType.DirectiveUsageScalarAdded | ||
function buildDirectiveUsageScalarAddedMessage(args) { | ||
@@ -410,3 +359,2 @@ return `Directive '${args.addedDirectiveName}' was added to scalar '${args.scalarName}'`; | ||
} | ||
// ChangeType.DirectiveUsageScalarRemoved | ||
function buildDirectiveUsageScalarRemovedMessage(args) { | ||
@@ -427,2 +375,32 @@ return `Directive '${args.removedDirectiveName}' was removed from scalar '${args.scalarName}'`; | ||
} | ||
function buildDirectiveUsageUnionMemberAddedMessage(args) { | ||
return `Directive '${args.addedDirectiveName}' was added to union member '${args.unionName}'`; | ||
} | ||
function directiveUsageUnionMemberAddedFromMeta(args) { | ||
return { | ||
criticality: { | ||
level: addedSpecialDirective(args.meta.addedDirectiveName, change_js_1.CriticalityLevel.Dangerous), | ||
reason: `Directive '${args.meta.addedDirectiveName}' was added to union member '${args.meta.unionName}.${args.meta.addedUnionMemberTypeName}'`, | ||
}, | ||
type: change_js_1.ChangeType.DirectiveUsageUnionMemberAdded, | ||
message: buildDirectiveUsageUnionMemberAddedMessage(args.meta), | ||
path: [args.meta.unionName, args.meta.addedDirectiveName].join('.'), | ||
meta: args.meta, | ||
}; | ||
} | ||
function buildDirectiveUsageUnionMemberRemovedMessage(args) { | ||
return `Directive '${args.removedDirectiveName}' was removed from union member '${args.unionName}'`; | ||
} | ||
function directiveUsageUnionMemberRemovedFromMeta(args) { | ||
return { | ||
criticality: { | ||
level: removedSpecialDirective(args.meta.removedDirectiveName, change_js_1.CriticalityLevel.Dangerous), | ||
reason: `Directive '${args.meta.removedDirectiveName}' was removed from union member '${args.meta.unionName}.${args.meta.removedUnionMemberTypeName}'`, | ||
}, | ||
type: change_js_1.ChangeType.DirectiveUsageUnionMemberRemoved, | ||
message: buildDirectiveUsageUnionMemberRemovedMessage(args.meta), | ||
path: [args.meta.unionName, args.meta.removedDirectiveName].join('.'), | ||
meta: args.meta, | ||
}; | ||
} | ||
function directiveUsageAdded(kind, directive, payload) { | ||
@@ -455,3 +433,3 @@ if (isOfKind(kind, graphql_1.Kind.ARGUMENT, payload)) { | ||
addedDirectiveName: directive.name.value, | ||
addedInputFieldName: payload.getFields()[0].name, | ||
addedInputFieldName: directive.name.value, | ||
addedInputFieldType: payload.name, | ||
@@ -567,3 +545,3 @@ inputObjectName: payload.name, | ||
removedDirectiveName: directive.name.value, | ||
removedInputFieldName: payload.getFields()[0].name, | ||
removedInputFieldName: directive.name.value, | ||
removedInputFieldType: payload.name, | ||
@@ -570,0 +548,0 @@ inputObjectName: payload.name, |
@@ -121,3 +121,2 @@ import { Kind, } from 'graphql'; | ||
} | ||
// ChangeType.DirectiveUsageInputFieldDefinitionAdded | ||
function buildDirectiveUsageInputFieldDefinitionAddedMessage(args) { | ||
@@ -138,3 +137,2 @@ return `Directive '${args.addedDirectiveName}' was added to input field '${args.inputFieldName}' in input object '${args.inputObjectName}'`; | ||
} | ||
// ChangeType.DirectiveUsageInputFieldDefinitionRemoved | ||
function buildDirectiveUsageInputFieldDefinitionRemovedMessage(args) { | ||
@@ -189,3 +187,2 @@ return `Directive '${args.removedDirectiveName}' was removed from input field '${args.inputFieldName}' in input object '${args.inputObjectName}'`; | ||
} | ||
// ChangeType.DirectiveUsageEnumAdded | ||
function buildDirectiveUsageEnumAddedMessage(args) { | ||
@@ -206,3 +203,2 @@ return `Directive '${args.addedDirectiveName}' was added to enum '${args.enumName}'`; | ||
} | ||
// ChangeType.DirectiveUsageEnumRemoved | ||
function buildDirectiveUsageEnumRemovedMessage(args) { | ||
@@ -223,5 +219,4 @@ return `Directive '${args.removedDirectiveName}' was removed from enum '${args.enumName}'`; | ||
} | ||
// ChangeType.DirectiveUsageFieldDefinitionAdded | ||
function buildDirectiveUsageFieldDefinitionAddedMessage(args) { | ||
return `Directive '${args.addedDirectiveName}' was added to field '${args.fieldName}' in type '${args.typeName}'`; | ||
return `Directive '${args.addedDirectiveName}' was added to field '${args.typeName}.${args.fieldName}'`; | ||
} | ||
@@ -240,5 +235,4 @@ export function directiveUsageFieldDefinitionAddedFromMeta(args) { | ||
} | ||
// ChangeType.DirectiveUsageFieldDefinitionRemoved | ||
function buildDirectiveUsageFieldDefinitionRemovedMessage(args) { | ||
return `Directive '${args.removedDirectiveName}' was removed from field '${args.fieldName}' in type '${args.typeName}'`; | ||
return `Directive '${args.removedDirectiveName}' was removed from field '${args.typeName}.${args.fieldName}'`; | ||
} | ||
@@ -257,43 +251,2 @@ export function directiveUsageFieldDefinitionRemovedFromMeta(args) { | ||
} | ||
// ChangeType.DirectiveUsageUnionMemberAdded | ||
function buildDirectiveUsageUnionMemberAddedMessage(args) { | ||
return `Directive '${args.addedDirectiveName}' was added to union member '${args.addedUnionMemberTypeName}' in union '${args.unionName}'`; | ||
} | ||
export function directiveUsageUnionMemberAddedFromMeta(args) { | ||
return { | ||
criticality: { | ||
level: addedSpecialDirective(args.meta.addedDirectiveName, CriticalityLevel.Dangerous), | ||
reason: `Directive '${args.meta.addedDirectiveName}' was added to union member '${args.meta.addedUnionMemberTypeName}'`, | ||
}, | ||
type: ChangeType.DirectiveUsageUnionMemberAdded, | ||
message: buildDirectiveUsageUnionMemberAddedMessage(args.meta), | ||
path: [ | ||
args.meta.unionName, | ||
args.meta.addedUnionMemberTypeName, | ||
args.meta.addedDirectiveName, | ||
].join('.'), | ||
meta: args.meta, | ||
}; | ||
} | ||
// ChangeType.DirectiveUsageUnionMemberRemoved | ||
function buildDirectiveUsageUnionMemberRemovedMessage(args) { | ||
return `Directive '${args.removedDirectiveName}' was removed from union member '${args.removedUnionMemberTypeName}' in union '${args.unionName}'`; | ||
} | ||
export function directiveUsageUnionMemberRemovedFromMeta(args) { | ||
return { | ||
criticality: { | ||
level: removedSpecialDirective(args.meta.removedDirectiveName, CriticalityLevel.Dangerous), | ||
reason: `Directive '${args.meta.removedDirectiveName}' was removed from union member '${args.meta.removedUnionMemberTypeName}'`, | ||
}, | ||
type: ChangeType.DirectiveUsageUnionMemberRemoved, | ||
message: buildDirectiveUsageUnionMemberRemovedMessage(args.meta), | ||
path: [ | ||
args.meta.unionName, | ||
args.meta.removedUnionMemberTypeName, | ||
args.meta.removedDirectiveName, | ||
].join('.'), | ||
meta: args.meta, | ||
}; | ||
} | ||
// ChangeType.DirectiveUsageEnumValueAdded | ||
function buildDirectiveUsageEnumValueAddedMessage(args) { | ||
@@ -314,3 +267,2 @@ return `Directive '${args.addedDirectiveName}' was added to enum value '${args.enumName}.${args.enumValueName}'`; | ||
} | ||
// ChangeType.DirectiveUsageEnumValueRemoved | ||
function buildDirectiveUsageEnumValueRemovedMessage(args) { | ||
@@ -331,3 +283,2 @@ return `Directive '${args.removedDirectiveName}' was removed from enum value '${args.enumName}.${args.enumValueName}'`; | ||
} | ||
// ChangeType.DirectiveUsageSchemaAdded | ||
function buildDirectiveUsageSchemaAddedMessage(args) { | ||
@@ -348,3 +299,2 @@ return `Directive '${args.addedDirectiveName}' was added to schema '${args.schemaTypeName}'`; | ||
} | ||
// ChangeType.DirectiveUsageSchemaRemoved | ||
function buildDirectiveUsageSchemaRemovedMessage(args) { | ||
@@ -365,3 +315,2 @@ return `Directive '${args.removedDirectiveName}' was removed from schema '${args.schemaTypeName}'`; | ||
} | ||
// ChangeType.DirectiveUsageScalarAdded | ||
function buildDirectiveUsageScalarAddedMessage(args) { | ||
@@ -382,3 +331,2 @@ return `Directive '${args.addedDirectiveName}' was added to scalar '${args.scalarName}'`; | ||
} | ||
// ChangeType.DirectiveUsageScalarRemoved | ||
function buildDirectiveUsageScalarRemovedMessage(args) { | ||
@@ -399,2 +347,32 @@ return `Directive '${args.removedDirectiveName}' was removed from scalar '${args.scalarName}'`; | ||
} | ||
function buildDirectiveUsageUnionMemberAddedMessage(args) { | ||
return `Directive '${args.addedDirectiveName}' was added to union member '${args.unionName}'`; | ||
} | ||
export function directiveUsageUnionMemberAddedFromMeta(args) { | ||
return { | ||
criticality: { | ||
level: addedSpecialDirective(args.meta.addedDirectiveName, CriticalityLevel.Dangerous), | ||
reason: `Directive '${args.meta.addedDirectiveName}' was added to union member '${args.meta.unionName}.${args.meta.addedUnionMemberTypeName}'`, | ||
}, | ||
type: ChangeType.DirectiveUsageUnionMemberAdded, | ||
message: buildDirectiveUsageUnionMemberAddedMessage(args.meta), | ||
path: [args.meta.unionName, args.meta.addedDirectiveName].join('.'), | ||
meta: args.meta, | ||
}; | ||
} | ||
function buildDirectiveUsageUnionMemberRemovedMessage(args) { | ||
return `Directive '${args.removedDirectiveName}' was removed from union member '${args.unionName}'`; | ||
} | ||
export function directiveUsageUnionMemberRemovedFromMeta(args) { | ||
return { | ||
criticality: { | ||
level: removedSpecialDirective(args.meta.removedDirectiveName, CriticalityLevel.Dangerous), | ||
reason: `Directive '${args.meta.removedDirectiveName}' was removed from union member '${args.meta.unionName}.${args.meta.removedUnionMemberTypeName}'`, | ||
}, | ||
type: ChangeType.DirectiveUsageUnionMemberRemoved, | ||
message: buildDirectiveUsageUnionMemberRemovedMessage(args.meta), | ||
path: [args.meta.unionName, args.meta.removedDirectiveName].join('.'), | ||
meta: args.meta, | ||
}; | ||
} | ||
export function directiveUsageAdded(kind, directive, payload) { | ||
@@ -427,3 +405,3 @@ if (isOfKind(kind, Kind.ARGUMENT, payload)) { | ||
addedDirectiveName: directive.name.value, | ||
addedInputFieldName: payload.getFields()[0].name, | ||
addedInputFieldName: directive.name.value, | ||
addedInputFieldType: payload.name, | ||
@@ -539,3 +517,3 @@ inputObjectName: payload.name, | ||
removedDirectiveName: directive.name.value, | ||
removedInputFieldName: payload.getFields()[0].name, | ||
removedInputFieldName: directive.name.value, | ||
removedInputFieldType: payload.name, | ||
@@ -542,0 +520,0 @@ inputObjectName: payload.name, |
{ | ||
"name": "@graphql-inspector/core", | ||
"version": "6.2.0-alpha-20241112103543-a90e1d92dfaa16080e66c0c89e829a11fbd5b072", | ||
"version": "6.2.0-alpha-20241112112337-f1cd302bf97c02915ee2fd06d4ffc8254b71ae01", | ||
"description": "Tooling for GraphQL. Compare GraphQL Schemas, check documents, find breaking changes, find similar types.", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
@@ -258,30 +258,2 @@ import { ConstDirectiveNode, GraphQLArgument, GraphQLEnumType, GraphQLEnumValue, GraphQLField, GraphQLInputField, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLObjectType, GraphQLScalarType, GraphQLSchema, GraphQLUnionType, Kind } from 'graphql'; | ||
}; | ||
export declare function directiveUsageUnionMemberAddedFromMeta(args: DirectiveUsageUnionMemberAddedChange): { | ||
readonly criticality: { | ||
readonly level: CriticalityLevel; | ||
readonly reason: `Directive '${string}' was added to union member '${string}'`; | ||
}; | ||
readonly type: "DIRECTIVE_USAGE_UNION_MEMBER_ADDED"; | ||
readonly message: string; | ||
readonly path: string; | ||
readonly meta: { | ||
unionName: string; | ||
addedUnionMemberTypeName: string; | ||
addedDirectiveName: string; | ||
}; | ||
}; | ||
export declare function directiveUsageUnionMemberRemovedFromMeta(args: DirectiveUsageUnionMemberRemovedChange): { | ||
readonly criticality: { | ||
readonly level: CriticalityLevel; | ||
readonly reason: `Directive '${string}' was removed from union member '${string}'`; | ||
}; | ||
readonly type: "DIRECTIVE_USAGE_UNION_MEMBER_REMOVED"; | ||
readonly message: string; | ||
readonly path: string; | ||
readonly meta: { | ||
unionName: string; | ||
removedUnionMemberTypeName: string; | ||
removedDirectiveName: string; | ||
}; | ||
}; | ||
export declare function directiveUsageEnumValueAddedFromMeta(args: DirectiveUsageEnumValueAddedChange): { | ||
@@ -367,4 +339,32 @@ readonly criticality: { | ||
}; | ||
export declare function directiveUsageUnionMemberAddedFromMeta(args: DirectiveUsageUnionMemberAddedChange): { | ||
readonly criticality: { | ||
readonly level: CriticalityLevel; | ||
readonly reason: `Directive '${string}' was added to union member '${string}.${string}'`; | ||
}; | ||
readonly type: "DIRECTIVE_USAGE_UNION_MEMBER_ADDED"; | ||
readonly message: string; | ||
readonly path: string; | ||
readonly meta: { | ||
unionName: string; | ||
addedUnionMemberTypeName: string; | ||
addedDirectiveName: string; | ||
}; | ||
}; | ||
export declare function directiveUsageUnionMemberRemovedFromMeta(args: DirectiveUsageUnionMemberRemovedChange): { | ||
readonly criticality: { | ||
readonly level: CriticalityLevel; | ||
readonly reason: `Directive '${string}' was removed from union member '${string}.${string}'`; | ||
}; | ||
readonly type: "DIRECTIVE_USAGE_UNION_MEMBER_REMOVED"; | ||
readonly message: string; | ||
readonly path: string; | ||
readonly meta: { | ||
unionName: string; | ||
removedUnionMemberTypeName: string; | ||
removedDirectiveName: string; | ||
}; | ||
}; | ||
export declare function directiveUsageAdded<K extends keyof KindToPayload>(kind: K, directive: ConstDirectiveNode, payload: KindToPayload[K]['input']): Change; | ||
export declare function directiveUsageRemoved<K extends keyof KindToPayload>(kind: K, directive: ConstDirectiveNode, payload: KindToPayload[K]['input']): Change; | ||
export {}; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
564374
10310