|
2 | 2 | namespace TheCodingMachine\GraphQL\Controllers; |
3 | 3 |
|
4 | 4 | use GraphQL\GraphQL; |
5 | | -use Mouf\GraphQL\Schema; |
| 5 | +use Youshido\GraphQL\Schema\AbstractSchema; |
6 | 6 | use Psr\Http\Message\ResponseInterface; |
7 | 7 | use Psr\Http\Message\ServerRequestInterface; |
8 | 8 | use Youshido\GraphQL\Execution\Processor; |
@@ -33,18 +33,14 @@ class GraphQLMiddleware implements \Interop\Http\ServerMiddleware\MiddlewareInte |
33 | 33 | * @var Processor |
34 | 34 | */ |
35 | 35 | private $schema; |
36 | | - /** |
37 | | - * @var null |
38 | | - */ |
39 | | - private $rootUrl; |
40 | 36 |
|
41 | 37 | /** |
42 | 38 | * GraphQLMiddleware constructor. |
43 | 39 | * |
44 | | - * @param Schema $schema |
| 40 | + * @param AbstractSchema $schema |
45 | 41 | * @param string $graphqlUri |
46 | 42 | */ |
47 | | - public function __construct(Schema $schema, $graphqlUri = '/graphql', $rootUrl = null) |
| 43 | + public function __construct(AbstractSchema $schema, $graphqlUri = '/graphql', $rootUrl = null) |
48 | 44 | { |
49 | 45 | $this->schema = $schema; |
50 | 46 | $this->graphqlUri = rtrim($rootUrl, '/').'/'. ltrim($graphqlUri, '/'); |
@@ -74,7 +70,7 @@ public function process(\Psr\Http\Message\ServerRequestInterface $request, \Inte |
74 | 70 | list($query, $variables) = $this->getPayload($request); |
75 | 71 |
|
76 | 72 |
|
77 | | - $processor = new Processor($this->schema->toGraphQLSchema()); |
| 73 | + $processor = new Processor($this->schema); |
78 | 74 | $processor->processPayload($query, $variables); |
79 | 75 | $res = $processor->getResponseData(); |
80 | 76 | return new JsonResponse($res); |
|
0 commit comments