-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow deprecation of input values (field args, directive args, input fields) #805
Changes from 5 commits
0e1f9b8
6ad62e8
cce1219
23f175c
ba78f00
d3dd6f7
127f0ef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,9 +108,10 @@ CommonMark-compliant Markdown renderer. | |
|
||
**Deprecation** | ||
|
||
To support the management of backwards compatibility, GraphQL fields and enum | ||
values can indicate whether or not they are deprecated (`isDeprecated: Boolean`) | ||
and a description of why it is deprecated (`deprecationReason: String`). | ||
To support the management of backwards compatibility, GraphQL fields, arguments, | ||
input fields, and enum values can indicate whether or not they are deprecated | ||
(`isDeprecated: Boolean`) along with a description of why it is deprecated | ||
(`deprecationReason: String`). | ||
|
||
Tools built using GraphQL introspection should respect deprecation by | ||
discouraging deprecated use through information hiding or developer-facing | ||
|
@@ -145,7 +146,7 @@ type __Type { | |
# must be non-null for ENUM, otherwise null. | ||
enumValues(includeDeprecated: Boolean = false): [__EnumValue!] | ||
# must be non-null for INPUT_OBJECT, otherwise null. | ||
inputFields: [__InputValue!] | ||
inputFields(includeDeprecated: Boolean = false): [__InputValue!] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
# must be non-null for NON_NULL and LIST, otherwise null. | ||
ofType: __Type | ||
# may be non-null for custom SCALAR, otherwise null. | ||
|
@@ -166,7 +167,7 @@ enum __TypeKind { | |
type __Field { | ||
name: String! | ||
description: String | ||
args: [__InputValue!]! | ||
args(includeDeprecated: Boolean = false): [__InputValue!]! | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
type: __Type! | ||
isDeprecated: Boolean! | ||
deprecationReason: String | ||
|
@@ -177,6 +178,8 @@ type __InputValue { | |
description: String | ||
type: __Type! | ||
defaultValue: String | ||
isDeprecated: Boolean! | ||
deprecationReason: String | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} | ||
|
||
type __EnumValue { | ||
|
@@ -190,7 +193,7 @@ type __Directive { | |
name: String! | ||
description: String | ||
locations: [__DirectiveLocation!]! | ||
args: [__InputValue!]! | ||
args(includeDeprecated: Boolean = false): [__InputValue!]! | ||
michaelstaib marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
isRepeatable: Boolean! | ||
} | ||
|
||
|
@@ -367,6 +370,8 @@ Fields\: | |
- `name` must return a String. | ||
- `description` may return a String or {null}. | ||
- `inputFields` must return the set of input fields as a list of `__InputValue`. | ||
- Accepts the argument `includeDeprecated` which defaults to {false}. If | ||
{true}, deprecated fields are also returned. | ||
- All other fields must return {null}. | ||
|
||
**List** | ||
|
@@ -412,6 +417,8 @@ Fields\: | |
- `description` may return a String or {null} | ||
- `args` returns a List of `__InputValue` representing the arguments this field | ||
accepts. | ||
- Accepts the argument `includeDeprecated` which defaults to {false}. If | ||
{true}, deprecated arguments are also returned. | ||
- `type` must return a `__Type` that represents the type of value returned by | ||
this field. | ||
- `isDeprecated` returns {true} if this field should no longer be used, | ||
|
@@ -432,6 +439,10 @@ Fields\: | |
- `defaultValue` may return a String encoding (using the GraphQL language) of | ||
the default value used by this input value in the condition a value is not | ||
provided at runtime. If this input value has no default value, returns {null}. | ||
- `isDeprecated` returns {true} if this input field or argument should no longer | ||
be used, otherwise {false}. | ||
- `deprecationReason` optionally provides a reason why this input field or | ||
argument is deprecated. | ||
|
||
### The \_\_EnumValue Type | ||
|
||
|
@@ -483,5 +494,7 @@ Fields\: | |
locations this directive may be placed. | ||
- `args` returns a List of `__InputValue` representing the arguments this | ||
directive accepts. | ||
- Accepts the argument `includeDeprecated` which defaults to {false}. If | ||
{true}, deprecated arguments are also returned. | ||
- `isRepeatable` must return a Boolean that indicates if the directive may be | ||
used repeatedly at a single location. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented here: https://github.com/graphql/graphql-js/blob/5740cbdb58d3b50a11a29b24869a35a7ae8b6588/src/type/directives.ts#L180-L184