-
Notifications
You must be signed in to change notification settings - Fork 43
👽 Support ecodev/graphql-upload v8 #268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
07a4a76 to
00e934b
Compare
00e934b to
5114346
Compare
| */ | ||
| class RequestExtractorMiddleware implements RequestHandlerInterface | ||
| { | ||
| public function handle(ServerRequestInterface $request): ResponseInterface |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
| use Psr\Http\Message\ServerRequestInterface; | ||
|
|
||
| /** | ||
| * Class used to allow extraction of request from PSR-15 middleware |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please mark introduced classes with @internal tag to avoid using them from the outside
| $psr7Request = $uploadMiddleware->processRequest($psr7Request); | ||
| \assert($psr7Request instanceof ServerRequestInterface); | ||
| $dummyResponseWithRequest = $uploadMiddleware->process($psr7Request, new RequestExtractorMiddleware()); | ||
| assert($dummyResponseWithRequest instanceof DummyResponseWithRequest); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is not so strict as to be sure that you will have a DummyResponseWithRequest instance.
I suggest to use if + throw in case of unexpected result
|
|
||
| /** | ||
| * Listens to every single request and forward Graphql requests to Graphql Webonix standardServer. | ||
| * Listens to every single request and forwards GraphQL requests to Webonyx's \GraphQL\Server\StandardServer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * Listens to every single request and forwards GraphQL requests to Webonyx's \GraphQL\Server\StandardServer. | |
| * Listens to every single request and forwards GraphQL requests to Webonyx's {@see \GraphQL\Server\StandardServer}. |
I'm OK with introducing it for the v6, we too had problems with update graphqlite to v8. Let's retarget to |
Fixes #259
Note that there are two alternative implementations:
Note that the anonymous class declaration is rather verbose and would have been simplified by https://wiki.php.net/rfc/property-capture
DummyResponseWithRequestallowing us to extract the ecodev/graphql-upload psr7 request from the middleware chain to allow passing it in our previous symfony flow.@andrew-demb note that I would like this for the v6 of this package, how would you like to proceed?