WIP allow processing routes with no response
This commit is contained in:
parent
9d2aad1134
commit
7689f7ef6f
2 changed files with 2 additions and 9 deletions
|
@ -329,16 +329,10 @@ class Builder
|
||||||
$methodName = $namespace . \ucfirst($route->getLabel('sdk.method', ''));
|
$methodName = $namespace . \ucfirst($route->getLabel('sdk.method', ''));
|
||||||
$responseModelNames = $route->getLabel('sdk.response.model', "none");
|
$responseModelNames = $route->getLabel('sdk.response.model', "none");
|
||||||
|
|
||||||
if ($responseModelNames === "none") {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
$responseModels = \is_array($responseModelNames)
|
$responseModels = \is_array($responseModelNames)
|
||||||
? \array_map(static fn($m) => $response->getModel($m), $responseModelNames)
|
? \array_map(static fn($m) => $response->getModel($m), $responseModelNames)
|
||||||
: [$response->getModel($responseModelNames)];
|
: [$response->getModel($responseModelNames)];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach ($responseModels as $responseModel) {
|
foreach ($responseModels as $responseModel) {
|
||||||
$type = self::getModelTypeMapping($responseModel, $response);
|
$type = self::getModelTypeMapping($responseModel, $response);
|
||||||
$description = $route->getDesc();
|
$description = $route->getDesc();
|
||||||
|
|
|
@ -159,11 +159,10 @@ class GraphQLServerTest extends Scope
|
||||||
|
|
||||||
$errorMessage = 'User (role: guest) missing scope (users.write)';
|
$errorMessage = 'User (role: guest) missing scope (users.write)';
|
||||||
$this->assertEquals($errorMessage, $user['body']['errors'][0]['message']);
|
$this->assertEquals($errorMessage, $user['body']['errors'][0]['message']);
|
||||||
$this->assertIsArray($user['body']['data']);
|
$this->assertArrayNotHasKey('data', $user['body']);
|
||||||
$this->assertNull($user['body']['data']['users_deleteUser']);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete the user with the reqiured scopes
|
* Delete the user with the required scopes
|
||||||
*/
|
*/
|
||||||
$key = $this->getNewKey(['users.write']);
|
$key = $this->getNewKey(['users.write']);
|
||||||
$user = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([
|
$user = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([
|
||||||
|
|
Loading…
Reference in a new issue