findDeprecatedUsages.mjs 637 B

12345678910111213141516171819
  1. import { validate } from "../validation/validate.mjs";
  2. import { NoDeprecatedCustomRule } from "../validation/rules/custom/NoDeprecatedCustomRule.mjs";
  3. /**
  4. * A validation rule which reports deprecated usages.
  5. *
  6. * Returns a list of GraphQLError instances describing each deprecated use.
  7. *
  8. * @deprecated Please use `validate` with `NoDeprecatedCustomRule` instead:
  9. *
  10. * ```
  11. * import { validate, NoDeprecatedCustomRule } from 'graphql'
  12. *
  13. * const errors = validate(schema, document, [NoDeprecatedCustomRule])
  14. * ```
  15. */
  16. export function findDeprecatedUsages(schema, ast) {
  17. return validate(schema, ast, [NoDeprecatedCustomRule]);
  18. }