diff --git a/types/graphql/utilities/findDeprecatedUsages.d.ts b/types/graphql/utilities/findDeprecatedUsages.d.ts new file mode 100644 index 0000000000..58e9ae1685 --- /dev/null +++ b/types/graphql/utilities/findDeprecatedUsages.d.ts @@ -0,0 +1,13 @@ +import { GraphQLSchema } from '../type/schema'; +import { DocumentNode } from '../language/ast'; +import { GraphQLError } from '../error/GraphQLError'; + +/** + * A validation rule which reports deprecated usages. + * + * Returns a list of GraphQLError instances describing each deprecated use. + */ +export function findDeprecatedUsages( + schema: GraphQLSchema, + ast: DocumentNode +): Array diff --git a/types/graphql/utilities/index.d.ts b/types/graphql/utilities/index.d.ts index 47cfd70ff9..8815046735 100644 --- a/types/graphql/utilities/index.d.ts +++ b/types/graphql/utilities/index.d.ts @@ -73,3 +73,6 @@ export { assertValidName } from './assertValidName'; // Compares two GraphQLSchemas and detects breaking changes. export { findBreakingChanges } from './findBreakingChanges'; export { BreakingChange } from './findBreakingChanges'; + +// Report all deprecated usage within a GraphQL document. +export { findDeprecatedUsages } from './findDeprecatedUsages';