Skip to content

Commit

Permalink
Merge pull request #193 from DzemalBecirevic/master
Browse files Browse the repository at this point in the history
Adding new missing fields to LinkDataType.
  • Loading branch information
weisswurstkanone authored Apr 8, 2020
2 parents 02c5edd + a5ab7a6 commit 52c7b00
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion src/GraphQL/DocumentElementType/LinkDataType.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,39 @@ public function __construct(Service $graphQlService)
'target' => [
'type' => $anyTargetType,
'resolve' => [new Link($this->getGraphQlService()), "resolveTarget"]
]
],
'windowTarget' => [ // Target is already in use.
'type' => Type::string(),
'resolve' => static function ($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null) {
if ($value instanceof \Pimcore\Model\Document\Tag\Link) {
return $value->getData() ? $value->getData()["target"] : null;
}
}
],
'parameters' => [
'type' => Type::string(),
'resolve' => static function ($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null) {
if ($value instanceof \Pimcore\Model\Document\Tag\Link) {
return $value->getData() ? $value->getData()["parameters"] : null;
}
}
],
'anchor' => [
'type' => Type::string(),
'resolve' => static function ($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null) {
if ($value instanceof \Pimcore\Model\Document\Tag\Link) {
return $value->getData() ? $value->getData()["anchor"] : null;
}
}
],
'title' => [
'type' => Type::string(),
'resolve' => static function ($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null) {
if ($value instanceof \Pimcore\Model\Document\Tag\Link) {
return $value->getData() ? $value->getData()["title"] : null;
}
}
],
]
];
parent::__construct($config);
Expand Down

0 comments on commit 52c7b00

Please sign in to comment.