@graphql-inspector/core
Version:
Tooling for GraphQL. Compare GraphQL Schemas, check documents, find breaking changes, find similar types.
114 lines (113 loc) • 5.14 kB
text/typescript
import { GraphQLInputField, GraphQLInputObjectType } from 'graphql';
import { Change, ChangeType, CriticalityLevel, InputFieldAddedChange, InputFieldDefaultValueChangedChange, InputFieldDescriptionAddedChange, InputFieldDescriptionChangedChange, InputFieldDescriptionRemovedChange, InputFieldRemovedChange, InputFieldTypeChangedChange } from './change.cjs';
export declare function inputFieldRemovedFromMeta(args: InputFieldRemovedChange): {
readonly type: "INPUT_FIELD_REMOVED";
readonly criticality: {
readonly level: CriticalityLevel.Breaking;
readonly reason: "Removing an input field will cause existing queries that use this input field to error.";
};
readonly message: string;
readonly meta: {
inputName: string;
removedFieldName: string;
isInputFieldDeprecated: boolean;
};
readonly path: string;
};
export declare function inputFieldRemoved(input: GraphQLInputObjectType, field: GraphQLInputField): Change<typeof ChangeType.InputFieldRemoved>;
export declare function buildInputFieldAddedMessage(args: InputFieldAddedChange['meta']): string;
export declare function inputFieldAddedFromMeta(args: InputFieldAddedChange): {
readonly type: "INPUT_FIELD_ADDED";
readonly criticality: {
level: CriticalityLevel;
reason?: undefined;
} | {
level: CriticalityLevel;
reason: string;
};
readonly message: string;
readonly meta: {
inputName: string;
addedInputFieldName: string;
isAddedInputFieldTypeNullable: boolean;
addedInputFieldType: string;
};
readonly path: string;
};
export declare function inputFieldAdded(input: GraphQLInputObjectType, field: GraphQLInputField): Change<typeof ChangeType.InputFieldAdded>;
export declare function inputFieldDescriptionAddedFromMeta(args: InputFieldDescriptionAddedChange): {
readonly type: "INPUT_FIELD_DESCRIPTION_ADDED";
readonly criticality: {
readonly level: CriticalityLevel.NonBreaking;
};
readonly message: string;
readonly meta: {
inputName: string;
inputFieldName: string;
addedInputFieldDescription: string;
};
readonly path: string;
};
export declare function inputFieldDescriptionAdded(type: GraphQLInputObjectType, field: GraphQLInputField): Change<typeof ChangeType.InputFieldDescriptionAdded>;
export declare function inputFieldDescriptionRemovedFromMeta(args: InputFieldDescriptionRemovedChange): {
readonly type: "INPUT_FIELD_DESCRIPTION_REMOVED";
readonly criticality: {
readonly level: CriticalityLevel.NonBreaking;
};
readonly message: string;
readonly meta: {
inputName: string;
inputFieldName: string;
removedDescription: string;
};
readonly path: string;
};
export declare function inputFieldDescriptionRemoved(type: GraphQLInputObjectType, field: GraphQLInputField): Change<typeof ChangeType.InputFieldDescriptionRemoved>;
export declare function inputFieldDescriptionChangedFromMeta(args: InputFieldDescriptionChangedChange): {
readonly type: "INPUT_FIELD_DESCRIPTION_CHANGED";
readonly criticality: {
readonly level: CriticalityLevel.NonBreaking;
};
readonly message: string;
readonly meta: {
inputName: string;
inputFieldName: string;
oldInputFieldDescription: string;
newInputFieldDescription: string;
};
readonly path: string;
};
export declare function inputFieldDescriptionChanged(input: GraphQLInputObjectType, oldField: GraphQLInputField, newField: GraphQLInputField): Change<typeof ChangeType.InputFieldDescriptionChanged>;
export declare function inputFieldDefaultValueChangedFromMeta(args: InputFieldDefaultValueChangedChange): {
readonly type: "INPUT_FIELD_DEFAULT_VALUE_CHANGED";
readonly criticality: {
readonly level: CriticalityLevel.Dangerous;
readonly reason: "Changing the default value for an argument may change the runtime behavior of a field if it was never provided.";
};
readonly message: string;
readonly meta: {
inputName: string;
inputFieldName: string;
oldDefaultValue?: string;
newDefaultValue?: string;
};
readonly path: string;
};
export declare function inputFieldDefaultValueChanged(input: GraphQLInputObjectType, oldField: GraphQLInputField, newField: GraphQLInputField): Change<typeof ChangeType.InputFieldDefaultValueChanged>;
export declare function inputFieldTypeChangedFromMeta(args: InputFieldTypeChangedChange): {
readonly type: "INPUT_FIELD_TYPE_CHANGED";
readonly criticality: {
level: CriticalityLevel;
reason: string;
};
readonly message: string;
readonly meta: {
inputName: string;
inputFieldName: string;
oldInputFieldType: string;
newInputFieldType: string;
isInputFieldTypeChangeSafe: boolean;
};
readonly path: string;
};
export declare function inputFieldTypeChanged(input: GraphQLInputObjectType, oldField: GraphQLInputField, newField: GraphQLInputField): Change<typeof ChangeType.InputFieldTypeChanged>;