Browse Source

returns proper constructors

Cerys Lewis 5 months ago
parent
commit
1cd138b3bd
  1. 4
      src/QueryInstance/GrantQuery.php
  2. 3
      src/QueryInstance/InsertQuery.php
  3. 2
      src/QueryInstance/PutQuery.php

4
src/QueryInstance/GrantQuery.php

@ -9,13 +9,13 @@ use Darksparrow\DeegraphInteractions\Superclasses\QueryInstanceSuperclass;
final class GrantQuery extends QueryInstanceSuperclass implements QueryInstanceInterface final class GrantQuery extends QueryInstanceSuperclass implements QueryInstanceInterface
{ {
public function RunQuery(DeegraphServer $deegraphServer) public function RunQuery(DeegraphServer $deegraphServer): GrantQueryResponse
{ {
$response = $deegraphServer->RunRawRequest( $response = $deegraphServer->RunRawRequest(
endpoint: "/api/v1/@query", endpoint: "/api/v1/@query",
method: "POST", method: "POST",
body: $this->QueryString, body: $this->QueryString,
); );
return GrantQueryResponse::FromAPIResponse(response: $response); return new GrantQueryResponse(response: $response);
} }
} }

3
src/QueryInstance/InsertQuery.php

@ -3,6 +3,7 @@
namespace Darksparrow\DeegraphInteractions\QueryInstance; namespace Darksparrow\DeegraphInteractions\QueryInstance;
use Darksparrow\DeegraphInteractions\Core\DeegraphServer; use Darksparrow\DeegraphInteractions\Core\DeegraphServer;
use Darksparrow\DeegraphInteractions\Interfaces\QueryInstanceInterface;
use Darksparrow\DeegraphInteractions\QueryResponse\InsertQueryResponse; use Darksparrow\DeegraphInteractions\QueryResponse\InsertQueryResponse;
use Darksparrow\DeegraphInteractions\Superclasses\QueryInstanceSuperclass; use Darksparrow\DeegraphInteractions\Superclasses\QueryInstanceSuperclass;
@ -15,6 +16,6 @@ final class InsertQuery extends QueryInstanceSuperclass implements QueryInstance
method: "POST", method: "POST",
body: $this->QueryString, body: $this->QueryString,
); );
return InsertQueryResponse::FromAPIResponse(response: $response); return new InsertQueryResponse(response: $response);
} }
} }

2
src/QueryInstance/PutQuery.php

@ -16,6 +16,6 @@ final class PutQuery extends QueryInstanceSuperclass implements QueryResponseInt
method: "POST", method: "POST",
body: $this->QueryString, body: $this->QueryString,
); );
return PutQueryResponse::FromAPIResponse(response: $response); return new PutQueryResponse(response: $response);
} }
} }

Loading…
Cancel
Save