Skip to content

Commit 4f99406

Browse files
authored
Merge pull request #752 from rebing/mfn-deprecated
Remove deprecated inputObject/enumObjet properties in favour of classes
2 parents bd8f66a + ed40c37 commit 4f99406

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ CHANGELOG
55
--------------
66

77
## Breaking changes
8+
- Remove deprecated `\Rebing\GraphQL\Support\Type::$inputObject` and `\Rebing\GraphQL\Support\Type::$enumObject` properties [\#752 / mfn](https://github.com/rebing/graphql-laravel/pull/752)\
9+
Instead in your code, extend `\Rebing\GraphQL\Support\InputType` and `\Rebing\GraphQL\Support\EnumType` directly
810
- Support for Lumen has been removed
911
- Integrate laragraph/utils RequestParser [\#739 / mfn](https://github.com/rebing/graphql-laravel/pull/739)
1012
- batched queries will only work with `POST` requests

src/Support/Type.php

-24
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
declare(strict_types = 1);
44
namespace Rebing\GraphQL\Support;
55

6-
use GraphQL\Type\Definition\EnumType;
76
use GraphQL\Type\Definition\FieldDefinition;
8-
use GraphQL\Type\Definition\InputObjectType;
97
use GraphQL\Type\Definition\ObjectType;
108
use GraphQL\Type\Definition\Type as GraphqlType;
119
use Illuminate\Support\Str;
@@ -17,20 +15,6 @@
1715
abstract class Type implements TypeConvertible
1816
{
1917
protected $attributes = [];
20-
/**
21-
* Set to `true` in your type when it should reflect an InputObject.
22-
* @var bool
23-
* @deprecated Use InputType instead
24-
* @see InputType
25-
*/
26-
protected $inputObject = false;
27-
/**
28-
* Set to `true` in your type when it should reflect an Enum.
29-
* @var bool
30-
* @deprecated Use EnumType instead
31-
* @see EnumType
32-
*/
33-
protected $enumObject = false;
3418

3519
public function attributes(): array
3620
{
@@ -138,14 +122,6 @@ public function toArray(): array
138122

139123
public function toType(): GraphqlType
140124
{
141-
if ($this->inputObject) {
142-
return new InputObjectType($this->toArray());
143-
}
144-
145-
if ($this->enumObject) {
146-
return new EnumType($this->toArray());
147-
}
148-
149125
return new ObjectType($this->toArray());
150126
}
151127

0 commit comments

Comments
 (0)