Skip to content

Commit

Permalink
Add deprecation notices with explicit removal versions
Browse files Browse the repository at this point in the history
Some methods have been marked as deprecated for a while - add explicit versions for each.

As recommended in #1383, this marks long deprecated methods as to be removed in v15, and newly deprecated options (legacy sdl) to be removed in v16
  • Loading branch information
leebyron committed Jun 12, 2018
1 parent f726196 commit 9ebe094
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/index.js
Expand Up @@ -316,7 +316,7 @@ export {
// Produce the GraphQL query recommended for a full schema introspection.
// Accepts optional IntrospectionOptions.
getIntrospectionQuery,
// Deprecated: use getIntrospectionQuery
// @deprecated: use getIntrospectionQuery - will be removed in v15
introspectionQuery,
// Gets the target Operation from a Document
getOperationAST,
Expand Down Expand Up @@ -357,9 +357,9 @@ export {
TypeInfo,
// Coerces a JavaScript value to a GraphQL type, or produces errors.
coerceValue,
// @deprecated use coerceValue
// @deprecated use coerceValue - will be removed in v15
isValidJSValue,
// Determine if AST values adhere to a GraphQL type.
// @deprecated use validation - will be removed in v15
isValidLiteralValue,
// Concatenates multiple AST together.
concatAST,
Expand Down
4 changes: 2 additions & 2 deletions src/language/parser.js
Expand Up @@ -84,7 +84,7 @@ export type ParseOptions = {
* specification.
*
* This option is provided to ease adoption of the final SDL specification
* and will be removed in a future major release.
* and will be removed in v16.
*/
allowLegacySDLEmptyFields?: boolean,

Expand All @@ -94,7 +94,7 @@ export type ParseOptions = {
* current specification.
*
* This option is provided to ease adoption of the final SDL specification
* and will be removed in a future major release.
* and will be removed in v16.
*/
allowLegacySDLImplementsInterfaces?: boolean,

Expand Down
6 changes: 3 additions & 3 deletions src/utilities/index.js
Expand Up @@ -10,7 +10,7 @@
// The GraphQL query recommended for a full schema introspection.
export {
getIntrospectionQuery,
// Deprecated, use getIntrospectionQuery()
// @deprecated, use getIntrospectionQuery() - will be removed in v15
introspectionQuery,
} from './introspectionQuery';
export type {
Expand Down Expand Up @@ -86,10 +86,10 @@ export { TypeInfo } from './TypeInfo';
// Coerces a JavaScript value to a GraphQL type, or produces errors.
export { coerceValue } from './coerceValue';

// @deprecated use coerceValue
// @deprecated use coerceValue - will be removed in v15
export { isValidJSValue } from './isValidJSValue';

// Determine if AST values adhere to a GraphQL type.
// @deprecated use validation - will be removed in v15
export { isValidLiteralValue } from './isValidLiteralValue';

// Concatenates multiple AST together.
Expand Down
5 changes: 5 additions & 0 deletions src/utilities/introspectionQuery.js
Expand Up @@ -112,6 +112,11 @@ export function getIntrospectionQuery(options?: IntrospectionOptions): string {
`;
}

/**
* Deprecated, call getIntrospectionQuery directly.
*
* This function will be removed in v15
*/
export const introspectionQuery = getIntrospectionQuery();

export type IntrospectionQuery = {|
Expand Down
2 changes: 2 additions & 0 deletions src/utilities/isValidJSValue.js
Expand Up @@ -12,6 +12,8 @@ import type { GraphQLInputType } from '../type/definition';

/**
* Deprecated. Use coerceValue() directly for richer information.
*
* This function will be removed in v15
*/
export function isValidJSValue(
value: mixed,
Expand Down
2 changes: 2 additions & 0 deletions src/utilities/isValidLiteralValue.js
Expand Up @@ -21,6 +21,8 @@ import ValidationContext from '../validation/ValidationContext';
* Utility which determines if a value literal node is valid for an input type.
*
* Deprecated. Rely on validation for documents containing literal values.
*
* This function will be removed in v15
*/
export function isValidLiteralValue(
type: GraphQLInputType,
Expand Down

0 comments on commit 9ebe094

Please sign in to comment.