Source of file PublicationResultType.php
Size: 0,946 Bytes - Last Modified: 2021-12-23T10:27:34+00:00
/var/www/docs.ssmods.com/process/src/_legacy/GraphQL/PublicationResultType.php
12345678910111213141516171819202122232425262728293031323334353637 | <?php namespace SilverStripe\AssetAdmin\GraphQL; use SilverStripe\Assets\File; use SilverStripe\GraphQL\TypeCreator; use GraphQL\Type\Definition\UnionType; if (!class_exists(TypeCreator::class)) { return; } /** * @deprecated 4.8..5.0 Use silverstripe/graphql:^4 functionality. */ class PublicationResultType extends TypeCreator { public function toType() { return new UnionType([ 'name' => 'PublicationResult', 'types' => [ $this->manager->getType('File'), $this->manager->getType('PublicationNotice'), ], 'resolveType' => function ($value) { if ($value instanceof File) { return $this->manager->getType('File'); } if ($value instanceof Notice) { return $this->manager->getType('PublicationNotice'); } } ]); } } |