-
Notifications
You must be signed in to change notification settings - Fork 154
[My Account] Add support of Customer attributes #271
Comments
Hello @furseyev |
Hell @naydav , I've done the implementation in the https://github.com/magento/graphql-ce/tree/feature/271-Customer-Attributes-Support branch and needed only to add api functional tests for those. However, merging the latest changes from 2.3-develop shows a merge conflict - one of the models I've changed is already removed, so need to figure that out and re-do the solution. Thanks! |
- Customer attributes validation added
- Updating API functional test: adding
- Customer attributes validation added for create customer action
- Updating API functional test: adding empty first name scenario for customer account creation API
@naydav, please check this information and clarify requirements if needed. Preconditions: Steps:
mutation {
createCustomer(
input: {
firstname: "User"
lastname: "Attributed"
email: "[email protected]"
password: "123123qA"
a_experimental_field: "abcdefghe"
}
) {
customer {
firstname
lastname
email
}
}
} and get this {
"errors": [
{
"message": "Field \"a_experimental_field\" is not defined by type CustomerInput.",
"category": "graphql",
"locations": [
{
"line": 2,
"column": 125
}
]
}
]
}
mutation {
createCustomer(
input: {
firstname: "User"
lastname: "Attributed"
email: "[email protected]"
password: "123123qA"
}
) {
customer {
firstname
lastname
email
}
}
} and get next error in Network tab of Electron Dev Tools (Chrome Dev Tools) {"errors":[{"debugMessage":"Argument 2 passed to Magento\\Eav\\Model\\Attribute\\Data\\Text::validateLength() must be of the type string, null given, called in \/shared\/httpd\/graphql-ee\/graphql-ee\/app\/code\/Magento\/Eav\/Model\/Attribute\/Data\/Text.php on line 80","message":"Internal server error","category":"internal","locations":[{"line":2,"column":3}],"path":["createCustomer"]}],"data":{"createCustomer":null}}<br />
<b>Fatal error</b>: Uncaught Exception: User Error: Some transactions have not been committed or rolled back in /shared/httpd/graphql-ee/graphql-ee/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php on line 3980 in /shared/httpd/graphql-ee/graphql-ee/lib/internal/Magento/Framework/App/ErrorHandler.php:61
Stack trace:
#0 [internal function]: Magento\Framework\App\ErrorHandler->handler(256, 'Some transactio...', '/shared/httpd/g...', 3980, Array)
#1 /shared/httpd/graphql-ee/graphql-ee/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php(3980): trigger_error('Some transactio...', 256)
#2 [internal function]: Magento\Framework\DB\Adapter\Pdo\Mysql->__destruct()
#3 {main}
thrown in <b>/shared/httpd/graphql-ee/graphql-ee/lib/internal/Magento/Framework/App/ErrorHandler.php</b> on line <b>61</b><br /> |
Looks like we need to add attributes dynamically Example |
My proposal is split functionality in two PR @TomashKhamlai please confirm that functionality (first PR) is valid for already existent attributes |
- Merge Pull Request #489 from magento/graphql-ce:feature/271-Customer-Attributes-Validation - Merged commits: 1. dba9800 2. 7f6718d 3. 3735e91 4. 342675a 5. e177801 6. 9b5b0a1 7. 9f1ba1a 8. 670116c 9. 40e2363 10. d071027 11. b4db736 12. 4b7acdc 13. 48f1891 14. 3641627 15. ef078b6 16. 1c65121 17. cc69055 18. 7ee6a1a 19. f358267 20. eb48f44 21. 2eb7c15 22. 7ca7acc 23. 1c30336 24. 4382c3a 25. da8d6ac 26. 0b4c496 27. 5ae0633
AC:
Now validation of Customer address data is hardcoded in
\Magento\CustomerGraphQl\Model\Customer\UpdateCustomerData::execute
0
(zero)The text was updated successfully, but these errors were encountered: