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 1

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
Community Manager
3108 340 871

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 1

yes i want to login customer and also for registration

 

Liam
Community Manager
3108 340 871

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 1

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