Skip to content

Commit d0a3bc6

Browse files
Updated all dependencies :-D
1 parent 5b64efb commit d0a3bc6

13 files changed

Lines changed: 25 additions & 1964 deletions

File tree

api/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:7.3-alpine
1+
FROM php:8.1-alpine
22
WORKDIR /app
33
ENV PORT=3000
44
COPY . .

api/app.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,17 @@
22
declare(strict_types=1);
33

44
use Psr\Http\Message\ServerRequestInterface;
5-
use React\EventLoop\Factory;
6-
use React\Http\Response;
7-
use React\Http\Server;
5+
use React\Http\Message\Response;
6+
use React\Http\HttpServer;
87

9-
use Clue\React\Buzz\Browser;
10-
use Psr\Http\Message\ResponseInterface;
8+
use React\Http\Browser;
119

1210
use GraphQL\GraphQL;
1311
use GraphQL\Executor\ExecutionResult;
1412
use GraphQL\Executor\Promise\Adapter\ReactPromiseAdapter;
1513

1614
require __DIR__ . '/vendor/autoload.php';
1715

18-
$loop = Factory::create();
1916
$browser = new Browser($loop);
2017

2118
require __DIR__ . '/schema.php';
@@ -24,7 +21,7 @@
2421
// in this case it's ReactPHP
2522
$react = new ReactPromiseAdapter();
2623

27-
$server = new Server(function (ServerRequestInterface $request) use ($schema, $react) {
24+
$server = new HttpServer(function (ServerRequestInterface $request) use ($schema, $react) {
2825
// GraphQL Input is "just" a JSON-String
2926
$input = json_decode((string)$request->getBody(), true);
3027
$query = $input['query'];
@@ -43,7 +40,6 @@
4340
);
4441
});
4542
});
46-
$socket = new \React\Socket\Server('0.0.0.0:' . getenv('PORT'), $loop);
43+
$socket = new \React\Socket\SocketServer('0.0.0.0:' . getenv('PORT'));
4744
$server->listen($socket);
4845
echo 'Listening on ' . str_replace('tcp:', 'http:', $socket->getAddress()) . PHP_EOL;
49-
$loop->run();

api/composer.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"require": {
3-
"react/http": "^0.8.4",
4-
"webonyx/graphql-php": "^0.13",
5-
"clue/buzz-react": "^2"
3+
"react/http": "^1.5.0",
4+
"webonyx/graphql-php": "^14.11.3"
65
}
76
}

0 commit comments

Comments
 (0)