findBreakingChanges.d.ts 1.9 KB

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