function findTypesRemovedFromUnions(oldSchema, newSchema) {
  var oldTypeMap = oldSchema.getTypeMap();
  var newTypeMap = newSchema.getTypeMap();

  var typesRemovedFromUnion = [];
  Object.keys(oldTypeMap).forEach(function (typeName) {
    var oldType = oldTypeMap[typeName];
    var newType = newTypeMap[typeName];
    if (!(oldType instanceof _definition.GraphQLUnionType) || !(newType instanceof _definition.GraphQLUnionType)) {
      return;
    }
    var typeNamesInNewUnion = Object.create(null);
    newType.getTypes().forEach(function (type) {
      typeNamesInNewUnion[type.name] = true;
    });
    oldType.getTypes().forEach(function (type) {
      if (!typeNamesInNewUnion[type.name]) {
        typesRemovedFromUnion.push({
          type: BreakingChangeType.TYPE_REMOVED_FROM_UNION,
          description: type.name + ' was removed from union type ' + typeName + '.'
        });
      }
    });
  });
  return typesRemovedFromUnion;
}
/**
 * Given two schemas, returns an Array containing descriptions of any breaking
 * changes in the newSchema related to removing types from a union type.
 */
Given two schemas, returns an Array containing descriptions of any breaking
changes in the newSchema related to removing types from a union type.
Given two schemas returns an Array containing descriptions of any breaking changes in the newSchema related to removing types from a union type .
function findTypesRemovedFromUnions(oldSchema, newSchema) {
  var oldTypeMap = oldSchema.getTypeMap();
  var newTypeMap = newSchema.getTypeMap();
  var typesRemovedFromUnion = [];
  Object.keys(oldTypeMap).forEach(function (typeName) {
    var oldType = oldTypeMap[typeName];
    var newType = newTypeMap[typeName];
    if (!(oldType instanceof _definition.GraphQLUnionType) || !(newType instanceof _definition.GraphQLUnionType)) {
      return;
    }
    var typeNamesInNewUnion = Object.create(null);
    newType.getTypes().forEach(function (type) {
      typeNamesInNewUnion[type.name] = true;
    });
    oldType.getTypes().forEach(function (type) {
      if (!typeNamesInNewUnion[type.name]) {
        typesRemovedFromUnion.push({
          type: BreakingChangeType.TYPE_REMOVED_FROM_UNION,
          description: type.name + ' was removed from union type ' + typeName + '.'
        });
      }
    });
  });
  return typesRemovedFromUnion;
}
function findTypesRemovedFromUnions ( oldSchema , newSchema ) { var oldTypeMap = oldSchema . getTypeMap ( ) ; var newTypeMap = newSchema . getTypeMap ( ) ; var typesRemovedFromUnion = [ ] ; Object . keys ( oldTypeMap ) . forEach ( function ( typeName ) { var oldType = oldTypeMap [ typeName ] ; var newType = newTypeMap [ typeName ] ; if ( ! ( oldType instanceof _definition . GraphQLUnionType ) || ! ( newType instanceof _definition . GraphQLUnionType ) ) { return ; } var typeNamesInNewUnion = Object . create ( null ) ; newType . getTypes ( ) . forEach ( function ( type ) { typeNamesInNewUnion [ type . name ] = true ; } ) ; oldType . getTypes ( ) . forEach ( function ( type ) { if ( ! typeNamesInNewUnion [ type . name ] ) { typesRemovedFromUnion . push ( { type : BreakingChangeType . TYPE_REMOVED_FROM_UNION , description : type . name + ' was removed from union type ' + typeName + '.' } ) ; } } ) ; } ) ; return typesRemovedFromUnion ; }
Given two schemas, returns an Array containing descriptions of any breaking
 changes in the newSchema related to removing types from a union type.
Given two schemas returns an Array containing descriptions of any breaking changes in the newSchema related to removing types from a union type .