function findDeprecatedUsages(schema, ast) {
  var errors = [];
  var typeInfo = new _TypeInfo.TypeInfo(schema);

  (0, _visitor.visit)(ast, (0, _visitor.visitWithTypeInfo)(typeInfo, {
    Field: function Field(node) {
      var fieldDef = typeInfo.getFieldDef();
      if (fieldDef && fieldDef.isDeprecated) {
        var parentType = typeInfo.getParentType();
        if (parentType) {
          var reason = fieldDef.deprecationReason;
          errors.push(new _GraphQLError.GraphQLError('The field ' + parentType.name + '.' + fieldDef.name + ' is deprecated.' + (reason ? ' ' + reason : ''), [node]));
        }
      }
    },
    EnumValue: function EnumValue(node) {
      var enumVal = typeInfo.getEnumValue();
      if (enumVal && enumVal.isDeprecated) {
        var type = (0, _definition.getNamedType)(typeInfo.getInputType());
        if (type) {
          var reason = enumVal.deprecationReason;
          errors.push(new _GraphQLError.GraphQLError('The enum value ' + type.name + '.' + enumVal.name + ' is deprecated.' + (reason ? ' ' + reason : ''), [node]));
        }
      }
    }
  }));

  return errors;
}
/**
 * A validation rule which reports deprecated usages.
 *
 * Returns a list of GraphQLError instances describing each deprecated use.
 */
A validation rule which reports deprecated usages.
Returns a list of GraphQLError instances describing each deprecated use.
A validation rule which reports deprecated usages . Returns a list of GraphQLError instances describing each deprecated use .
function findDeprecatedUsages(schema, ast) {
  var errors = [];
  var typeInfo = new _TypeInfo.TypeInfo(schema);
  (0, _visitor.visit)(ast, (0, _visitor.visitWithTypeInfo)(typeInfo, {
    Field: function Field(node) {
      var fieldDef = typeInfo.getFieldDef();
      if (fieldDef && fieldDef.isDeprecated) {
        var parentType = typeInfo.getParentType();
        if (parentType) {
          var reason = fieldDef.deprecationReason;
          errors.push(new _GraphQLError.GraphQLError('The field ' + parentType.name + '.' + fieldDef.name + ' is deprecated.' + (reason ? ' ' + reason : ''), [node]));
        }
      }
    },
    EnumValue: function EnumValue(node) {
      var enumVal = typeInfo.getEnumValue();
      if (enumVal && enumVal.isDeprecated) {
        var type = (0, _definition.getNamedType)(typeInfo.getInputType());
        if (type) {
          var reason = enumVal.deprecationReason;
          errors.push(new _GraphQLError.GraphQLError('The enum value ' + type.name + '.' + enumVal.name + ' is deprecated.' + (reason ? ' ' + reason : ''), [node]));
        }
      }
    }
  }));
  return errors;
}
function findDeprecatedUsages ( schema , ast ) { var errors = [ ] ; var typeInfo = new _TypeInfo . TypeInfo ( schema ) ; ( 0 , _visitor . visit ) ( ast , ( 0 , _visitor . visitWithTypeInfo ) ( typeInfo , { Field : function Field ( node ) { var fieldDef = typeInfo . getFieldDef ( ) ; if ( fieldDef && fieldDef . isDeprecated ) { var parentType = typeInfo . getParentType ( ) ; if ( parentType ) { var reason = fieldDef . deprecationReason ; errors . push ( new _GraphQLError . GraphQLError ( 'The field ' + parentType . name + '.' + fieldDef . name + ' is deprecated.' + ( reason ? ' ' + reason : '' ) , [ node ] ) ) ; } } } , EnumValue : function EnumValue ( node ) { var enumVal = typeInfo . getEnumValue ( ) ; if ( enumVal && enumVal . isDeprecated ) { var type = ( 0 , _definition . getNamedType ) ( typeInfo . getInputType ( ) ) ; if ( type ) { var reason = enumVal . deprecationReason ; errors . push ( new _GraphQLError . GraphQLError ( 'The enum value ' + type . name + '.' + enumVal . name + ' is deprecated.' + ( reason ? ' ' + reason : '' ) , [ node ] ) ) ; } } } } ) ) ; return errors ; }
A validation rule which reports deprecated usages.
A validation rule which reports deprecated usages .