Skip to content

Commit 8b73fed

Browse files
mahesh-singh-rajawatfaizan-shk
authored andcommitted
AC-7422:Incompatible issues fix for PHP8.2-fixed integration of graphql
1 parent 8dae34e commit 8b73fed

File tree

4 files changed

+54
-4
lines changed

4 files changed

+54
-4
lines changed

lib/internal/Magento/Framework/GraphQl/Exception/GraphQlAlreadyExistsException.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@
88
namespace Magento\Framework\GraphQl\Exception;
99

1010
use GraphQL\Error\ClientAware;
11+
use GraphQL\Error\ProvidesExtensions;
1112
use Magento\Framework\Exception\AlreadyExistsException;
1213
use Magento\Framework\Phrase;
1314

1415
/**
1516
* Exception for GraphQL to be thrown when data already exists
1617
*/
17-
class GraphQlAlreadyExistsException extends AlreadyExistsException implements ClientAware
18+
class GraphQlAlreadyExistsException extends AlreadyExistsException implements ClientAware, ProvidesExtensions
1819
{
1920
/**
2021
* Describing a category of the error
@@ -53,4 +54,15 @@ public function getCategory(): string
5354
{
5455
return self::EXCEPTION_CATEGORY;
5556
}
57+
58+
/**
59+
* Get error category
60+
*
61+
* @return array
62+
*/
63+
public function getExtensions(): array
64+
{
65+
$exceptionCategory['category'] = $this->getCategory();
66+
return $exceptionCategory;
67+
}
5668
}

lib/internal/Magento/Framework/GraphQl/Exception/GraphQlAuthenticationException.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
namespace Magento\Framework\GraphQl\Exception;
99

1010
use GraphQL\Error\ClientAware;
11+
use GraphQL\Error\ProvidesExtensions;
1112
use Magento\Framework\Exception\AuthenticationException;
1213
use Magento\Framework\Phrase;
1314

@@ -16,7 +17,7 @@
1617
*
1718
* @api
1819
*/
19-
class GraphQlAuthenticationException extends AuthenticationException implements ClientAware
20+
class GraphQlAuthenticationException extends AuthenticationException implements ClientAware, ProvidesExtensions
2021
{
2122
/**
2223
* Describing a category of the error
@@ -55,4 +56,15 @@ public function getCategory(): string
5556
{
5657
return self::EXCEPTION_CATEGORY;
5758
}
59+
60+
/**
61+
* Get error category
62+
*
63+
* @return array
64+
*/
65+
public function getExtensions(): array
66+
{
67+
$exceptionCategory['category'] = $this->getCategory();
68+
return $exceptionCategory;
69+
}
5870
}

lib/internal/Magento/Framework/GraphQl/Exception/GraphQlAuthorizationException.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
namespace Magento\Framework\GraphQl\Exception;
99

10+
use GraphQL\Error\ClientAware;
11+
use GraphQL\Error\ProvidesExtensions;
1012
use Magento\Framework\Phrase;
1113
use Magento\Framework\Exception\AuthorizationException;
1214

@@ -15,7 +17,7 @@
1517
*
1618
* @api
1719
*/
18-
class GraphQlAuthorizationException extends AuthorizationException implements \GraphQL\Error\ClientAware
20+
class GraphQlAuthorizationException extends AuthorizationException implements ClientAware, ProvidesExtensions
1921
{
2022
const EXCEPTION_CATEGORY = 'graphql-authorization';
2123

@@ -53,4 +55,15 @@ public function getCategory() : string
5355
{
5456
return self::EXCEPTION_CATEGORY;
5557
}
58+
59+
/**
60+
* Get error category
61+
*
62+
* @return array
63+
*/
64+
public function getExtensions(): array
65+
{
66+
$exceptionCategory['category'] = $this->getCategory();
67+
return $exceptionCategory;
68+
}
5669
}

lib/internal/Magento/Framework/GraphQl/Exception/GraphQlInputException.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
namespace Magento\Framework\GraphQl\Exception;
99

10+
use GraphQL\Error\ProvidesExtensions;
1011
use Magento\Framework\Exception\AggregateExceptionInterface;
1112
use Magento\Framework\Exception\LocalizedException;
1213
use Magento\Framework\Phrase;
@@ -17,7 +18,8 @@
1718
*
1819
* @api
1920
*/
20-
class GraphQlInputException extends LocalizedException implements AggregateExceptionInterface, ClientAware
21+
class GraphQlInputException extends LocalizedException
22+
implements AggregateExceptionInterface, ClientAware, ProvidesExtensions
2123
{
2224
const EXCEPTION_CATEGORY = 'graphql-input';
2325

@@ -84,4 +86,15 @@ public function getErrors(): array
8486
{
8587
return $this->errors;
8688
}
89+
90+
/**
91+
* Get error category
92+
*
93+
* @return array
94+
*/
95+
public function getExtensions(): array
96+
{
97+
$exceptionCategory['category'] = $this->getCategory();
98+
return $exceptionCategory;
99+
}
87100
}

0 commit comments

Comments
 (0)