Skip to content

Commit 7b307a6

Browse files
committed
Merge branch 'master' of github.com:thecodingmachine/graphql-controllers
2 parents c6eb386 + ba1e451 commit 7b307a6

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

src/AggregateControllerQueryProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function getQueries(): array
6969

7070
foreach ($this->controllers as $controllerName) {
7171
$controller = $this->container->get($controllerName);
72-
$queryProvider = new ControllerQueryProvider($controller, $this->container, $this->annotationReader, $this->typeMapper, $this->hydrator);
72+
$queryProvider = new ControllerQueryProvider($controller, $this->annotationReader, $this->typeMapper, $this->hydrator);
7373
$queryList = array_merge($queryList, $queryProvider->getQueries());
7474
}
7575

src/GraphQLMiddleware.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
namespace TheCodingMachine\GraphQL\Controllers;
33

44
use GraphQL\GraphQL;
5-
use Mouf\GraphQL\Schema;
5+
use Youshido\GraphQL\Schema\AbstractSchema;
66
use Psr\Http\Message\ResponseInterface;
77
use Psr\Http\Message\ServerRequestInterface;
88
use Youshido\GraphQL\Execution\Processor;
@@ -33,18 +33,14 @@ class GraphQLMiddleware implements \Interop\Http\ServerMiddleware\MiddlewareInte
3333
* @var Processor
3434
*/
3535
private $schema;
36-
/**
37-
* @var null
38-
*/
39-
private $rootUrl;
4036

4137
/**
4238
* GraphQLMiddleware constructor.
4339
*
44-
* @param Schema $schema
40+
* @param AbstractSchema $schema
4541
* @param string $graphqlUri
4642
*/
47-
public function __construct(Schema $schema, $graphqlUri = '/graphql', $rootUrl = null)
43+
public function __construct(AbstractSchema $schema, $graphqlUri = '/graphql', $rootUrl = null)
4844
{
4945
$this->schema = $schema;
5046
$this->graphqlUri = rtrim($rootUrl, '/').'/'. ltrim($graphqlUri, '/');
@@ -74,7 +70,7 @@ public function process(\Psr\Http\Message\ServerRequestInterface $request, \Inte
7470
list($query, $variables) = $this->getPayload($request);
7571

7672

77-
$processor = new Processor($this->schema->toGraphQLSchema());
73+
$processor = new Processor($this->schema);
7874
$processor->processPayload($query, $variables);
7975
$res = $processor->getResponseData();
8076
return new JsonResponse($res);

src/Schema.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ class Schema extends AbstractSchema
2121

2222
public function __construct(QueryProviderInterface $queryProvider, array $config = [])
2323
{
24-
parent::__construct($config);
2524
$this->queryProvider = $queryProvider;
25+
parent::__construct($config);
2626
}
2727

2828
public function build(SchemaConfig $config)

0 commit comments

Comments
 (0)