Skip to content

Commit

Permalink
API Deprecate GraphQL
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Aug 15, 2024
1 parent be18dbb commit d834f19
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 0 deletions.
11 changes: 11 additions & 0 deletions code/GraphQL/FileFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,20 @@
use SilverStripe\Forms\DateField;
use SilverStripe\ORM\ArrayList;
use SilverStripe\ORM\Filterable;
use SilverStripe\Dev\Deprecation;

/**
* @deprecated 5.3.0 Will be removed without equivalent functionality to replace it
*/
class FileFilter
{
public function __construct()
{
Deprecation::withNoReplacement(function () {
Deprecation::notice('5.3.0', 'Will be removed without equivalent functionality to replace it', Deprecation::SCOPE_CLASS);
});
}

/**
* Caution: Does NOT enforce canView permissions
*
Expand Down
7 changes: 7 additions & 0 deletions code/GraphQL/Notice.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

namespace SilverStripe\AssetAdmin\GraphQL;

use SilverStripe\Dev\Deprecation;

/**
* Represents a notice related to a graphql Action. This could be a failure,
* warning, or recoverable query (e.g. "are you sure you want to publish this item?")
*
* @deprecated 5.3.0 Will be removed without equivalent functionality to replace it
*/
class Notice
{
Expand Down Expand Up @@ -34,6 +38,9 @@ class Notice
*/
public function __construct($message, $noticeType, $ids = [])
{
Deprecation::withNoReplacement(function () {
Deprecation::notice('5.3.0', 'Will be removed without equivalent functionality to replace it', Deprecation::SCOPE_CLASS);
});
$this->message = $message;
$this->noticeType = $noticeType;
$this->ids = $ids;
Expand Down
11 changes: 11 additions & 0 deletions code/GraphQL/Resolvers/AssetAdminResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,20 @@
use SilverStripe\ORM\Filterable;
use SilverStripe\Versioned\Versioned;
use InvalidArgumentException;
use SilverStripe\Dev\Deprecation;

/**
* @deprecated 5.3.0 Will be removed without equivalent functionality to replace it
*/
class AssetAdminResolver
{
public function __construct()
{
Deprecation::withNoReplacement(function () {
Deprecation::notice('5.3.0', 'Will be removed without equivalent functionality to replace it', Deprecation::SCOPE_CLASS);
});
}

public static function resolveFileInterfaceType($object)
{
if ($object instanceof Folder) {
Expand Down
11 changes: 11 additions & 0 deletions code/GraphQL/Resolvers/FieldResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,20 @@

use GraphQL\Type\Definition\ResolveInfo;
use SilverStripe\GraphQL\Schema\DataObject\FieldAccessor;
use SilverStripe\Dev\Deprecation;

/**
* @deprecated 5.3.0 Will be removed without equivalent functionality to replace it
*/
class FieldResolver
{
public function __construct()
{
Deprecation::withNoReplacement(function () {
Deprecation::notice('5.3.0', 'Will be removed without equivalent functionality to replace it', Deprecation::SCOPE_CLASS);
});
}

public static function resolve($obj, array $args, array $context, ResolveInfo $info)
{
$field = $info->fieldName;
Expand Down
11 changes: 11 additions & 0 deletions code/GraphQL/Resolvers/FileTypeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,22 @@
use SilverStripe\Assets\Folder;
use SilverStripe\Assets\Storage\AssetContainer;
use SilverStripe\Core\Injector\Injectable;
use SilverStripe\Dev\Deprecation;

/**
* @deprecated 5.3.0 Will be removed without equivalent functionality to replace it
*/
class FileTypeResolver
{
use Injectable;

public function __construct()
{
Deprecation::withNoReplacement(function () {
Deprecation::notice('5.3.0', 'Will be removed without equivalent functionality to replace it', Deprecation::SCOPE_CLASS);
});
}

private static $dependencies = [
'ThumbnailGenerator' => '%$SilverStripe\AssetAdmin\Model\ThumbnailGenerator.graphql'
];
Expand Down
11 changes: 11 additions & 0 deletions code/GraphQL/Resolvers/FolderTypeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,20 @@
use Exception;
use Closure;
use SilverStripe\ORM\DataQuery;
use SilverStripe\Dev\Deprecation;

/**
* @deprecated 5.3.0 Will be removed without equivalent functionality to replace it
*/
class FolderTypeResolver
{
public function __construct()
{
Deprecation::withNoReplacement(function () {
Deprecation::notice('5.3.0', 'Will be removed without equivalent functionality to replace it', Deprecation::SCOPE_CLASS);
});
}

/**
* @param Folder $object
* @param array $args
Expand Down
11 changes: 11 additions & 0 deletions code/GraphQL/Resolvers/PublicationResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,23 @@
use SilverStripe\Versioned\RecursivePublishable;
use SilverStripe\Versioned\Versioned;
use InvalidArgumentException;
use SilverStripe\Dev\Deprecation;

/**
* @deprecated 5.3.0 Will be removed without equivalent functionality to replace it
*/
class PublicationResolver
{
const ACTION_PUBLISH = 'publish';
const ACTION_UNPUBLISH = 'unpublish';

public function __construct()
{
Deprecation::withNoReplacement(function () {
Deprecation::notice('5.3.0', 'Will be removed without equivalent functionality to replace it', Deprecation::SCOPE_CLASS);
});
}

public static function resolvePublishFiles(...$params)
{
return PublicationResolver::resolvePublicationOperation(PublicationResolver::ACTION_PUBLISH, ...$params);
Expand Down
11 changes: 11 additions & 0 deletions code/GraphQL/Schema/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,24 @@
use SilverStripe\GraphQL\Schema\Schema;
use SilverStripe\GraphQL\Schema\Type\Enum;
use SilverStripe\ORM\ArrayLib;
use SilverStripe\Dev\Deprecation;

if (!interface_exists(SchemaUpdater::class)) {
return;
}

/**
* @deprecated 5.3.0 Will be removed without equivalent functionality to replace it
*/
class Builder implements SchemaUpdater
{
public function __construct()
{
Deprecation::withNoReplacement(function () {
Deprecation::notice('5.3.0', 'Will be removed without equivalent functionality to replace it', Deprecation::SCOPE_CLASS);
});
}

public static function updateSchema(Schema $schema): void
{
$categoryValues = array_map(function ($category) {
Expand Down

0 comments on commit d834f19

Please sign in to comment.