diff --git a/changes.md b/changes.md
index 107e80c15e4..c2f8369d30e 100644
--- a/changes.md
+++ b/changes.md
@@ -1,104 +1,15 @@
-**Api changes**
-
-Changed Property(s)
-
-- :warning: changed property `exact` of type `SearchExactExpression` from type `SearchAnyValue` to `SearchExactValue`
-Added Property(s)
-
-- added property `applicationMode` to type `CartDiscountValueFixed`
-- added property `applicationMode` to type `CartDiscountValueFixedDraft`
-- added property `custom` to type `CartSetCustomShippingMethodAction`
-- added property `custom` to type `StagedOrderSetCustomShippingMethodAction`
-- added property `custom` to type `StagedOrderSetShippingAddressAndCustomShippingMethodAction`
-- added property `businessUnits` to type `SearchIndexingConfiguration`
-Added Resource(s)
-
-- added resource `/{projectKey}/business-units/search`
-- added resource `/{projectKey}/business-units/search/indexing-status`
-- added resource `/{projectKey}/channels/key={key}`
-Added Method(s)
-
-- added method `$apiRoot->withProjectKey()->businessUnits()->search()->post()`
-- added method `$apiRoot->withProjectKey()->businessUnits()->search()->head()`
-- added method `$apiRoot->withProjectKey()->businessUnits()->searchIndexingStatus()->get()`
-- added method `$apiRoot->withProjectKey()->channels()->withKey()->get()`
-- added method `$apiRoot->withProjectKey()->channels()->withKey()->head()`
-- added method `$apiRoot->withProjectKey()->channels()->withKey()->post()`
-- added method `$apiRoot->withProjectKey()->channels()->withKey()->delete()`
-Added Type(s)
-
-- added type `BusinessUnitIndexingProgress`
-- added type `BusinessUnitIndexingStatus`
-- added type `BusinessUnitPagedSearchResponse`
-- added type `BusinessUnitSearchIndexingStatusResponse`
-- added type `BusinessUnitSearchRequest`
-- added type `BusinessUnitSearchResult`
-- added type `CartDiscountPatternTarget`
-- added type `CountOnCustomLineItemUnits`
-- added type `CountOnLineItemUnits`
-- added type `PatternComponent`
-- added type `ShoppingListLineItemAddedMessage`
-- added type `ShoppingListLineItemRemovedMessage`
-- added type `ShoppingListMessage`
-- added type `ShoppingListLineItemAddedMessagePayload`
-- added type `ShoppingListLineItemRemovedMessagePayload`
-- added type `ShoppingListMessagePayload`
-- added type `BusinessUnitSearchStatus`
-- added type `ProjectChangeBusinessUnitSearchStatusAction`
-- added type `SearchExactValue`
-Added Enum(s)
-
-- added enum `Canceled` to type `ShipmentState`
-- added enum `shopping-list` to type `MessageSubscriptionResourceTypeId`
-Added Resource(s)
-
-- added resource `/{projectKey}/graphql`
-Added Method(s)
+Changed Property(s)
-- added method `$apiRoot->withProjectKeyValue()->graphql()->post()`
+- :warning: changed property `extensions` of type `GraphQLError` from type `GraphQLErrorObject` to `object`
Added Type(s)
+Removed Type(s)
-- added type `GraphQLRequest`
-- added type `GraphQLResponse`
-- added type `GraphQLError`
-- added type `GraphQLErrorLocation`
-- added type `GraphQLVariablesMap`
-- added type `GraphQLErrorObject`
-- added type `ChangeTargetPatternChangeValue`
-- added type `PatternComponent`
+- :warning: removed type `GraphQLErrorObject`
One of the error codes that is listed on the Errors page.
- * - * - * @return null|string - */ - public function getCode() - { - if (is_null($this->code)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_CODE); - if (is_null($data)) { - return null; - } - $this->code = (string) $data; - } - - return $this->code; - } - - - - /** - * @return mixed - */ - public function by(string $key) - { - $data = $this->raw($key); - if (is_null($data)) { - return null; - } - if (preg_match(GraphQLErrorObject::FIELD_PATTERN1, $key) === 1) { - /** @psalm-var stdClass $data */ - return JsonObjectModel::of($data); - } - - return $data; - } - - - /** - * @psalm-param stdClass|arrayDictionary with additional information where applicable.
* - * @return null|GraphQLErrorObject + * @return null|mixed */ public function getExtensions(); @@ -68,7 +67,7 @@ public function setLocations(?GraphQLErrorLocationCollection $locations): void; public function setPath(?array $path): void; /** - * @param ?GraphQLErrorObject $extensions + * @param ?JsonObject $extensions */ - public function setExtensions(?GraphQLErrorObject $extensions): void; + public function setExtensions(?JsonObject $extensions): void; } diff --git a/lib/commercetools-history/src/Models/GraphQl/GraphQLErrorBuilder.php b/lib/commercetools-history/src/Models/GraphQl/GraphQLErrorBuilder.php index 95278d33a16..05b6b0e07d1 100644 --- a/lib/commercetools-history/src/Models/GraphQl/GraphQLErrorBuilder.php +++ b/lib/commercetools-history/src/Models/GraphQl/GraphQLErrorBuilder.php @@ -14,8 +14,6 @@ use Commercetools\Base\JsonObjectModel; use Commercetools\Base\MapperFactory; use stdClass; -use Commercetools\History\Models\Error\GraphQLErrorObject; -use Commercetools\History\Models\Error\GraphQLErrorObjectBuilder; /** * @implements BuilderDictionary with additional information where applicable.
* - * @return null|GraphQLErrorObject + * @return null|JsonObject */ public function getExtensions() { - return $this->extensions instanceof GraphQLErrorObjectBuilder ? $this->extensions->build() : $this->extensions; + return $this->extensions; } /** @@ -124,26 +122,16 @@ public function withPath(?array $path) } /** - * @param ?GraphQLErrorObject $extensions + * @param ?JsonObject $extensions * @return $this */ - public function withExtensions(?GraphQLErrorObject $extensions) + public function withExtensions(?JsonObject $extensions) { $this->extensions = $extensions; return $this; } - /** - * @deprecated use withExtensions() instead - * @return $this - */ - public function withExtensionsBuilder(?GraphQLErrorObjectBuilder $extensions) - { - $this->extensions = $extensions; - - return $this; - } public function build(): GraphQLError { @@ -151,7 +139,7 @@ public function build(): GraphQLError $this->message, $this->locations, $this->path, - $this->extensions instanceof GraphQLErrorObjectBuilder ? $this->extensions->build() : $this->extensions + $this->extensions ); } diff --git a/lib/commercetools-history/src/Models/GraphQl/GraphQLErrorModel.php b/lib/commercetools-history/src/Models/GraphQl/GraphQLErrorModel.php index 090b2f8d31b..a6d2c7ba24e 100644 --- a/lib/commercetools-history/src/Models/GraphQl/GraphQLErrorModel.php +++ b/lib/commercetools-history/src/Models/GraphQl/GraphQLErrorModel.php @@ -13,8 +13,6 @@ use Commercetools\Base\JsonObjectModel; use Commercetools\Base\MapperFactory; use stdClass; -use Commercetools\History\Models\Error\GraphQLErrorObject; -use Commercetools\History\Models\Error\GraphQLErrorObjectModel; /** * @internal @@ -43,7 +41,7 @@ final class GraphQLErrorModel extends JsonObjectModel implements GraphQLError /** * - * @var ?GraphQLErrorObject + * @var ?mixed */ protected $extensions; @@ -55,7 +53,7 @@ public function __construct( ?string $message = null, ?GraphQLErrorLocationCollection $locations = null, ?array $path = null, - ?GraphQLErrorObject $extensions = null + ?JsonObject $extensions = null ) { $this->message = $message; $this->locations = $locations; @@ -128,7 +126,7 @@ public function getPath() *Dictionary with additional information where applicable.
* * - * @return null|GraphQLErrorObject + * @return null|mixed */ public function getExtensions() { @@ -138,8 +136,7 @@ public function getExtensions() if (is_null($data)) { return null; } - $className = GraphQLErrorObjectModel::resolveDiscriminatorClass($data); - $this->extensions = $className::of($data); + $this->extensions = JsonObjectModel::of($data); } return $this->extensions; @@ -171,9 +168,9 @@ public function setPath(?array $path): void } /** - * @param ?GraphQLErrorObject $extensions + * @param ?JsonObject $extensions */ - public function setExtensions(?GraphQLErrorObject $extensions): void + public function setExtensions(?JsonObject $extensions): void { $this->extensions = $extensions; } diff --git a/reference.txt b/reference.txt new file mode 100644 index 00000000000..e5c7c0e15d2 --- /dev/null +++ b/reference.txt @@ -0,0 +1 @@ +2a4e9c2d60f68a2f2b7976054db2c5052988fcaf diff --git a/references.txt b/references.txt index 754e1fdec88..14487299e26 100644 --- a/references.txt +++ b/references.txt @@ -345,3 +345,4 @@ e5666d7956fd6de53e41f965b052896d2a2ddd9b e8f731a742ca2997342b1b5f98121d86c8189a3b 473d2c6f1a9e9da0d2a42408ccf11f27a838f8b5 b7b82f5a701908239fcf39781bcbfa80823c9fa0 +cc1732f88ea3dc336358ff9f39cda9d5271cf7c2