findBreakingChanges.d.ts 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import { GraphQLDirective } from '../type/directives';
  2. import { GraphQLSchema } from '../type/schema';
  3. import { DirectiveLocationEnum } from '../language/directiveLocation';
  4. export const BreakingChangeType: _BreakingChangeType;
  5. // @internal
  6. type _BreakingChangeType = {
  7. TYPE_REMOVED: 'TYPE_REMOVED';
  8. TYPE_CHANGED_KIND: 'TYPE_CHANGED_KIND';
  9. TYPE_REMOVED_FROM_UNION: 'TYPE_REMOVED_FROM_UNION';
  10. VALUE_REMOVED_FROM_ENUM: 'VALUE_REMOVED_FROM_ENUM';
  11. REQUIRED_INPUT_FIELD_ADDED: 'REQUIRED_INPUT_FIELD_ADDED';
  12. INTERFACE_REMOVED_FROM_OBJECT: 'INTERFACE_REMOVED_FROM_OBJECT';
  13. FIELD_REMOVED: 'FIELD_REMOVED';
  14. FIELD_CHANGED_KIND: 'FIELD_CHANGED_KIND';
  15. REQUIRED_ARG_ADDED: 'REQUIRED_ARG_ADDED';
  16. ARG_REMOVED: 'ARG_REMOVED';
  17. ARG_CHANGED_KIND: 'ARG_CHANGED_KIND';
  18. DIRECTIVE_REMOVED: 'DIRECTIVE_REMOVED';
  19. DIRECTIVE_ARG_REMOVED: 'DIRECTIVE_ARG_REMOVED';
  20. REQUIRED_DIRECTIVE_ARG_ADDED: 'REQUIRED_DIRECTIVE_ARG_ADDED';
  21. DIRECTIVE_LOCATION_REMOVED: 'DIRECTIVE_LOCATION_REMOVED';
  22. };
  23. export const DangerousChangeType: _DangerousChangeType;
  24. // @internal
  25. type _DangerousChangeType = {
  26. VALUE_ADDED_TO_ENUM: 'VALUE_ADDED_TO_ENUM';
  27. TYPE_ADDED_TO_UNION: 'TYPE_ADDED_TO_UNION';
  28. OPTIONAL_INPUT_FIELD_ADDED: 'OPTIONAL_INPUT_FIELD_ADDED';
  29. OPTIONAL_ARG_ADDED: 'OPTIONAL_ARG_ADDED';
  30. INTERFACE_ADDED_TO_OBJECT: 'INTERFACE_ADDED_TO_OBJECT';
  31. ARG_DEFAULT_VALUE_CHANGE: 'ARG_DEFAULT_VALUE_CHANGE';
  32. };
  33. export interface BreakingChange {
  34. type: keyof _BreakingChangeType;
  35. description: string;
  36. }
  37. export interface DangerousChange {
  38. type: keyof _DangerousChangeType;
  39. description: string;
  40. }
  41. /**
  42. * Given two schemas, returns an Array containing descriptions of all the types
  43. * of breaking changes covered by the other functions down below.
  44. */
  45. export function findBreakingChanges(
  46. oldSchema: GraphQLSchema,
  47. newSchema: GraphQLSchema,
  48. ): Array<BreakingChange>;
  49. /**
  50. * Given two schemas, returns an Array containing descriptions of all the types
  51. * of potentially dangerous changes covered by the other functions down below.
  52. */
  53. export function findDangerousChanges(
  54. oldSchema: GraphQLSchema,
  55. newSchema: GraphQLSchema,
  56. ): Array<DangerousChange>;