-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support of custom attributes values for entities like customer/product/address #458
base: master
Are you sure you want to change the base?
Changes from 1 commit
9ddce9c
15c842c
3d76c7a
104a0b0
04badb9
0b95919
5afb38f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,8 @@ input CustomerAddressInput { | |
prefix: String @doc(description: "An honorific, such as Dr., Mr., or Mrs.") | ||
suffix: String @doc(description: "A value such as Sr., Jr., or III") | ||
vat_id: String @doc(description: "The customer's Tax/VAT number (for corporate customers)") | ||
custom_attributes: [CustomerAddressAttributeInput] @doc(description: "Deprecated: Custom attributes should not be put into container.") | ||
custom_attributes: [CustomerAddressAttributeInput] @deprecated(reason: "Use custom_attributes_v2.") | ||
custom_attributes_v2: [CustomAttributeInput] @doc(description: "Custom attributes.") | ||
} | ||
|
||
input CustomerAddressRegionInput @doc(description: "CustomerAddressRegionInput defines the customer's state or province") { | ||
|
@@ -59,6 +60,11 @@ input CustomerAddressAttributeInput { | |
value: String! @doc(description: "Attribute value") | ||
} | ||
|
||
input CustomAttributeInput { | ||
attribute_code: String! @doc(description: "Code.") | ||
values: [String]! @doc(description: "Values.") | ||
} | ||
|
||
type CustomerToken { | ||
token: String @doc(description: "The customer token") | ||
} | ||
|
@@ -76,6 +82,7 @@ input CustomerInput { | |
gender: Int @doc(description: "The customer's gender (Male - 1, Female - 2)") | ||
password: String @doc(description: "The customer's password") | ||
is_subscribed: Boolean @doc(description: "Indicates whether the customer is subscribed to the company's newsletter") | ||
custom_attributes: [CustomAttributeInput] @doc(description: "Custom attributes.") | ||
} | ||
|
||
type CustomerOutput { | ||
|
@@ -104,6 +111,7 @@ type Customer @doc(description: "Customer defines the customer name and address | |
is_subscribed: Boolean @doc(description: "Indicates whether the customer is subscribed to the company's newsletter") @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\IsSubscribed") | ||
addresses: [CustomerAddress] @doc(description: "An array containing the customer's shipping and billing addresses") @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\CustomerAddresses") | ||
gender: Int @doc(description: "The customer's gender (Male - 1, Female - 2)") | ||
custom_attributes: [CustomAttribute]! | ||
} | ||
|
||
type CustomerAddress @doc(description: "CustomerAddress contains detailed information about a customer's billing and shipping addresses"){ | ||
|
@@ -128,7 +136,8 @@ type CustomerAddress @doc(description: "CustomerAddress contains detailed inform | |
vat_id: String @doc(description: "The customer's Value-added tax (VAT) number (for corporate customers)") | ||
default_shipping: Boolean @doc(description: "Indicates whether the address is the default shipping address") | ||
default_billing: Boolean @doc(description: "Indicates whether the address is the default billing address") | ||
custom_attributes: [CustomerAddressAttribute] @deprecated(reason: "Custom attributes should not be put into container") | ||
custom_attributes: [CustomerAddressAttribute] @deprecated(reason: "Use custom_attributes_v2 field.") | ||
custom_attributes_v2: [CustomAttribute]! @doc(description: "Custom attributes.") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this array CAN be empty, but we always have to return an array if no attribute are defined CustomAttribute doesn't contain the same amount of data as Attribute from EAV We need to show both pieces of information to avoid a round trip to customAttributeMetadata
`stored_attributes_v2: [StoredAttribute] type StoredAttribute { |
||
extension_attributes: [CustomerAddressAttribute] @doc(description: "Address extension attributes") | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,7 +129,7 @@ type ReturnItem { | |
type CustomAttribute { | ||
uid: ID! | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we probably have to deprecte this in favor of CustomAttributeV2 |
||
label: String! | ||
value: String! @doc(description: "JSON encoded value of the attribute.") | ||
values: [String]! @doc(description: "JSON encoded value of the attribute.") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is this defined on the returns. this belongs in the EAV module |
||
} | ||
|
||
type ReturnComment { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change this to uid