I am using magetno 2.3.x and I want to access my account queries provided by Magento_CustomerGraphQl module.
I have installed ChromeiQl to execute GraphQl.
I set Site Endpoint as per syntax provided by magento devdocs.
I have generated the customer token using provided type Mutation
type Mutation {
generateCustomerToken(email: String!, password: String!)
{
token
}
}
But I did not get any way to use this token in ChromiQL as authorization Header.
Best Answer
Please try this:
Step 1: Get a bearer token: You can get a token by executing the signup mutation in the playground to create a new user. This is the signup mutation I ran:
Step 2: Include the bearer token in your request
Notice there is a text area called HTTP HEADERS at the bottom of the playground. Paste the following code into HTTP HEADERS, replacing your-token-goes-here with the bearer token returned by the server in step 1:
Step 3: Run the post mutation Now that you are including a bearer token in your request you can run the post mutation.
Please check and let me know if you are able to get the response.
Thanks.