Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit bbb1a60

Browse files
authored
Merge pull request #3636 from magento-engcom/graphql-develop-prs
[EngCom] Public Pull Requests - GraphQL
2 parents 35b736d + 2016664 commit bbb1a60

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

app/code/Magento/CustomerGraphQl/Model/Resolver/UpdateCustomerAddress.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ private function updateCustomerAddress(int $customerId, int $addressId, array $a
109109
{
110110
$address = $this->getCustomerAddressForUser->execute($addressId, $customerId);
111111
$this->dataObjectHelper->populateWithArray($address, $addressData, AddressInterface::class);
112+
if (isset($addressData['region']['region_id'])) {
113+
$address->setRegionId($address->getRegion()->getRegionId());
114+
}
115+
112116
return $this->addressRepository->save($address);
113117
}
114118
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ type Query {
55
}
66

77
type Mutation {
8-
placeholderMutation: String @doc(description: "Mutation type cannot be declared without fields. The placeholder will be removed when at least one mutation field is declared.")
98
}
109

1110
input FilterTypeInput @doc(description: "FilterTypeInput specifies which action will be performed in a query ") {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ type Query {
66

77
type Website @doc(description: "The type contains information about a website") {
88
id : Int @doc(description: "The ID number assigned to the website")
9-
name : String @doc(description: "The website name. Websites use this name to identify it easyer.")
9+
name : String @doc(description: "The website name. Websites use this name to identify it easier.")
1010
code : String @doc(description: "A code assigned to the website to identify it")
1111
sort_order : Int @doc(description: "The attribute to use for sorting websites")
12-
default_group_id : String @doc(description: "The default group id that the website has")
12+
default_group_id : String @doc(description: "The default group ID that the website has")
1313
is_default : Boolean @doc(description: "Specifies if this is the default website")
1414
}
1515

dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/UpdateCustomerAddressTest.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -218,13 +218,12 @@ private function assertCustomerAddressesFields(AddressInterface $address, $actua
218218
];
219219
$this->assertResponseFields($actualResponse, $assertionMap);
220220
$this->assertTrue(is_array([$actualResponse['region']]), "region field must be of an array type.");
221-
// https://github.com/magento/graphql-ce/issues/270
222-
// $assertionRegionMap = [
223-
// ['response_field' => 'region', 'expected_value' => $address->getRegion()->getRegion()],
224-
// ['response_field' => 'region_code', 'expected_value' => $address->getRegion()->getRegionCode()],
225-
// ['response_field' => 'region_id', 'expected_value' => $address->getRegion()->getRegionId()]
226-
// ];
227-
// $this->assertResponseFields($actualResponse['region'], $assertionRegionMap);
221+
$assertionRegionMap = [
222+
['response_field' => 'region', 'expected_value' => $address->getRegion()->getRegion()],
223+
['response_field' => 'region_code', 'expected_value' => $address->getRegion()->getRegionCode()],
224+
['response_field' => 'region_id', 'expected_value' => $address->getRegion()->getRegionId()]
225+
];
226+
$this->assertResponseFields($actualResponse['region'], $assertionRegionMap);
228227
}
229228

230229
/**

0 commit comments

Comments
 (0)