Skip to content

Commit 4e1230f

Browse files
committed
Use schema_errors instead of errors to save Drupal -> GraphQL type errors
1 parent 3417fb6 commit 4e1230f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

includes/graphql_api_page_callback.inc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ function graphql_api_page_callback() {
4949
);
5050

5151
if (!empty($schemaBuilder->errors)) {
52-
$result['errors'] = isset($result['errors']) ? $result['errors'] : [];
53-
$result['errors'] += $schemaBuilder->errors;
54-
$result['errors'] = array_unique($result['errors']);
52+
$result['schema_errors'] = $schemaBuilder->errors;
5553
}
5654

5755
if ($is_introspec) {
@@ -65,7 +63,7 @@ function graphql_api_page_callback() {
6563
]
6664
];
6765
}
68-
66+
6967
drupal_json_output($result);
7068
exit;
7169
}

0 commit comments

Comments
 (0)