Allow includeDeprecated on __type
This commit is contained in:
parent
66e1b4a9b1
commit
054b96d4f4
1 changed files with 13 additions and 1 deletions
|
@ -155,7 +155,19 @@ GraphQLObjectType _createTypeType() {
|
||||||
field(
|
field(
|
||||||
'fields',
|
'fields',
|
||||||
type: listType(fieldType),
|
type: listType(fieldType),
|
||||||
resolve: (type, _) => type is GraphQLObjectType ? type.fields : [],
|
arguments: [
|
||||||
|
new GraphQLFieldArgument(
|
||||||
|
'includeDeprecated',
|
||||||
|
graphQLBoolean,
|
||||||
|
defaultValue: false,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
resolve: (type, args) => type is GraphQLObjectType
|
||||||
|
? type.fields
|
||||||
|
.where(
|
||||||
|
(f) => !f.isDeprecated || args['includeDeprecated'] == true)
|
||||||
|
.toList()
|
||||||
|
: [],
|
||||||
),
|
),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue