@@ -4,7 +4,8 @@ UPGRADE FROM 0.13 to 1.0
4
4
# Table of Contents
5
5
6
6
- [ Customize the cursor encoder of the edges of a connection] ( #customize-the-cursor-encoder-of-the-edges-of-a-connection )
7
- - [ Change arguments of TypeGenerator] ( #change-arguments-of-typegenerator )
7
+ - [ Change arguments of ` TypeGenerator ` ] ( #change-arguments-of-typegenerator )
8
+ - [ Add magic ` __get ` method to ` ArgumentInterface ` implementors] ( #add-magic-__get-method-to-argumentinterface-implementors )
8
9
9
10
### Customize the cursor encoder of the edges of a connection
10
11
@@ -34,8 +35,8 @@ $connectionBuilder = new ConnectionBuilder(
34
35
35
36
### Change arguments of ` TypeGenerator ` class
36
37
37
- The ` TypeGenerator ` service is used internally for GraphQL types compilation. If you overridden the service definition,
38
- please take into account the new constructor signature:
38
+ The ` Overblog\GraphQLBundle\Generator\ TypeGenerator` service is used internally for GraphQL types compilation. If you
39
+ overridden the service definition, please take into account the new constructor signature:
39
40
40
41
``` diff
41
42
public function __construct(
@@ -51,3 +52,36 @@ public function __construct(
51
52
) {
52
53
```
53
54
` TypeBuilder ` here is a new service ` Overblog\GraphQLBundle\Generator\TypeBuilder ` , which is also used internally.
55
+
56
+ ### Add magic ` __get ` method to ` ArgumentInterface ` implementors
57
+
58
+ The interface ` Overblog\GraphQLBundle\Definition\ArgumentInterface ` as well as implementing it class
59
+ ` Overblog\GraphQLBundle\Definition\Argument ` now have the magic ` __get ` method:
60
+
61
+ ``` diff
62
+ interface ArgumentInterface extends ArrayAccess, Countable
63
+ {
64
+ /**
65
+ * @return array the old array
66
+ */
67
+ public function exchangeArray(array $array): array;
68
+
69
+ public function getArrayCopy(): array;
70
+
71
+ + /**
72
+ + * @return mixed
73
+ + */
74
+ + public function __get(string $name);
75
+ }
76
+
77
+ class Argument implements ArgumentInterface
78
+ {
79
+ // ...
80
+
81
+ + public function __get(string $name)
82
+ + {
83
+ + return $this->rawArguments[$name] ?? null;
84
+ + }
85
+ }
86
+ ```
87
+ If you use your own class for resolver arguments, then it should have a ` __get ` method as well.
0 commit comments