findDeprecatedUsages.js 802 B

123456789101112131415161718192021222324252627
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.findDeprecatedUsages = findDeprecatedUsages;
  6. var _validate = require("../validation/validate.js");
  7. var _NoDeprecatedCustomRule = require("../validation/rules/custom/NoDeprecatedCustomRule.js");
  8. /**
  9. * A validation rule which reports deprecated usages.
  10. *
  11. * Returns a list of GraphQLError instances describing each deprecated use.
  12. *
  13. * @deprecated Please use `validate` with `NoDeprecatedCustomRule` instead:
  14. *
  15. * ```
  16. * import { validate, NoDeprecatedCustomRule } from 'graphql'
  17. *
  18. * const errors = validate(schema, document, [NoDeprecatedCustomRule])
  19. * ```
  20. */
  21. function findDeprecatedUsages(schema, ast) {
  22. return (0, _validate.validate)(schema, ast, [_NoDeprecatedCustomRule.NoDeprecatedCustomRule]);
  23. }