Skip to content

Commit 34e5723

Browse files
committed
Add includeDeprecated argument to __type.possibleTypes
Also run prettier to fix formatting
1 parent 29b2cf5 commit 34e5723

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

spec/Section 3 -- Type System.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2098,9 +2098,10 @@ type ExampleType {
20982098
To deprecate a required argument or input field, it must first be made optional
20992099
by either changing the type to nullable or adding a default value.
21002100

2101-
The `@deprecated` directive is useful for object types that are included in unions or
2102-
interfaces. Deprecating the type indicates to clients that the server will no longer be returning
2103-
this type and clients should remove references to this type in their queries.
2101+
The `@deprecated` directive is useful for object types that are included in
2102+
unions or interfaces. Deprecating the type indicates to clients that the server
2103+
will no longer be returning this type and clients should remove references to
2104+
this type in their queries.
21042105

21052106
```graphql example
21062107
type Query {
@@ -2114,7 +2115,8 @@ type DeprecatedType @deprecated {
21142115
}
21152116
```
21162117

2117-
The `@deprecated` directive should not appear on object types that are referenced by non-deprecated fields.
2118+
The `@deprecated` directive should not appear on object types that are
2119+
referenced by non-deprecated fields.
21182120

21192121
```graphql counter-example
21202122
type Query {

spec/Section 4 -- Introspection.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ CommonMark-compliant Markdown renderer.
109109
**Deprecation**
110110

111111
To support the management of backwards compatibility, GraphQL fields, arguments,
112-
input fields, enum values, and objects can indicate whether or not they are deprecated
113-
(`isDeprecated: Boolean`) along with a description of why it is deprecated
114-
(`deprecationReason: String`).
112+
input fields, enum values, and objects can indicate whether or not they are
113+
deprecated (`isDeprecated: Boolean`) along with a description of why it is
114+
deprecated (`deprecationReason: String`).
115115

116116
Tools built using GraphQL introspection should respect deprecation by
117117
discouraging deprecated use through information hiding or developer-facing
@@ -142,7 +142,7 @@ type __Type {
142142
# must be non-null for OBJECT and INTERFACE, otherwise null.
143143
interfaces: [__Type!]
144144
# must be non-null for INTERFACE and UNION, otherwise null.
145-
possibleTypes: [__Type!]
145+
possibleTypes(includeDeprecated: Boolean = false): [__Type!]
146146
# must be non-null for ENUM, otherwise null.
147147
enumValues(includeDeprecated: Boolean = false): [__EnumValue!]
148148
# must be non-null for INPUT_OBJECT, otherwise null.
@@ -315,6 +315,8 @@ Fields\:
315315
- `description` may return a String or {null}.
316316
- `possibleTypes` returns the list of types that can be represented within this
317317
union. They must be object types.
318+
- Accepts the argument `includeDeprecated` which defaults to {false}. If
319+
{true}, deprecated fields are also returned.
318320
- All other fields must return {null}.
319321

320322
**Interface**
@@ -336,6 +338,8 @@ Fields\:
336338
(if none, `interfaces` must return the empty set).
337339
- `possibleTypes` returns the list of types that implement this interface. They
338340
must be object types.
341+
- Accepts the argument `includeDeprecated` which defaults to {false}. If
342+
{true}, deprecated fields are also returned.
339343
- All other fields must return {null}.
340344

341345
**Enum**

0 commit comments

Comments
 (0)