Hi guys. Is there anybody here who could show me or direct me to a resource that shows examples on how to create a new customer using the Storefront API with Graphql? Basically, I just need to follow this example from the documentation but attach metafields input to the Graphql mutation below:
Thank you for taking time to reply to my question. Yes, password is a valid field for the CustomerCreateInput (see attached image).
The solution you provided just adds additional customer input but itâs basically the same with what I used above. As expected, itâs not working. See the attached image for that Graphql request results.
Thatâs interesting. Iâm using the Altair GraphQL client pointing to a test store I created yesterday, and password is not a valid field for CustomerInput!. See attached.
Have you solved your issue? How? I have the same at the moment, for some reason, Shopify returns me âInputObject âCustomerCreateInputâ doesnât accept argument âmetafieldsââ. But as I see from your example it should be accessible, right?
@ggsandro GraphQL is wonderful in the way that it provides you an up to date schema. The schema is your truth. Forum posts can be and mostly are outdated. APIs and their fields, request inputs, responses etc. evolve over time. Even the documentation can fall behind. In this case, the documentation clearly does not document any metafield field when creating a customer via customerCreate mutation and the schema confirms much the same.
I suggest getting proper GraphQL tooling with schema introspection and auto-complete such as in Insomnia or GraphQL Playground - both tools sync the schema and you always know where youâre at and what youâre working with.