|
@@ -1,18 +1,43 @@
|
|
|
type Query {
|
|
type Query {
|
|
|
|
|
+ "The active Channel"
|
|
|
activeChannel: Channel!
|
|
activeChannel: Channel!
|
|
|
|
|
+ "The active Customer"
|
|
|
activeCustomer: Customer
|
|
activeCustomer: Customer
|
|
|
|
|
+ """
|
|
|
|
|
+ The active Order. Will be `null` until an Order is created via `addItemToOrder`. Once an Order reaches the
|
|
|
|
|
+ state of `PaymentApproved` or `PaymentSettled`, then that Order is no longer considered "active" and this
|
|
|
|
|
+ query will once again return `null`.
|
|
|
|
|
+ """
|
|
|
activeOrder: Order
|
|
activeOrder: Order
|
|
|
|
|
+ "An array of supported Countries"
|
|
|
availableCountries: [Country!]!
|
|
availableCountries: [Country!]!
|
|
|
|
|
+ "A list of Collections available to the shop"
|
|
|
collections(options: CollectionListOptions): CollectionList!
|
|
collections(options: CollectionListOptions): CollectionList!
|
|
|
|
|
+ "Returns a Collection either by its id or slug. If neither 'id' nor 'slug' is speicified, an error will result."
|
|
|
collection(id: ID, slug: String): Collection
|
|
collection(id: ID, slug: String): Collection
|
|
|
|
|
+ "Returns a list of eligible shipping methods based on the current active Order"
|
|
|
eligibleShippingMethods: [ShippingMethodQuote!]!
|
|
eligibleShippingMethods: [ShippingMethodQuote!]!
|
|
|
|
|
+ "Returns information about the current authenticated User"
|
|
|
me: CurrentUser
|
|
me: CurrentUser
|
|
|
|
|
+ "Returns the possible next states that the activeOrder can transition to"
|
|
|
nextOrderStates: [String!]!
|
|
nextOrderStates: [String!]!
|
|
|
|
|
+ """
|
|
|
|
|
+ Returns an Order based on the id. Note that in the Shop API, only orders belonging to the
|
|
|
|
|
+ currently-authenticated User may be queried.
|
|
|
|
|
+ """
|
|
|
order(id: ID!): Order
|
|
order(id: ID!): Order
|
|
|
|
|
+ """
|
|
|
|
|
+ Returns an Order based on the order `code`. For guest Orders (i.e. Orders placed by non-authenticated Customers)
|
|
|
|
|
+ this query will only return the Order within 2 hours of the Order being placed. This allows an Order confirmation
|
|
|
|
|
+ screen to be shown immediately after completion of a guest checkout, yet prevents security risks of allowing
|
|
|
|
|
+ general anonymous access to Order data.
|
|
|
|
|
+ """
|
|
|
orderByCode(code: String!): Order
|
|
orderByCode(code: String!): Order
|
|
|
"Get a Product either by id or slug. If neither 'id' nor 'slug' is speicified, an error will result."
|
|
"Get a Product either by id or slug. If neither 'id' nor 'slug' is speicified, an error will result."
|
|
|
product(id: ID, slug: String): Product
|
|
product(id: ID, slug: String): Product
|
|
|
|
|
+ "Get a list of Products"
|
|
|
products(options: ProductListOptions): ProductList!
|
|
products(options: ProductListOptions): ProductList!
|
|
|
|
|
+ "Search Products based on the criteria set by the `SearchInput`"
|
|
|
search(input: SearchInput!): SearchResponse!
|
|
search(input: SearchInput!): SearchResponse!
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -27,6 +52,7 @@ type Mutation {
|
|
|
applyCouponCode(couponCode: String!): Order
|
|
applyCouponCode(couponCode: String!): Order
|
|
|
"Removes the given coupon code from the active Order"
|
|
"Removes the given coupon code from the active Order"
|
|
|
removeCouponCode(couponCode: String!): Order
|
|
removeCouponCode(couponCode: String!): Order
|
|
|
|
|
+ "Transitions an Order to a new state. Valid next states can be found by querying `nextOrderStates`"
|
|
|
transitionOrderToState(state: String!): Order
|
|
transitionOrderToState(state: String!): Order
|
|
|
"Sets the shipping address for this order"
|
|
"Sets the shipping address for this order"
|
|
|
setOrderShippingAddress(input: CreateAddressInput!): Order
|
|
setOrderShippingAddress(input: CreateAddressInput!): Order
|
|
@@ -48,7 +74,22 @@ type Mutation {
|
|
|
logout: Boolean!
|
|
logout: Boolean!
|
|
|
"Regenerate and send a verification token for a new Customer registration. Only applicable if `authOptions.requireVerification` is set to true."
|
|
"Regenerate and send a verification token for a new Customer registration. Only applicable if `authOptions.requireVerification` is set to true."
|
|
|
refreshCustomerVerification(emailAddress: String!): Boolean!
|
|
refreshCustomerVerification(emailAddress: String!): Boolean!
|
|
|
- "Register a Customer account with the given credentials"
|
|
|
|
|
|
|
+ """
|
|
|
|
|
+ Register a Customer account with the given credentials. There are three 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 chosed 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.
|
|
|
|
|
+ """
|
|
|
registerCustomerAccount(input: RegisterCustomerInput!): Boolean!
|
|
registerCustomerAccount(input: RegisterCustomerInput!): Boolean!
|
|
|
"Update an existing Customer"
|
|
"Update an existing Customer"
|
|
|
updateCustomer(input: UpdateCustomerInput!): Customer!
|
|
updateCustomer(input: UpdateCustomerInput!): Customer!
|
|
@@ -58,7 +99,12 @@ type Mutation {
|
|
|
updateCustomerAddress(input: UpdateAddressInput!): Address!
|
|
updateCustomerAddress(input: UpdateAddressInput!): Address!
|
|
|
"Delete an existing Address"
|
|
"Delete an existing Address"
|
|
|
deleteCustomerAddress(id: ID!): Boolean!
|
|
deleteCustomerAddress(id: ID!): Boolean!
|
|
|
- "Verify a Customer email address with the token sent to that address. Only applicable if `authOptions.requireVerification` is set to true."
|
|
|
|
|
|
|
+ """
|
|
|
|
|
+ Verify a Customer email address with the token sent to that address. Only applicable if `authOptions.requireVerification` is set to true.
|
|
|
|
|
+
|
|
|
|
|
+ If the Customer was not registered with a password in the `registerCustomerAccount` mutation, the a password _must_ be
|
|
|
|
|
+ provided here.
|
|
|
|
|
+ """
|
|
|
verifyCustomerAccount(token: String!, password: String): LoginResult!
|
|
verifyCustomerAccount(token: String!, password: String): LoginResult!
|
|
|
"Update the password of the active Customer"
|
|
"Update the password of the active Customer"
|
|
|
updateCustomerPassword(currentPassword: String!, newPassword: String!): Boolean
|
|
updateCustomerPassword(currentPassword: String!, newPassword: String!): Boolean
|