Skip to content

Latest commit

 

History

History
729 lines (323 loc) · 13.2 KB

BreakingChangesFinder.md

File metadata and controls

729 lines (323 loc) · 13.2 KB

BreakingChangesFinder

  • Full name: \GraphQL\Utils\BreakingChangesFinder

Constants

Constant Visibility Type Value
BREAKING_CHANGE_FIELD_CHANGED_KIND public 'FIELD_CHANGED_KIND'
BREAKING_CHANGE_FIELD_REMOVED public 'FIELD_REMOVED'
BREAKING_CHANGE_TYPE_CHANGED_KIND public 'TYPE_CHANGED_KIND'
BREAKING_CHANGE_TYPE_REMOVED public 'TYPE_REMOVED'
BREAKING_CHANGE_TYPE_REMOVED_FROM_UNION public 'TYPE_REMOVED_FROM_UNION'
BREAKING_CHANGE_VALUE_REMOVED_FROM_ENUM public 'VALUE_REMOVED_FROM_ENUM'
BREAKING_CHANGE_ARG_REMOVED public 'ARG_REMOVED'
BREAKING_CHANGE_ARG_CHANGED_KIND public 'ARG_CHANGED_KIND'
BREAKING_CHANGE_REQUIRED_ARG_ADDED public 'REQUIRED_ARG_ADDED'
BREAKING_CHANGE_REQUIRED_INPUT_FIELD_ADDED public 'REQUIRED_INPUT_FIELD_ADDED'
BREAKING_CHANGE_IMPLEMENTED_INTERFACE_REMOVED public 'IMPLEMENTED_INTERFACE_REMOVED'
BREAKING_CHANGE_DIRECTIVE_REMOVED public 'DIRECTIVE_REMOVED'
BREAKING_CHANGE_DIRECTIVE_ARG_REMOVED public 'DIRECTIVE_ARG_REMOVED'
BREAKING_CHANGE_DIRECTIVE_LOCATION_REMOVED public 'DIRECTIVE_LOCATION_REMOVED'
BREAKING_CHANGE_REQUIRED_DIRECTIVE_ARG_ADDED public 'REQUIRED_DIRECTIVE_ARG_ADDED'
DANGEROUS_CHANGE_ARG_DEFAULT_VALUE_CHANGED public 'ARG_DEFAULT_VALUE_CHANGE'
DANGEROUS_CHANGE_VALUE_ADDED_TO_ENUM public 'VALUE_ADDED_TO_ENUM'
DANGEROUS_CHANGE_IMPLEMENTED_INTERFACE_ADDED public 'IMPLEMENTED_INTERFACE_ADDED'
DANGEROUS_CHANGE_TYPE_ADDED_TO_UNION public 'TYPE_ADDED_TO_UNION'
DANGEROUS_CHANGE_OPTIONAL_INPUT_FIELD_ADDED public 'OPTIONAL_INPUT_FIELD_ADDED'
DANGEROUS_CHANGE_OPTIONAL_ARG_ADDED public 'OPTIONAL_ARG_ADDED'
BREAKING_CHANGE_INTERFACE_REMOVED_FROM_OBJECT public 'IMPLEMENTED_INTERFACE_REMOVED'
DANGEROUS_CHANGE_INTERFACE_ADDED_TO_OBJECT public 'IMPLEMENTED_INTERFACE_ADDED'

Methods

findBreakingChanges

Given two schemas, returns an Array containing descriptions of all the types of breaking changes covered by the other functions down below.

public static findBreakingChanges(\GraphQL\Type\Schema $oldSchema, \GraphQL\Type\Schema $newSchema): string[][]
  • This method is static.

Parameters:

Parameter Type Description
$oldSchema \GraphQL\Type\Schema
$newSchema \GraphQL\Type\Schema

findRemovedTypes

Given two schemas, returns an Array containing descriptions of any breaking changes in the newSchema related to removing an entire type.

public static findRemovedTypes(\GraphQL\Type\Schema $oldSchema, \GraphQL\Type\Schema $newSchema): string[][]
  • This method is static.

Parameters:

Parameter Type Description
$oldSchema \GraphQL\Type\Schema
$newSchema \GraphQL\Type\Schema

findTypesThatChangedKind

Given two schemas, returns an Array containing descriptions of any breaking changes in the newSchema related to changing the type of a type.

