Is your feature request related to a problem? Please describe.
I'm loading several pages from graphql api and need to do it asynchronously in order to make it faster
Describe the solution you'd like
Still am not sure. Investigating, though it seems it would need a large rework.
I'm calling gql api using PSR Request through async client. Trying to do the same with Sailor is not possible rn.
E.g. Symfony HTTP client has async requests by default but Response makes it blocking since it reads status code and contents right after calling client.
|
public static function fromResponseInterface(ResponseInterface $response): self |
|
{ |
|
if ($response->getStatusCode() !== 200) { |
|
throw new InvalidResponseException("Response must have status code 200, got: {$response->getStatusCode()}"); |
|
} |
|
|
|
return self::fromJson( |
|
$response->getBody()->getContents() |
|
); |
|
} |
Is your feature request related to a problem? Please describe.
I'm loading several pages from graphql api and need to do it asynchronously in order to make it faster
Describe the solution you'd like
Still am not sure. Investigating, though it seems it would need a large rework.
I'm calling gql api using PSR Request through async client. Trying to do the same with Sailor is not possible rn.
E.g. Symfony HTTP client has async requests by default but
Responsemakes it blocking since it reads status code and contents right after calling client.sailor/src/Response.php
Lines 38 to 47 in 44678a8