- Customize the cursor encoder of the edges of a connection
- Change arguments of
TypeGenerator
- Add magic
__get
method toArgumentInterface
implementors
The connection builder now accepts an optional custom cursor encoder as first argument of the constructor.
$connectionBuilder = new ConnectionBuilder(
+ new class implements CursorEncoderInterface {
+ public function encode($value): string
+ {
+ ...
+ }
+
+ public function decode(string $cursor)
+ {
+ ...
+ }
+ }
static function (iterable $edges, PageInfoInterface $pageInfo) {
...
},
static function (string $cursor, $value, int $index) {
...
}
);
The Overblog\GraphQLBundle\Generator\TypeGenerator
service is used internally for GraphQL types compilation. If you
overridden the service definition, please take into account the new constructor signature:
public function __construct(
string $classNamespace,
- array $skeletonDirs,
?string $cacheDir,
array $configs,
+ TypeBuilder $typeBuilder
+ EventDispatcherInterface $eventDispatcher
bool $useClassMap = true,
- callable $configProcessor = null,
?string $baseCacheDir = null,
?int $cacheDirMask = null
) {
TypeBuilder
here is a new service Overblog\GraphQLBundle\Generator\TypeBuilder
, which is also used internally.
The interface Overblog\GraphQLBundle\Definition\ArgumentInterface
as well as implementing it class
Overblog\GraphQLBundle\Definition\Argument
now have the magic __get
method:
interface ArgumentInterface extends ArrayAccess, Countable
{
/**
* @return array the old array
*/
public function exchangeArray(array $array): array;
public function getArrayCopy(): array;
+ /**
+ * @return mixed
+ */
+ public function __get(string $name);
}
class Argument implements ArgumentInterface
{
// ...
+ public function __get(string $name)
+ {
+ return $this->rawArguments[$name] ?? null;
+ }
}
If you use your own class for resolver arguments, then it should have a __get
method as well.