-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 't3n:master' into task/closure-callback-support-only
- Loading branch information
Showing
17 changed files
with
342 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: 1 | ||
update_configs: | ||
- package_manager: "php:composer" | ||
directory: "/" | ||
update_schedule: "weekly" | ||
target_branch: "master" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace t3n\GraphQL\Exception; | ||
|
||
use Neos\Flow\Exception; | ||
|
||
class InvalidResolverException extends Exception | ||
{ | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace t3n\GraphQL\Http; | ||
|
||
use GuzzleHttp\Psr7\Response; | ||
use Neos\Flow\Annotations as Flow; | ||
use Psr\Http\Message\ResponseInterface; | ||
use Psr\Http\Message\ServerRequestInterface; | ||
use Psr\Http\Server\MiddlewareInterface; | ||
use Psr\Http\Server\RequestHandlerInterface; | ||
|
||
class HttpOptionsMiddleware implements MiddlewareInterface | ||
{ | ||
/** | ||
* @Flow\InjectConfiguration("endpoints") | ||
* | ||
* @var mixed[] | ||
*/ | ||
protected $endpoints; | ||
|
||
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface | ||
{ | ||
if ($request->getMethod() !== 'OPTIONS') { | ||
return $handler->handle($request); | ||
} | ||
|
||
// We explode the request target because custom routes like /some/custom/route/<endpoint> are | ||
// are common. So we double check here if the last part in the route matches a configured | ||
// endpoint | ||
$endpoint = explode('/', ltrim($request->getRequestTarget(), '\/')); | ||
|
||
if (! isset($this->endpoints[end($endpoint)])) { | ||
return $handler->handle($request); | ||
} | ||
|
||
return new Response(200, ['Content-Type' => 'application/json', 'Allow' => 'GET, POST'], json_encode(['success' => true])); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace t3n\GraphQL; | ||
|
||
interface ResolverGeneratorInterface | ||
{ | ||
/** | ||
* Should return a map with this structure: | ||
* | ||
* return [ | ||
* ['typeName' => \Resolver\Class\Name] | ||
* ]; | ||
* | ||
* @return mixed[] | ||
*/ | ||
public function generate(): array; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.