Skip to content

Commit 5f86828

Browse files
author
Prabhu Ram
committed
- fix: field names should not be camel case
1 parent 84ceb30 commit 5f86828

16 files changed

+33
-33
lines changed

app/code/Magento/QuoteGraphQl/Model/Resolver/AddProductsToCart.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
7878
'cart' => [
7979
'model' => $addProductsToCartOutput->getCart(),
8080
],
81-
'userInputErrors' => array_map(
81+
'user_errors' => array_map(
8282
function (Error $error) {
8383
return [
8484
'code' => $error->getCode(),

app/code/Magento/QuoteGraphQl/etc/schema.graphqls

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,12 +375,12 @@ type Order {
375375

376376
type CartUserInputError @doc(description:"An error encountered while adding an item to the the cart.") {
377377
message: String! @doc(description: "A localized error message")
378-
code: CartUserInputErrorType! @doc(description: "Checkout-specific error code")
378+
code: CartUserInputErrorType! @doc(description: "Cart-specific error code")
379379
}
380380

381381
type AddProductsToCartOutput {
382382
cart: Cart! @doc(description: "The cart after products have been added")
383-
userInputErrors:[CartUserInputError]! @doc(description: "An error encountered while adding an item to the cart.")
383+
user_errors: [CartUserInputError!]! @doc(description: "An error encountered while adding an item to the cart.")
384384
}
385385

386386
enum CartUserInputErrorType {

app/code/Magento/WishlistGraphQl/Model/Resolver/AddProductsToWishlist.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function resolve(
105105

106106
return [
107107
'wishlist' => $this->wishlistDataMapper->map($wishlistOutput->getWishlist()),
108-
'userInputErrors' => array_map(
108+
'user_errors' => array_map(
109109
function (Error $error) {
110110
return [
111111
'code' => $error->getCode(),

app/code/Magento/WishlistGraphQl/Model/Resolver/RemoveProductsFromWishlist.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function resolve(
109109

110110
return [
111111
'wishlist' => $this->wishlistDataMapper->map($wishlistOutput->getWishlist()),
112-
'userInputErrors' => \array_map(
112+
'user_errors' => \array_map(
113113
function (Error $error) {
114114
return [
115115
'code' => $error->getCode(),

app/code/Magento/WishlistGraphQl/Model/Resolver/UpdateProductsInWishlist.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function resolve(
110110

111111
return [
112112
'wishlist' => $this->wishlistDataMapper->map($wishlistOutput->getWishlist()),
113-
'userInputErrors' => \array_map(
113+
'user_errors' => \array_map(
114114
function (Error $error) {
115115
return [
116116
'code' => $error->getCode(),

app/code/Magento/WishlistGraphQl/etc/schema.graphqls

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ input WishlistItemInput @doc(description: "Defines the items to add to a wish li
4949

5050
type AddProductsToWishlistOutput @doc(description: "Contains the customer's wish list and any errors encountered") {
5151
wishlist: Wishlist! @doc(description: "Contains the wish list with all items that were successfully added")
52-
userInputErrors:[WishListUserInputError]! @doc(description: "An array of errors encountered while adding products to a wish list")
52+
user_errors:[WishListUserInputError!]! @doc(description: "An array of errors encountered while adding products to a wish list")
5353
}
5454

5555
type RemoveProductsFromWishlistOutput @doc(description: "Contains the customer's wish list and any errors encountered") {
5656
wishlist: Wishlist! @doc(description: "Contains the wish list with after items were successfully deleted")
57-
userInputErrors:[WishListUserInputError]! @doc(description:"An array of errors encountered while deleting products from a wish list")
57+
user_errors:[WishListUserInputError!]! @doc(description:"An array of errors encountered while deleting products from a wish list")
5858
}
5959

6060
input WishlistItemUpdateInput @doc(description: "Defines updates to items in a wish list") {
@@ -67,7 +67,7 @@ input WishlistItemUpdateInput @doc(description: "Defines updates to items in a w
6767

6868
type UpdateProductsInWishlistOutput @doc(description: "Contains the customer's wish list and any errors encountered") {
6969
wishlist: Wishlist! @doc(description: "Contains the wish list with all items that were successfully updated")
70-
userInputErrors:[WishListUserInputError]! @doc(description:"An array of errors encountered while updating products in a wish list")
70+
user_errors: [WishListUserInputError!]! @doc(description:"An array of errors encountered while updating products in a wish list")
7171
}
7272

7373
type WishListUserInputError @doc(description:"An error encountered while performing operations with WishList.") {

dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/AddBundleProductToCartSingleMutationTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public function testAddBundleToCartWithWrongBundleOptions()
208208
}
209209
}
210210
}
211-
userInputErrors {
211+
user_errors {
212212
message
213213
}
214214
}
@@ -219,7 +219,7 @@ public function testAddBundleToCartWithWrongBundleOptions()
219219

220220
self::assertEquals(
221221
"Please select all required options.",
222-
$response['addProductsToCart']['userInputErrors'][0]['message']
222+
$response['addProductsToCart']['user_errors'][0]['message']
223223
);
224224
}
225225

@@ -341,7 +341,7 @@ private function getMutationsQuery(
341341
}
342342
}
343343
}
344-
userInputErrors {
344+
user_errors {
345345
message
346346
}
347347
}

dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartSingleMutationTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function testAddConfigurableProductWithWrongSuperAttributes()
103103

104104
self::assertEquals(
105105
'You need to choose options for your item.',
106-
$response['addProductsToCart']['userInputErrors'][0]['message']
106+
$response['addProductsToCart']['user_errors'][0]['message']
107107
);
108108
}
109109

@@ -132,7 +132,7 @@ public function testAddProductIfQuantityIsNotAvailable()
132132

133133
self::assertEquals(
134134
'The requested qty is not available',
135-
$response['addProductsToCart']['userInputErrors'][0]['message']
135+
$response['addProductsToCart']['user_errors'][0]['message']
136136
);
137137
}
138138

@@ -156,7 +156,7 @@ public function testAddNonExistentConfigurableProductParentToCart()
156156

157157
self::assertEquals(
158158
'Could not find a product with SKU "configurable_no_exist"',
159-
$response['addProductsToCart']['userInputErrors'][0]['message']
159+
$response['addProductsToCart']['user_errors'][0]['message']
160160
);
161161
}
162162

@@ -188,7 +188,7 @@ public function testOutOfStockVariationToCart()
188188
'This product is out of stock.'
189189
];
190190
$this->assertContains(
191-
$response['addProductsToCart']['userInputErrors'][0]['message'],
191+
$response['addProductsToCart']['user_errors'][0]['message'],
192192
$expectedErrorMessages
193193
);
194194
}
@@ -235,7 +235,7 @@ private function getQuery(
235235
}
236236
}
237237
},
238-
userInputErrors {
238+
user_errors {
239239
message
240240
}
241241
}

dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddDownloadableProductToCartSingleMutationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ private function getQuery(
186186
}
187187
}
188188
},
189-
userInputErrors {
189+
user_errors {
190190
message
191191
}
192192
}

dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddSimpleProductToCartEndToEndTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ private function getAddToCartMutation(
250250
}
251251
}
252252
},
253-
userInputErrors {
253+
user_errors {
254254
message
255255
}
256256
}

0 commit comments

Comments
 (0)