File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1717use GraphQL \Server \ServerConfig ;
1818use GraphQL \Server \StandardServer ;
1919use GraphQL \Upload \UploadMiddleware ;
20+ use function class_exists ;
2021use function json_decode ;
2122use Psr \Http \Message \ServerRequestInterface ;
2223use RuntimeException ;
@@ -83,8 +84,10 @@ public function handleRequest(Request $request): Response
8384 }
8485
8586 // Let's parse the request and adapt it for file uploads.
86- $ uploadMiddleware = new UploadMiddleware ();
87- $ psr7Request = $ uploadMiddleware ->processRequest ($ psr7Request );
87+ if (class_exists (UploadMiddleware::class)) {
88+ $ uploadMiddleware = new UploadMiddleware ();
89+ $ psr7Request = $ uploadMiddleware ->processRequest ($ psr7Request );
90+ }
8891
8992 return $ this ->handlePsr7Request ($ psr7Request , $ request );
9093 }
You can’t perform that action at this time.
0 commit comments