From 391c1cea0ca3811ae32a05f34fe932320b790bdf Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Mon, 19 Aug 2024 09:37:03 +1200 Subject: [PATCH] API Deprecate GraphQL --- code/GraphQL/LinkablePlugin.php | 11 +++++++++++ code/GraphQL/Resolver.php | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/code/GraphQL/LinkablePlugin.php b/code/GraphQL/LinkablePlugin.php index ff09f16a..798cb579 100644 --- a/code/GraphQL/LinkablePlugin.php +++ b/code/GraphQL/LinkablePlugin.php @@ -14,11 +14,15 @@ use SilverStripe\GraphQL\Schema\Interfaces\ModelQueryPlugin; use SilverStripe\GraphQL\Schema\Schema; use SilverStripe\ORM\ArrayList; use SilverStripe\ORM\DataList; +use SilverStripe\Dev\Deprecation; if (!interface_exists(ModelQueryPlugin::class)) { return; } +/** + * @deprecated 5.3.0 Will be moved to the silverstripe/graphql module + */ class LinkablePlugin implements ModelQueryPlugin { use Configurable; @@ -43,6 +47,13 @@ class LinkablePlugin implements ModelQueryPlugin */ private static $resolver = [__CLASS__, 'applyLinkFilter']; + public function __construct() + { + Deprecation::withNoReplacement(function () { + Deprecation::notice('5.3.0', 'Will be moved to the silverstripe/graphql module', Deprecation::SCOPE_CLASS); + }); + } + /** * @return string */ diff --git a/code/GraphQL/Resolver.php b/code/GraphQL/Resolver.php index 0dac373a..19c4ff5c 100644 --- a/code/GraphQL/Resolver.php +++ b/code/GraphQL/Resolver.php @@ -4,9 +4,20 @@ namespace SilverStripe\CMS\GraphQL; use SilverStripe\CMS\Model\SiteTree; +use SilverStripe\Dev\Deprecation; +/** + * @deprecated 5.3.0 Will be moved to the silverstripe/graphql module + */ class Resolver { + 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 resolveGetPageByLink($obj, array $args = []) { return SiteTree::get_by_link($args['link']);