Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link user logged in at checkout #320

Closed
felipepxavier opened this issue Jul 9, 2020 · 3 comments
Closed

Link user logged in at checkout #320

felipepxavier opened this issue Jul 9, 2020 · 3 comments

Comments

@felipepxavier
Copy link

felipepxavier commented Jul 9, 2020

Describe the bug

Hello, I would like to know how to link a user logged in to a mutation at checkout?
I'm using "wp-graphql-jwt-authentication", so I have the user id, but I don't know how to insert it in mutation, any suggestions?

my mutation
const CHECKOUT_MUTATION = gql`
mutation CHECKOUT_MUTATION( $input: CheckoutInput! ) {
checkout(input: $input) {
clientMutationId

order {
  id
  orderId
  refunds {
    nodes {
      amount
    }
  }
  status
}

customer {
  id
}
 
result
redirect

}
}
`;

@kidunot89
Copy link
Member

@felipepxavier Have you tried looking at this pinned issue? #147
It contains the info you seek, plus more info on creating order.

If you're in a hurry just look for a link containing QL Session Handler in the label. It'll take you to a PR summary with a React/Apollo example of what you need to implement in your client side application.

For future reference, you can find the link in the repo README.

@felipepxavier
Copy link
Author

Hi @kidunot89 !
Thanks for the feedback, but I had looked at this issue. I can create orders, so I create a session and send it through the header, my problem is to create an order that is not linked to the invited user, but rather to the logged in user.

@aresrioja10
Copy link

Hello @felipepxavier!

Have you fixed this issue? I'm facing the same problem here. My orders are always linked to the invited user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants