Skip to content

Commit f6c49e2

Browse files
committed
fix(executor): Remove swapped errors compatibility mode
1 parent 8687673 commit f6c49e2

4 files changed

Lines changed: 3 additions & 28 deletions

File tree

config/install/graphql.settings.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

config/schema/graphql.schema.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
graphql.settings:
2-
type: config_object
3-
label: "GraphQL Settings"
4-
mapping:
5-
deprecated_swap_errors_and_extensions_in_results:
6-
type: boolean
7-
label: "Return `errors` in the GraphQL response `extension` key and vice versa"
8-
description: "Preserves behaviour that was caused by a bug that caused errors to appear in the extensions key of GraphQL results. Ensures misbehaving client implementations don't break by fixing this bug. Will be removed in 5.0.0"
9-
101
graphql.graphql_servers.*:
112
type: config_entity
123
label: 'Server'

graphql.install

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,7 @@ function graphql_update_8001(): void {
6565
}
6666

6767
/**
68-
* Preserve incorrect error reporting behaviour for PR #1161.
68+
* Empty update that was removed again.
6969
*/
7070
function graphql_update_8400() :void {
71-
\Drupal::configFactory()->getEditable('graphql.settings')
72-
->set('deprecated_swap_errors_and_extensions_in_results', TRUE)
73-
->save();
7471
}

src/GraphQL/Execution/Executor.php

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -223,13 +223,7 @@ public function doExecute(): Promise {
223223
return $this->doExecuteUncached()->then(function ($result) {
224224
$this->context->mergeCacheMaxAge(0);
225225

226-
// @todo keep only else case in 5.0.0.
227-
if (\Drupal::config('graphql.settings')->get('deprecated_swap_errors_and_extensions_in_results')) {
228-
$result = new CacheableExecutionResult($result->data, $result->extensions, $result->errors);
229-
}
230-
else {
231-
$result = new CacheableExecutionResult($result->data, $result->errors, $result->extensions);
232-
}
226+
$result = new CacheableExecutionResult($result->data, $result->errors, $result->extensions);
233227
$result->addCacheableDependency($this->context);
234228
return $result;
235229
});
@@ -252,13 +246,7 @@ protected function doExecuteCached($prefix) {
252246
$this->context->mergeCacheMaxAge(0);
253247
}
254248

255-
// @todo keep only else case in 5.0.0.
256-
if (\Drupal::config('graphql.settings')->get('deprecated_swap_errors_and_extensions_in_results')) {
257-
$result = new CacheableExecutionResult($result->data, $result->extensions, $result->errors);
258-
}
259-
else {
260-
$result = new CacheableExecutionResult($result->data, $result->errors, $result->extensions);
261-
}
249+
$result = new CacheableExecutionResult($result->data, $result->errors, $result->extensions);
262250
$result->addCacheableDependency($this->context);
263251
if ($result->getCacheMaxAge() !== 0) {
264252
$this->cacheWrite($prefix, $result);

0 commit comments

Comments
 (0)