-
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?
Support of custom attributes values for entities like customer/product/address #458
Conversation
-adding entered and selected values
@@ -59,6 +60,11 @@ input CustomerAddressAttributeInput { | |||
value: String! @doc(description: "Attribute value") | |||
} | |||
|
|||
input CustomAttributeInput { | |||
attribute_code: String! @doc(description: "Code.") |
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
@@ -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 comment
The 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
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]
}
`
@@ -129,7 +129,7 @@ type ReturnItem { | |||
type CustomAttribute { | |||
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.
Choose a reason for hiding this comment
The 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
@@ -129,7 +129,7 @@ type ReturnItem { | |||
type CustomAttribute { | |||
uid: ID! |
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.
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") |
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.
added in magento/magento2#28570
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will be sufficient for single and multiple values
@@ -128,10 +168,23 @@ 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 `stored_custom_attributes` instead.") |
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.
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