Skip to content

Latest commit

 

History

History
116 lines (84 loc) · 2.77 KB

UPGRADE-0.12.md

File metadata and controls

116 lines (84 loc) · 2.77 KB

UPGRADE FROM 0.11 to 0.12

Table of Contents

Remove auto mapping configuration

  • The AutoMapping configuration entry has been removed in favor of Symfony 4+ service configuration.

Upgrading:

  • Delete old configuration.
    overblog_graphql:
        definitions:
    -        auto_mapping: ~
  • use Symfony 4+ service configuration to tag your types, resolvers or mutation.
    # config/services.yaml
    services:
        _defaults:
            autoconfigure: true
    
        App\GraphQL\:
            resource: ../src/GraphQL

Relay Paginator, Connections & Edges

  • Following the paginator update and the use of interfaces for Relay Connection & Edge, getters & setters must be use to manipulate Connection, Edge and PageInfo Properties

Before :

$connection->edges = $edges;
$connection->totalCount = 10;
...
$edge->cursor = $cursor;
$edge->node = $node;

After :

$connection->setEdges($edges);
$connection->setTotalCount(10);
...
$edge->setCursor($cursor);
$edge->setNode($node);

Connection builder has been moved and it methods are no more accessible statically:

Before:

use Overblog\GraphQLBundle\Relay\Connection\Output\ConnectionBuilder;

ConnectionBuilder::connectionFromArray([]);

After:

use Overblog\GraphQLBundle\Relay\Connection\ConnectionBuilder;

$connectionBuilder = new ConnectionBuilder();
$connectionBuilder->connectionFromArray([]);

Remove obsoletes deprecations

The builder short syntax (Field: Builder => Field: {builder: Builder}) is obsolete:

Foo:
    type: object
    config:
        fields:
-            bar: MyBuilder
+            bar: {builder: MyBuilder}

Relay builder without 'Relay::' prefix is obsolete:

Foo:
    type: object
    config:
        fields:
            bar:
-                argsBuilder: ConnectionArgs
+                argsBuilder: "Relay::Connection"

Simplify executor interface

This section is only for users using custom executor.

The interface move to be look a little be more to GraphQL\GraphQL promiseToExecute method.

In Overblog\GraphQLBundle\Executor\ExecutorInterface setPromiseAdapter and setDefaultFieldResolver has been removed.

Promise adapter is now the first argument ($promiseAdapter) and default field resolver the 7th argument ($fieldResolver) of Overblog\GraphQLBundle\Executor\ExecutorInterface::execute method.