UNPKG

@graphql-inspector/core

Version:

Tooling for GraphQL. Compare GraphQL Schemas, check documents, find breaking changes, find similar types.

191 lines (190 loc) • 8.87 kB
import { GraphQLArgument, GraphQLField, GraphQLInterfaceType, GraphQLObjectType } from 'graphql'; import { Change, ChangeType, CriticalityLevel, FieldAddedChange, FieldArgumentAddedChange, FieldArgumentRemovedChange, FieldDeprecationAddedChange, FieldDeprecationReasonAddedChange, FieldDeprecationReasonChangedChange, FieldDeprecationReasonRemovedChange, FieldDeprecationRemovedChange, FieldDescriptionAddedChange, FieldDescriptionChangedChange, FieldDescriptionRemovedChange, FieldRemovedChange, FieldTypeChangedChange } from './change.js'; export declare function fieldRemovedFromMeta(args: FieldRemovedChange): { readonly type: "FIELD_REMOVED"; readonly criticality: { readonly level: CriticalityLevel.Breaking; readonly reason: "Removing a deprecated field is a breaking change. Before removing it, you may want to look at the field's usage to see the impact of removing the field." | "Removing a field is a breaking change. It is preferable to deprecate the field before removing it."; }; readonly message: string; readonly meta: { typeName: string; removedFieldName: string; isRemovedFieldDeprecated: boolean; typeType: string; }; readonly path: string; }; export declare function fieldRemoved(type: GraphQLObjectType | GraphQLInterfaceType, field: GraphQLField<any, any, any>): Change<typeof ChangeType.FieldRemoved>; export declare function fieldAddedFromMeta(args: FieldAddedChange): { readonly type: "FIELD_ADDED"; readonly criticality: { readonly level: CriticalityLevel.NonBreaking; }; readonly message: string; readonly meta: { typeName: string; addedFieldName: string; typeType: string; }; readonly path: string; }; export declare function fieldAdded(type: GraphQLObjectType | GraphQLInterfaceType, field: GraphQLField<any, any, any>): Change<typeof ChangeType.FieldAdded>; export declare function fieldDescriptionChangedFromMeta(args: FieldDescriptionChangedChange): { readonly type: "FIELD_DESCRIPTION_CHANGED"; readonly criticality: { readonly level: CriticalityLevel.NonBreaking; }; readonly message: string; readonly meta: { typeName: string; fieldName: string; oldDescription: string; newDescription: string; }; readonly path: string; }; export declare function fieldDescriptionChanged(type: GraphQLObjectType | GraphQLInterfaceType, oldField: GraphQLField<any, any>, newField: GraphQLField<any, any>): Change<typeof ChangeType.FieldDescriptionChanged>; export declare function fieldDescriptionAddedFromMeta(args: FieldDescriptionAddedChange): { readonly type: "FIELD_DESCRIPTION_ADDED"; readonly criticality: { readonly level: CriticalityLevel.NonBreaking; }; readonly message: string; readonly meta: { typeName: string; fieldName: string; addedDescription: string; }; readonly path: string; }; export declare function fieldDescriptionAdded(type: GraphQLObjectType | GraphQLInterfaceType, field: GraphQLField<any, any>): Change<typeof ChangeType.FieldDescriptionAdded>; export declare function fieldDescriptionRemovedFromMeta(args: FieldDescriptionRemovedChange): { readonly type: "FIELD_DESCRIPTION_REMOVED"; readonly criticality: { readonly level: CriticalityLevel.NonBreaking; }; readonly message: string; readonly meta: { typeName: string; fieldName: string; }; readonly path: string; }; export declare function fieldDescriptionRemoved(type: GraphQLObjectType | GraphQLInterfaceType, field: GraphQLField<any, any>): Change<typeof ChangeType.FieldDescriptionRemoved>; export declare function fieldDeprecationAddedFromMeta(args: FieldDeprecationAddedChange): { readonly type: "FIELD_DEPRECATION_ADDED"; readonly criticality: { readonly level: CriticalityLevel.NonBreaking; }; readonly message: string; readonly meta: { typeName: string; fieldName: string; }; readonly path: string; }; export declare function fieldDeprecationAdded(type: GraphQLObjectType | GraphQLInterfaceType, field: GraphQLField<any, any>): Change<typeof ChangeType.FieldDeprecationAdded>; export declare function fieldDeprecationRemovedFromMeta(args: FieldDeprecationRemovedChange): { readonly type: "FIELD_DEPRECATION_REMOVED"; readonly criticality: { readonly level: CriticalityLevel.Dangerous; }; readonly message: `Field '${string}.${string}' is no longer deprecated`; readonly meta: { typeName: string; fieldName: string; }; readonly path: string; }; export declare function fieldDeprecationRemoved(type: GraphQLObjectType | GraphQLInterfaceType, field: GraphQLField<any, any>): Change<typeof ChangeType.FieldDeprecationRemoved>; export declare function fieldDeprecationReasonChangedFromMeta(args: FieldDeprecationReasonChangedChange): { readonly type: "FIELD_DEPRECATION_REASON_CHANGED"; readonly criticality: { readonly level: CriticalityLevel.NonBreaking; }; readonly message: string; readonly meta: { typeName: string; fieldName: string; oldDeprecationReason: string; newDeprecationReason: string; }; readonly path: string; }; export declare function fieldDeprecationReasonChanged(type: GraphQLObjectType | GraphQLInterfaceType, oldField: GraphQLField<any, any>, newField: GraphQLField<any, any>): Change<typeof ChangeType.FieldDeprecationReasonChanged>; export declare function fieldDeprecationReasonAddedFromMeta(args: FieldDeprecationReasonAddedChange): { readonly type: "FIELD_DEPRECATION_REASON_ADDED"; readonly criticality: { readonly level: CriticalityLevel.NonBreaking; }; readonly message: string; readonly meta: { typeName: string; fieldName: string; addedDeprecationReason: string; }; readonly path: string; }; export declare function fieldDeprecationReasonAdded(type: GraphQLObjectType | GraphQLInterfaceType, field: GraphQLField<any, any>): Change<typeof ChangeType.FieldDeprecationReasonAdded>; export declare function fieldDeprecationReasonRemovedFromMeta(args: FieldDeprecationReasonRemovedChange): { readonly type: "FIELD_DEPRECATION_REASON_REMOVED"; readonly criticality: { readonly level: CriticalityLevel.NonBreaking; }; readonly message: `Deprecation reason was removed from field '${string}.${string}'`; readonly meta: { typeName: string; fieldName: string; }; readonly path: string; }; export declare function fieldDeprecationReasonRemoved(type: GraphQLObjectType | GraphQLInterfaceType, field: GraphQLField<any, any>): Change<typeof ChangeType.FieldDeprecationReasonRemoved>; export declare function fieldTypeChangedFromMeta(args: FieldTypeChangedChange): { readonly type: "FIELD_TYPE_CHANGED"; readonly criticality: { readonly level: CriticalityLevel.Breaking | CriticalityLevel.NonBreaking; }; readonly message: string; readonly meta: { typeName: string; fieldName: string; oldFieldType: string; newFieldType: string; isSafeFieldTypeChange: boolean; }; readonly path: string; }; export declare function fieldTypeChanged(type: GraphQLObjectType | GraphQLInterfaceType, oldField: GraphQLField<any, any, any>, newField: GraphQLField<any, any, any>): Change<typeof ChangeType.FieldTypeChanged>; export declare function fieldArgumentAddedFromMeta(args: FieldArgumentAddedChange): { readonly type: "FIELD_ARGUMENT_ADDED"; readonly criticality: { readonly level: CriticalityLevel.Breaking | CriticalityLevel.Dangerous; }; readonly message: string; readonly meta: { typeName: string; fieldName: string; addedArgumentName: string; addedArgumentType: string; hasDefaultValue: boolean; isAddedFieldArgumentBreaking: boolean; }; readonly path: string; }; export declare function fieldArgumentAdded(type: GraphQLObjectType | GraphQLInterfaceType, field: GraphQLField<any, any, any>, arg: GraphQLArgument): Change<typeof ChangeType.FieldArgumentAdded>; export declare function fieldArgumentRemovedFromMeta(args: FieldArgumentRemovedChange): { readonly type: "FIELD_ARGUMENT_REMOVED"; readonly criticality: { readonly level: CriticalityLevel.Breaking; }; readonly message: string; readonly meta: { typeName: string; fieldName: string; removedFieldArgumentName: string; removedFieldType: string; }; readonly path: string; }; export declare function fieldArgumentRemoved(type: GraphQLObjectType | GraphQLInterfaceType, field: GraphQLField<any, any, any>, arg: GraphQLArgument): Change<typeof ChangeType.FieldArgumentRemoved>;