Skip to content
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

[Admin API] - updateCustomer - Error #590

Closed
matigastirami opened this issue Dec 18, 2020 · 2 comments
Closed

[Admin API] - updateCustomer - Error #590

matigastirami opened this issue Dec 18, 2020 · 2 comments
Assignees
Labels
type: bug 🐛 Something isn't working @vendure/core
Milestone

Comments

@matigastirami
Copy link

matigastirami commented Dec 18, 2020

There is an error when you try to update a customer. I'll let the request and response example below:
mutation { updateCustomer( input: { firstName: "test" lastName: "test" phoneNumber: "1234567890" emailAddress: "[email protected]" id: "134", title: "sr" } ){ ... on Customer{ id }, ... on ErrorResult{ errorCode, message } } }

Response:
{"errors":[{"message":"i.hasOwnProperty is not a function","locations":[{"line":3,"column":17}],"path":["updateCustomer"]}],"data":null}

@matigastirami matigastirami added the type: bug 🐛 Something isn't working label Dec 18, 2020
@michaelbromley
Copy link
Member

Thanks for the report, I can reproduce this.

Tracked it down to the fact that the graphql-js lib creates input arg objects with null prototypes (see graphql/graphql-js#504). The fix is to replace this line:

i.hasOwnProperty('emailAddress');

with

Object.hasOwnProperty.call(i, 'emailAddress');

Will fix for the next release.

@matigastirami
Copy link
Author

Thank you for your quick response @michaelbromley

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working @vendure/core
Projects
None yet
Development

No branches or pull requests

2 participants