Skip to content

Commit c62b949

Browse files
committed
229: [GraphQL caching] Add support for queries via HTTP GET
- This reverts commit d193913.
1 parent d193913 commit c62b949

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

dev/tests/api-functional/framework/Magento/TestFramework/TestCase/GraphQl/Client.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,12 @@ public function postQuery(string $query, array $variables = [], string $operatio
6666
$responseBodyArray = $this->json->jsonDecode($responseBody);
6767

6868
if (!is_array($responseBodyArray)) {
69-
//phpcs:ignore Magento2.Exceptions.DirectThrow
7069
throw new \Exception('Unknown GraphQL response body: ' . json_encode($responseBodyArray));
7170
}
7271

7372
$this->processErrors($responseBodyArray);
7473

7574
if (!isset($responseBodyArray['data'])) {
76-
//phpcs:ignore Magento2.Exceptions.DirectThrow
7775
throw new \Exception('Unknown GraphQL response body: ' . json_encode($responseBodyArray));
7876
} else {
7977
return $responseBodyArray['data'];
@@ -103,14 +101,12 @@ public function getQuery(string $query, array $variables = [], string $operation
103101
$responseBodyArray = $this->json->jsonDecode($responseBody);
104102

105103
if (!is_array($responseBodyArray)) {
106-
//phpcs:ignore Magento2.Exceptions.DirectThrow
107104
throw new \Exception('Unknown GraphQL response body: ' . json_encode($responseBodyArray));
108105
}
109106

110107
$this->processErrors($responseBodyArray);
111108

112109
if (!isset($responseBodyArray['data'])) {
113-
//phpcs:ignore Magento2.Exceptions.DirectThrow
114110
throw new \Exception('Unknown GraphQL response body: ' . json_encode($responseBodyArray));
115111
} else {
116112
return $responseBodyArray['data'];
@@ -146,7 +142,6 @@ private function processErrors($responseBodyArray)
146142
$responseBodyArray
147143
);
148144
}
149-
//phpcs:ignore Magento2.Exceptions.DirectThrow
150145
throw new \Exception('GraphQL responded with an unknown error: ' . json_encode($responseBodyArray));
151146
}
152147
}

dev/tests/api-functional/framework/Magento/TestFramework/TestCase/GraphQlAbstract.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ public function graphQlQuery(
6161
$this->composeHeaders($headers)
6262
);
6363
} else {
64-
//phpcs:ignore Magento2.Exceptions.DirectThrow
6564
throw new \Exception("Unsupported request type");
6665
}
6766

dev/tests/integration/testsuite/Magento/Framework/GraphQl/Config/GraphQlReaderTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ protected function setUp()
4545
\Magento\Framework\Config\FileResolverInterface::class
4646
)->disableOriginalConstructor()->getMock();
4747
$fileList = [
48-
//phpcs:ignore Magento2.Functions.DiscouragedFunction
4948
file_get_contents(__DIR__ . '/../_files/schemaA.graphqls'),
50-
//phpcs:ignore Magento2.Functions.DiscouragedFunction
5149
file_get_contents(__DIR__ . '/../_files/schemaB.graphqls')
5250
];
5351
$fileResolverMock->expects($this->any())->method('get')->will($this->returnValue($fileList));
@@ -187,7 +185,6 @@ enumValues(includeDeprecated: true) {
187185
$request->setHeaders($headers);
188186
$response = $this->graphQlController->dispatch($request);
189187
$output = $this->jsonSerializer->unserialize($response->getContent());
190-
//phpcs:ignore Magento2.Security.IncludeFile
191188
$expectedOutput = require __DIR__ . '/../_files/schema_response_sdl_description.php';
192189

193190
$schemaResponseFields = $output['data']['__schema']['types'];

dev/tests/integration/testsuite/Magento/GraphQl/Controller/GraphQlControllerTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ class GraphQlControllerTest extends \Magento\TestFramework\Indexer\TestCase
3838
/** @var MetadataPool */
3939
private $metadataPool;
4040

41-
//phpcs:ignore Magento2.Functions.StaticFunction
4241
public static function setUpBeforeClass()
4342
{
4443
$db = Bootstrap::getInstance()->getBootstrap()
@@ -266,4 +265,12 @@ public function testError() : void
266265
}
267266
}
268267
}
268+
269+
/**
270+
* teardown
271+
*/
272+
public function tearDown()
273+
{
274+
parent::tearDown();
275+
}
269276
}

0 commit comments

Comments
 (0)