"""Adds an item to the Order. If custom fields are defined on the OrderLine entity, a third argument 'customFields' will be available."""
type Mutation {
addItemToOrder(productVariantId: ID!, quantity: Int!): UpdateOrderItemsResult!
}
addItemsToOrder
mutationaddItemsToOrder
"""Adds mutliple items to the Order. Returns a list of errors for each item that failed to add. It will still add successful items."""
type Mutation {
addItemsToOrder(inputs: [AddItemInput!]!): UpdateMultipleOrderItemsResult!
}
"""Adjusts an OrderLine. If custom fields are defined on the OrderLine entity, a third argument 'customFields' of type `OrderLineCustomFieldsInput` will be available."""
type Mutation {
adjustOrderLine(orderLineId: ID!, quantity: Int!): UpdateOrderItemsResult!
}
applyCouponCode
mutationapplyCouponCode
"""Applies the given coupon code to the active Order"""
type Mutation {
applyCouponCode(couponCode: String!): ApplyCouponCodeResult!
}
"""Delete an existing Address"""
type Mutation {
deleteCustomerAddress(id: ID!): Success!
}
login
mutationlogin
"""
Authenticates the user using the native authentication strategy. This mutation is an alias for authenticate({ native: { ... }})
The `rememberMe` option applies when using cookie-based sessions, and if `true` it will set the maxAge of the session cookie
to 1 year.
"""
type Mutation {
login(username: String!, password: String!, rememberMe: Boolean): NativeAuthenticationResult!
}
logout
mutationlogout
"""End the current authenticated session"""
type Mutation {
logout: Success!
}
refreshCustomerVerification
mutationrefreshCustomerVerification
"""Regenerate and send a verification token for a new Customer registration. Only applicable if `authOptions.requireVerification` is set to true."""
type Mutation {
refreshCustomerVerification(emailAddress: String!): RefreshCustomerVerificationResult!
}
registerCustomerAccount
mutationregisterCustomerAccount
"""
Register a Customer account with the given credentials. There are four possible registration flows:
_If `authOptions.requireVerification` is set to `true`:_
1. **The Customer is registered _with_ a password**. A verificationToken will be created (and typically emailed to the Customer). That
verificationToken would then be passed to the `verifyCustomerAccount` mutation _without_ a password. The Customer is then
verified and authenticated in one step.
2. **The Customer is registered _without_ a password**. A verificationToken will be created (and typically emailed to the Customer). That
verificationToken would then be passed to the `verifyCustomerAccount` mutation _with_ the chosen password of the Customer. The Customer is then
verified and authenticated in one step.
_If `authOptions.requireVerification` is set to `false`:_
3. The Customer _must_ be registered _with_ a password. No further action is needed - the Customer is able to authenticate immediately.
_Whatever the setting, if an account already exists for the email address through another authentication strategy
(for example an SSO provider) and has no password yet:_
4. **The supplied password is never stored.** A verificationToken is created and emailed to the address, and this mutation
answers with a generic success so that it does not reveal whether the account exists. The password is set only when that
token is passed to the `verifyCustomerAccount` mutation _with_ the chosen password, which proves the caller controls the
mailbox. This holds even when `requireVerification` is `false`, so the Customer cannot be authenticated straight after
registering. Registering again issues a fresh token and sends the email again.
In every flow the caller-supplied `firstName`, `lastName`, `phoneNumber` and custom fields are ignored whenever a User already
exists for the email address, since the caller has not proven they own it. This includes an account an administrator created
earlier. A Customer with no User, such as one left by a guest checkout, is not an account and its details are still filled in.
"""
type Mutation {
registerCustomerAccount(input: RegisterCustomerInput!): RegisterCustomerAccountResult!
}
removeAllOrderLines
mutationremoveAllOrderLines
"""Remove all OrderLine from the Order"""
type Mutation {
removeAllOrderLines: RemoveOrderItemsResult!
}
removeCouponCode
mutationremoveCouponCode
"""Removes the given coupon code from the active Order"""
type Mutation {
removeCouponCode(couponCode: String!): Order
}
removeOrderLine
mutationremoveOrderLine
"""Remove an OrderLine from the Order"""
type Mutation {
removeOrderLine(orderLineId: ID!): RemoveOrderItemsResult!
}
requestPasswordReset
mutationrequestPasswordReset
"""Requests a password reset email to be sent"""
type Mutation {
requestPasswordReset(emailAddress: String!): RequestPasswordResetResult
}
requestUpdateCustomerEmailAddress
mutationrequestUpdateCustomerEmailAddress
"""
Request to update the emailAddress of the active Customer. If `authOptions.requireVerification` is enabled
(as is the default), then the `identifierChangeToken` will be assigned to the current User and
a IdentifierChangeRequestEvent will be raised. This can then be used e.g. by the EmailPlugin to email
that verification token to the Customer, which is then used to verify the change of email address.
"""
type Mutation {
requestUpdateCustomerEmailAddress(password: String!, newEmailAddress: String!): RequestUpdateCustomerEmailAddressResult!
}
resetPassword
mutationresetPassword
"""Resets a Customer's password based on the provided token"""
type Mutation {
resetPassword(token: String!, password: String!): ResetPasswordResult!
}
setCurrencyCodeForOrder
mutationsetCurrencyCodeForOrder
"""Sets the currency code for the active Order"""
type Mutation {
setCurrencyCodeForOrder(currencyCode: CurrencyCode!): UpdateOrderItemsResult!
}
setCustomerForOrder
mutationsetCustomerForOrder
"""Set the Customer for the Order. Required only if the Customer is not currently logged in"""
type Mutation {
setCustomerForOrder(input: CreateCustomerInput!): SetCustomerForOrderResult!
}
setOrderBillingAddress
mutationsetOrderBillingAddress
"""Sets the billing address for the active Order"""
type Mutation {
setOrderBillingAddress(input: CreateAddressInput!): ActiveOrderResult!
}
setOrderCustomFields
mutationsetOrderCustomFields
"""Allows any custom fields to be set for the active Order"""
type Mutation {
setOrderCustomFields(input: UpdateOrderInput!): ActiveOrderResult!
}
setOrderShippingAddress
mutationsetOrderShippingAddress
"""Sets the shipping address for the active Order"""
type Mutation {
setOrderShippingAddress(input: CreateAddressInput!): ActiveOrderResult!
}
setOrderShippingMethod
mutationsetOrderShippingMethod
"""
Sets the shipping method by id, which can be obtained with the `eligibleShippingMethods` query.
An Order can have multiple shipping methods, in which case you can pass an array of ids. In this case,
you should configure a custom ShippingLineAssignmentStrategy in order to know which OrderLines each
shipping method will apply to.
"""
type Mutation {
setOrderShippingMethod(shippingMethodId: [ID!]!): SetOrderShippingMethodResult!
}
transitionOrderToState
mutationtransitionOrderToState
"""Transitions an Order to a new state. Valid next states can be found by querying `nextOrderStates`"""
type Mutation {
transitionOrderToState(state: String!): TransitionOrderToStateResult
}
unsetOrderBillingAddress
mutationunsetOrderBillingAddress
"""Unsets the billing address for the active Order. Available since version 3.1.0"""
type Mutation {
unsetOrderBillingAddress: ActiveOrderResult!
}
unsetOrderShippingAddress
mutationunsetOrderShippingAddress
"""Unsets the shipping address for the active Order. Available since version 3.1.0"""
type Mutation {
unsetOrderShippingAddress: ActiveOrderResult!
}
"""
Confirm the update of the emailAddress with the provided token, which has been generated by the
`requestUpdateCustomerEmailAddress` mutation.
"""
type Mutation {
updateCustomerEmailAddress(token: String!): UpdateCustomerEmailAddressResult!
}
updateCustomerPassword
mutationupdateCustomerPassword
"""Update the password of the active Customer"""
type Mutation {
updateCustomerPassword(currentPassword: String!, newPassword: String!): UpdateCustomerPasswordResult!
}
verifyCustomerAccount
mutationverifyCustomerAccount
"""
Verify a Customer email address with the token sent to that address. Applicable whenever a verificationToken was issued:
that is when `authOptions.requireVerification` is set to true, and also when a password was registered against an account
that already existed through another authentication strategy, whatever that setting is.
If the Customer was not registered with a password in the `registerCustomerAccount` mutation, the password _must_ be
provided here.
"""
type Mutation {
verifyCustomerAccount(token: String!, password: String): VerifyCustomerAccountResult!
}
Past the docs?
Architecture reviews, custom plugin work, migrations, ongoing support. Get a hand from the team that builds Vendure.