Support of custom attributes values for entities like customer/product/address#458
Support of custom attributes values for entities like customer/product/address#458melnikovi wants to merge 7 commits intomagento:masterfrom
Conversation
-adding entered and selected values
| } | ||
|
|
||
| input CustomAttributeInput { | ||
| attribute_code: String! @doc(description: "Code.") |
| 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.
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
Eav includes CustomAttribute. Complex Eav values could be expressed as JSON like tier price
We need to show both pieces of information to avoid a round trip to customAttributeMetadata
- selected_options/entered_options
- the whole info from customAttributeMetadata on each available attribute
`stored_attributes_v2: [StoredAttribute]
type StoredAttribute {
atttribute_uid
selected_attribute_values: [ID]
entered_attribute_values: [String]
attributes: [Attribute]
}
`
| uid: ID! | ||
| 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.
why is this defined on the returns. this belongs in the EAV module
| @@ -129,7 +129,7 @@ type ReturnItem { | |||
| type CustomAttribute { | |||
| uid: ID! | |||
There was a problem hiding this comment.
we probably have to deprecte this in favor of CustomAttributeV2
| generateCustomerToken(email: String!, password: String!): CustomerToken @doc(description:"Retrieve the customer token") | ||
| changeCustomerPassword(currentPassword: String!, newPassword: String!): Customer @doc(description:"Changes the password for the logged-in customer") | ||
| createCustomer (input: CustomerInput!): CustomerOutput @deprecated(reason: "createCustomerV2") @doc(description:"Create customer account") | ||
| createCustomerV2 (input: CustomerCreateInput!): CustomerOutput @doc(description:"Create customer account") |
| label: String | ||
| value: String | ||
| value: String @deprecated(reason: "use `values` instead") | ||
| values: [ID]! @doc(description: "Array as container of values of the attribute") |
There was a problem hiding this comment.
this will be sufficient for single and multiple values
| 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 `stored_custom_attributes` instead.") |
There was a problem hiding this comment.
I tried to reuse Attribute from the Metadata query.
Using the already popular and known term "custom_attributes", It’s not very clear that this will return all information about the storefront dedicated attributes and their options and values (not sure about the options part)
but also this type has to contain the stored( saved )by the user values. Same are used on the input as well. The difference is the output contains full meta of the attribute + picked values and input only contains references of the attribute and picked values
If introducing a new term to favor better naming, we can restore custom_attributes and introduce custom_attributes_v2
Problem
Support of custom attributes for customer and customer address.
Solution
Requested Reviewers