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 API that will be removed #603

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
16 changes: 16 additions & 0 deletions src/Dev/Build.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use SilverStripe\Control\HTTPRequest;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Dev\DebugView;
use SilverStripe\Dev\Deprecation;
use SilverStripe\GraphQL\Schema\DataObject\FieldAccessor;
use SilverStripe\GraphQL\Schema\Exception\EmptySchemaException;
use SilverStripe\GraphQL\Schema\Exception\SchemaBuilderException;
Expand All @@ -19,6 +20,9 @@
use SilverStripe\GraphQL\Schema\Storage\CodeGenerationStore;
use SilverStripe\ORM\Connect\NullDatabaseException;

/**
* @deprecated 5.3.0 Will be replaced with SilverStripe\GraphQL\Dev\SchemaBuild
*/
class Build extends Controller
{
private static $url_handlers = [
Expand All @@ -29,6 +33,18 @@ class Build extends Controller
'build'
];

public function __construct()
{
parent::__construct();
Deprecation::withNoReplacement(function () {
Deprecation::notice(
'5.4.0',
'Will be replaced with SilverStripe\GraphQL\Dev\SchemaBuild',
Deprecation::SCOPE_CLASS
);
});
}

/**
* @throws SchemaBuilderException
* @throws SchemaNotFoundException
Expand Down
16 changes: 16 additions & 0 deletions src/Dev/DevelopmentAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@
use Exception;
use Psr\Log\LoggerInterface;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Dev\Deprecation;
use SilverStripe\GraphQL\Schema\Logger;

/**
* @deprecated 5.3.0 Will be removed without equivalent functionality to replace it
*/
class DevelopmentAdmin extends Controller implements PermissionProvider
{
private static $allowed_actions = [
Expand All @@ -34,6 +38,18 @@ class DevelopmentAdmin extends Controller implements PermissionProvider
'CAN_DEV_GRAPHQL',
];

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

protected function init()
{
parent::init();
Expand Down
14 changes: 14 additions & 0 deletions src/Extensions/DevBuildExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
use Psr\Log\LoggerInterface;
use SilverStripe\Core\Config\Configurable;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Dev\Deprecation;
use SilverStripe\GraphQL\Dev\Build;
use SilverStripe\GraphQL\Schema\Logger;
use SilverStripe\ORM\DatabaseAdmin;
use SilverStripe\ORM\DataExtension;

/**
* @extends DataExtension<DatabaseAdmin>
* @deprecated 5.4.0 Will be replaced with SilverStripe\GraphQL\Extensions\DbBuildExtension
*/
class DevBuildExtension extends DataExtension
{
Expand All @@ -23,6 +25,18 @@ class DevBuildExtension extends DataExtension
*/
private static bool $enabled = true;

public function __construct()
{
parent::__construct();
Deprecation::withNoReplacement(function () {
Deprecation::notice(
'5.4.0',
'Will be replaced with SilverStripe\GraphQL\Extensions\DbBuildExtension',
Deprecation::SCOPE_CLASS
);
});
}

public function onAfterBuild(): void
{
if (!static::config()->get('enabled')) {
Expand Down
Loading