Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

How to create an accessToken and query customer information in ONE graphql call?

How to create an accessToken and query customer information in ONE graphql call?

Lederer
Shopify Partner
9 1 1

Hi,

is it possible to create a customerAccessToken and also query customer information in one GraphQL call?

Something like this, but with "autofilled" ACCESS_TOKEN_HERE ?

mutation {
  customerAccessTokenCreate(input: {
    email: "customer@example.com"
    password: "password123"
  }) {
    customerAccessToken {
      accessToken
    }
    customerUserErrors {
      field
      message
    }
  }
}

query {
  customer(customerAccessToken: "ACCESS_TOKEN_HERE") {
    firstName
  }
}

  

Replies 0 (0)