Merge pull request #2986 from creative-commoners/pulls/5/deprecate-graphql

API Deprecate GraphQL
This commit is contained in:
Guy Sartorelli 2024-08-19 13:55:25 +12:00 committed by GitHub
commit 370907bc78
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 22 additions and 0 deletions

View File

@ -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
*/

View File

@ -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']);