Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Deprecate GraphQL #1484

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 moved to the silverstripe/graphql module
*/
class FileFilter
{
public function __construct()
{
Deprecation::withNoReplacement(function () {
Deprecation::notice('5.3.0', 'Will be moved to the silverstripe/graphql module', 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 moved to the silverstripe/graphql module
*/
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 moved to the silverstripe/graphql module', 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 moved to the silverstripe/graphql module
*/
class AssetAdminResolver
{
public function __construct()
{
Deprecation::withNoReplacement(function () {
Deprecation::notice('5.3.0', 'Will be moved to the silverstripe/graphql module', 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 moved to the silverstripe/graphql module
*/
class FieldResolver
{
public function __construct()
{
Deprecation::withNoReplacement(function () {
Deprecation::notice('5.3.0', 'Will be moved to the silverstripe/graphql module', 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 moved to the silverstripe/graphql module
*/
class FileTypeResolver
{
use Injectable;

public function __construct()
{
Deprecation::withNoReplacement(function () {
Deprecation::notice('5.3.0', 'Will be moved to the silverstripe/graphql module', 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 moved to the silverstripe/graphql module
*/
class FolderTypeResolver
{
public function __construct()
{
Deprecation::withNoReplacement(function () {
Deprecation::notice('5.3.0', 'Will be moved to the silverstripe/graphql module', 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 moved to the silverstripe/graphql module
*/
class PublicationResolver
{
const ACTION_PUBLISH = 'publish';
const ACTION_UNPUBLISH = 'unpublish';

public function __construct()
{
Deprecation::withNoReplacement(function () {
Deprecation::notice('5.3.0', 'Will be moved to the silverstripe/graphql module', 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 moved to the silverstripe/graphql module
*/
class Builder implements SchemaUpdater
{
public function __construct()
{
Deprecation::withNoReplacement(function () {
Deprecation::notice('5.3.0', 'Will be moved to the silverstripe/graphql module', Deprecation::SCOPE_CLASS);
});
}

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