Skip to content

Commit 3669cc6

Browse files
authored
feat: csfeature title (#912)
1 parent 2816d7c commit 3669cc6

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/GraphQL/ClassificationstoreFeatureType/Helper.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,19 @@ public static function getCommonFields()
4848
}
4949
},
5050
],
51+
'title' => [
52+
'type' => Type::string(),
53+
'resolve' => static function ($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null) {
54+
if ($value instanceof FeatureDescriptor) {
55+
$keyConfig = KeyConfig::getById($value->getId());
56+
if ($keyConfig) {
57+
return $keyConfig->getTitle();
58+
}
59+
}
60+
61+
return null;
62+
},
63+
],
5164
'description' => [
5265
'type' => Type::string(),
5366
'resolve' => static function ($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null) {

src/GraphQL/TypeInterface/CsFeature.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ public static function getInstance()
4141
'name' => [
4242
'type' => Type::string(),
4343
],
44+
'title' => [
45+
'type' => Type::string(),
46+
],
4447
'type' => [
4548
'type' => Type::string(),
4649
],

0 commit comments

Comments
 (0)