public static findTypesThatChangedKind(\GraphQL\Type\Schema $schemaA, \GraphQL\Type\Schema $schemaB): string[][]
  • This method is static.

Parameters:

Parameter Type Description
$schemaA \GraphQL\Type\Schema
$schemaB \GraphQL\Type\Schema

typeKindName

private static typeKindName(\GraphQL\Type\Definition\Type $type): string
  • This method is static.

Parameters:

Parameter Type Description
$type \GraphQL\Type\Definition\Type

findFieldsThatChangedTypeOnObjectOrInterfaceTypes

public static findFieldsThatChangedTypeOnObjectOrInterfaceTypes(\GraphQL\Type\Schema $oldSchema, \GraphQL\Type\Schema $newSchema): string[][]
  • This method is static.

Parameters:

Parameter Type Description
$oldSchema \GraphQL\Type\Schema
$newSchema \GraphQL\Type\Schema

isChangeSafeForObjectOrInterfaceField

private static isChangeSafeForObjectOrInterfaceField(\GraphQL\Type\Definition\Type $oldType, \GraphQL\Type\Definition\Type $newType): bool
  • This method is static.

Parameters:

Parameter Type Description
$oldType \GraphQL\Type\Definition\Type
$newType \GraphQL\Type\Definition\Type

findFieldsThatChangedTypeOnInputObjectTypes

public static findFieldsThatChangedTypeOnInputObjectTypes(\GraphQL\Type\Schema $oldSchema, \GraphQL\Type\Schema $newSchema): array<string,array<int,array<string,string>>>
  • This method is static.

Parameters:

Parameter Type Description
$oldSchema \GraphQL\Type\Schema
$newSchema \GraphQL\Type\Schema

isChangeSafeForInputObjectFieldOrFieldArg

private static isChangeSafeForInputObjectFieldOrFieldArg(\GraphQL\Type\Definition\Type $oldType, \GraphQL\Type\Definition\Type $newType): bool
  • This method is static.

Parameters:

Parameter Type Description
$oldType \GraphQL\Type\Definition\Type
$newType \GraphQL\Type\Definition\Type

findTypesRemovedFromUnions

Given two schemas, returns an Array containing descriptions of any breaking changes in the newSchema related to removing types from a union type.

public static findTypesRemovedFromUnions(\GraphQL\Type\Schema $oldSchema, \GraphQL\Type\Schema $newSchema): string[][]
  • This method is static.

Parameters:

Parameter Type Description
$oldSchema \GraphQL\Type\Schema
$newSchema \GraphQL\Type\Schema

findValuesRemovedFromEnums

Given two schemas, returns an Array containing descriptions of any breaking changes in the newSchema related to removing values from an enum type.

public static findValuesRemovedFromEnums(\GraphQL\Type\Schema $oldSchema, \GraphQL\Type\Schema $newSchema): string[][]
  • This method is static.

Parameters:

Parameter Type Description
$oldSchema \GraphQL\Type\Schema
$newSchema \GraphQL\Type\Schema

findArgChanges

Given two schemas, returns an Array containing descriptions of any breaking or dangerous changes in the newSchema related to arguments (such as removal or change of type of an argument, or a change in an argument's default value).

public static findArgChanges(\GraphQL\Type\Schema $oldSchema, \GraphQL\Type\Schema $newSchema): array<string,array<int,array<string,string>>>
  • This method is static.

Parameters:

Parameter Type Description
$oldSchema \GraphQL\Type\Schema
$newSchema \GraphQL\Type\Schema

findInterfacesRemovedFromObjectTypes

public static findInterfacesRemovedFromObjectTypes(\GraphQL\Type\Schema $oldSchema, \GraphQL\Type\Schema $newSchema): string[][]
  • This method is static.

Parameters:

Parameter Type Description
$oldSchema \GraphQL\Type\Schema
$newSchema \GraphQL\Type\Schema

findRemovedDirectives

public static findRemovedDirectives(\GraphQL\Type\Schema $oldSchema, \GraphQL\Type\Schema $newSchema): string[][]
  • This method is static.

Parameters:

Parameter Type Description
$oldSchema \GraphQL\Type\Schema
$newSchema \GraphQL\Type\Schema

getDirectiveMapForSchema

private static getDirectiveMapForSchema(\GraphQL\Type\Schema $schema): mixed
  • This method is static.

Parameters:

Parameter Type Description
$schema \GraphQL\Type\Schema

findRemovedDirectiveArgs

public static findRemovedDirectiveArgs(\GraphQL\Type\Schema $oldSchema, \GraphQL\Type\Schema $newSchema): mixed
  • This method is static.

Parameters:

Parameter Type Description
$oldSchema \GraphQL\Type\Schema
$newSchema \GraphQL\Type\Schema

findRemovedArgsForDirectives

public static findRemovedArgsForDirectives(\GraphQL\Type\Definition\Directive $oldDirective, \GraphQL\Type\Definition\Directive $newDirective): mixed
  • This method is static.

Parameters:

Parameter Type Description
$oldDirective \GraphQL\Type\Definition\Directive
$newDirective \GraphQL\Type\Definition\Directive

getArgumentMapForDirective

private static getArgumentMapForDirective(\GraphQL\Type\Definition\Directive $directive): mixed
  • This method is static.

Parameters:

Parameter Type Description
$directive \GraphQL\Type\Definition\Directive

findAddedNonNullDirectiveArgs

public static findAddedNonNullDirectiveArgs(\GraphQL\Type\Schema $oldSchema, \GraphQL\Type\Schema $newSchema): mixed
  • This method is static.

Parameters:

Parameter Type Description
$oldSchema \GraphQL\Type\Schema
$newSchema \GraphQL\Type\Schema

findAddedArgsForDirective

public static findAddedArgsForDirective(\GraphQL\Type\Definition\Directive $oldDirective, \GraphQL\Type\Definition\Directive $newDirective): \GraphQL\Type\Definition\FieldArgument[]
  • This method is static.

Parameters:

Parameter Type Description
$oldDirective \GraphQL\Type\Definition\Directive
$newDirective \GraphQL\Type\Definition\Directive

findRemovedDirectiveLocations

public static findRemovedDirectiveLocations(\GraphQL\Type\Schema $oldSchema, \GraphQL\Type\Schema $newSchema): string[][]
  • This method is static.

Parameters:

Parameter Type Description
$oldSchema \GraphQL\Type\Schema
$newSchema \GraphQL\Type\Schema

findRemovedLocationsForDirective

public static findRemovedLocationsForDirective(\GraphQL\Type\Definition\Directive $oldDirective, \GraphQL\Type\Definition\Directive $newDirective): mixed
  • This method is static.

Parameters:

Parameter Type Description
$oldDirective \GraphQL\Type\Definition\Directive
$newDirective \GraphQL\Type\Definition\Directive

findDangerousChanges

Given two schemas, returns an Array containing descriptions of all the types of potentially dangerous changes covered by the other functions down below.

public static findDangerousChanges(\GraphQL\Type\Schema $oldSchema, \GraphQL\Type\Schema $newSchema): string[][]
  • This method is static.

Parameters:

Parameter Type Description
$oldSchema \GraphQL\Type\Schema
$newSchema \GraphQL\Type\Schema

findValuesAddedToEnums

Given two schemas, returns an Array containing descriptions of any dangerous changes in the newSchema related to adding values to an enum type.

public static findValuesAddedToEnums(\GraphQL\Type\Schema $oldSchema, \GraphQL\Type\Schema $newSchema): string[][]
  • This method is static.

Parameters:

Parameter Type Description
$oldSchema \GraphQL\Type\Schema
$newSchema \GraphQL\Type\Schema

findInterfacesAddedToObjectTypes

public static findInterfacesAddedToObjectTypes(\GraphQL\Type\Schema $oldSchema, \GraphQL\Type\Schema $newSchema): string[][]
  • This method is static.

Parameters:

Parameter Type Description
$oldSchema \GraphQL\Type\Schema
$newSchema \GraphQL\Type\Schema

findTypesAddedToUnions

Given two schemas, returns an Array containing descriptions of any dangerous changes in the newSchema related to adding types to a union type.

public static findTypesAddedToUnions(\GraphQL\Type\Schema $oldSchema, \GraphQL\Type\Schema $newSchema): string[][]
  • This method is static.

Parameters:

Parameter Type Description
$oldSchema \GraphQL\Type\Schema
$newSchema \GraphQL\Type\Schema