Skip to content

Commit

Permalink
Merge pull request #1235 from creative-commoners/pulls/5/deprecate-gr…
Browse files Browse the repository at this point in the history
…aphql

API Deprecate GraphQL
  • Loading branch information
GuySartorelli authored Aug 19, 2024
2 parents 42fc926 + c3f3660 commit bea53c5
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/GraphQL/Resolvers/Resolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,21 @@
use SilverStripe\ORM\ValidationException;
use InvalidArgumentException;
use Exception;
use SilverStripe\Dev\Deprecation;

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

/**
* @param $value
* @return object
Expand Down
4 changes: 4 additions & 0 deletions src/Models/BaseElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -1281,9 +1281,13 @@ public function EvenOdd()

/**
* @return string
* @deprecated 5.3.0 Will be replaced with getTypeName()
*/
public static function getGraphQLTypeName(): string
{
Deprecation::withNoReplacement(function () {
Deprecation::notice('5.3.0', 'Will be replaced with getTypeName()');
});
// For GraphQL 3, use the static schema type name - except for BaseElement for which this is inconsistent.
if (class_exists(StaticSchema::class) && static::class !== BaseElement::class) {
return StaticSchema::inst()->typeNameForDataObject(static::class);
Expand Down
12 changes: 12 additions & 0 deletions src/ORM/FieldType/DBObjectType.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,21 @@

use SilverStripe\GraphQL\Manager;
use SilverStripe\ORM\FieldType\DBField;
use SilverStripe\Dev\Deprecation;

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

/**
* Add the field to the underlying database.
*/
Expand Down

0 comments on commit bea53c5

Please sign in to comment.