blob: 5db22f07457d8417d1c7d3f44ac95f6ca0acbac4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
// @flow strict
import type { GraphQLError } from '../error/GraphQLError';
import type { DocumentNode } from '../language/ast';
import type { GraphQLSchema } from '../type/schema';
import { validate } from '../validation/validate';
import { NoDeprecatedCustomRule } from '../validation/rules/custom/NoDeprecatedCustomRule';
/**
* A validation rule which reports deprecated usages.
*
* Returns a list of GraphQLError instances describing each deprecated use.
*
* @deprecated Please use `validate` with `NoDeprecatedCustomRule` instead:
*
* ```
* import { validate, NoDeprecatedCustomRule } from 'graphql'
*
* const errors = validate(schema, document, [NoDeprecatedCustomRule])
* ```
*/
export function findDeprecatedUsages(
schema: GraphQLSchema,
ast: DocumentNode,
): $ReadOnlyArray<GraphQLError> {
return validate(schema, ast, [NoDeprecatedCustomRule]);
}
|