Re: how to create code in graphql for login page with password field

how to create code in graphql for login page with password field

umang-pancholi
Shopify Partner
20 0 0

how to create code in graphql for login page without password field...

===============Query Mutation Work on admin side====================

mutation createCustomerMetafields($inputCustomerInput!) {
  customerCreate(input$input) {
    customer {
      id
      lastName
      phone
      email
      metafields(first3) {
        edges {
          node {
            id
            namespace
            key
            value
          }
        }
      }
    }
    userErrors {
      message
      field
    }
  }
}


 ===============variables====================

{
  "input": {
    "metafields": [
      {
        "namespace": "password",
        "key": "password",
        "type": "single_line_text_field",
        "value": "rob"
      }
    ],
    "email": "dhoni@dhoni.com",
    "lastName":"umang",
    "phone":"+917777777777"
  }
}
Screenshot_4.png

 

Replies 4 (4)

Liam
Shopify Staff
2873 313 817

Hi Umang,

 

Just to confirm, would this be a login page that customers would interact with? Where exactly would this be accessible to users?

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

umang-pancholi
Shopify Partner
20 0 0

yes i want to login customer and also for registration

 

Liam
Shopify Staff
2873 313 817

I believe for this you'd be using the customerCreate mutation on the Storefront API. Can you describe what the exact use-case is?

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

umang-pancholi
Shopify Partner
20 0 0

i want to add [password field in login and registration query how it is possible ?