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

Currency misspelled in graphql attributes #465

Merged
merged 3 commits into from
Mar 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions app/code/Magento/DirectoryGraphQl/etc/schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ type Query {
type Currency {
base_currency_code: String
base_currency_symbol: String
default_display_currecy_code: String
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will Backward Incompatible Changes
We need to mark old fields as deprecated instead of removing them
thanks

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fields were marked as deprecated

default_display_currecy_symbol: String
default_display_currecy_code: String @deprecated(reason: "Symbol was missed. Use `default_display_currency_code`.")
Copy link
Contributor

@naydav naydav Mar 13, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we can use names like code, default_code etc
It's part of a single object so we don't need to duplicate object name in object fields
BUT old fields should not be removed, just marked as deprecated

default_display_currency_code: String
default_display_currecy_symbol: String @deprecated(reason: "Symbol was missed. Use `default_display_currency_symbol`.")
default_display_currency_symbol: String
available_currency_codes: [String]
exchange_rates: [ExchangeRate]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public function testGetCurrency()
currency {
base_currency_code
base_currency_symbol
default_display_currecy_code
default_display_currecy_symbol
default_display_currency_code
default_display_currency_symbol
available_currency_codes
exchange_rates {
currency_to
Expand All @@ -36,8 +36,8 @@ public function testGetCurrency()
$this->assertArrayHasKey('currency', $result);
$this->assertArrayHasKey('base_currency_code', $result['currency']);
$this->assertArrayHasKey('base_currency_symbol', $result['currency']);
$this->assertArrayHasKey('default_display_currecy_code', $result['currency']);
$this->assertArrayHasKey('default_display_currecy_symbol', $result['currency']);
$this->assertArrayHasKey('default_display_currency_code', $result['currency']);
$this->assertArrayHasKey('default_display_currency_symbol', $result['currency']);
$this->assertArrayHasKey('available_currency_codes', $result['currency']);
$this->assertArrayHasKey('exchange_rates', $result['currency']);
}
Expand Down