Order checkout process implemented without validations

This commit is contained in:
Bayram Muhiyev
2021-07-26 13:03:51 +05:00
parent e8bd59f2a8
commit 53517925b9
14 changed files with 471 additions and 25 deletions

View File

@@ -0,0 +1,31 @@
export const addPaymentToOrderMutation = /***/`
mutation addPaymentToOrder($input: PaymentInput!) {
addPaymentToOrder(input: $input) {
__typename
...on Order {
id
state
customer {
id
}
totalQuantity
lines {
id
}
}
...on OrderPaymentStateError {
errorCode
message
}
...on IneligiblePaymentMethodError {
errorCode
message
eligibilityCheckerMessage
}
...on ErrorResult {
errorCode
message
}
}
}
`

View File

@@ -0,0 +1,34 @@
// {
// title: "John Adams"
// firstName: "John"
// lastName: "Adams"
// phoneNumber: "+99312345678"
// emailAddress: "john@example.com"
// }
export const setCustomerForOrderMutation = /* GraphQL*/ `
mutation setCustomerForOrder($input: CreateCustomerInput!) {
setCustomerForOrder(input: $input){
__typename
...on Order {
id
state
customer {
id
}
totalQuantity
lines {
id
}
}
...on AlreadyLoggedInError {
errorCode
message
}
...on NoActiveOrderError {
errorCode
message
}
}
}
`

View File

@@ -0,0 +1,22 @@
export const setOrderShippingAddressMutation = /* GraphQL */ `
mutation setOrderShippingAddress($input: CreateAddressInput!) {
setOrderShippingAddress(input: $input) {
__typename
...on Order {
id
state
customer {
id
}
totalQuantity
lines {
id
}
}
...on ErrorResult {
errorCode
message
}
}
}
`

View File

@@ -0,0 +1,29 @@
export const transitionOrderToStateMutation = /* GraphQL */ `
mutation transitionOrderToState($state: String!) {
transitionOrderToState(state: $state) {
__typename
...on Order {
id
state
customer {
id
}
totalQuantity
lines {
id
}
}
...on ErrorResult {
errorCode
message
}
...on OrderStateTransitionError {
errorCode
message
transitionError
fromState
toState
}
}
}
`