Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
595 lines (523 sloc) 10.1 KB
extend type Query {
menu: [MenuItem]
category(id: String!): Category
product(id: String!): Product
products(
categoryId: String
includeSubcategories: Boolean
query: ShopPageQuery
sortOrders: [SortOrderInput]
filters: [FilterInput]
skus: [String]
): ProductList
cart: Cart
countries: CountryList
order(id: Int!): Order
lastOrder: Order
orders(pagination: PaginationInput): Orders
address(id: Int!): Address
addresses: AddressList
customer: Customer
cmsPage(id: Int, identifier: String): CmsPage
cmsBlock(identifier: String): CmsBlock
validatePasswordToken(token: String!): Boolean
}
extend type Mutation {
setShopCurrency(currency: String!): BackendConfig
setShopStore(storeCode: String!): BackendConfig
addToCart(input: AddToCartInput!): CartItemPayload
updateCartItem(input: UpdateCartItemInput!): CartItemPayload
removeCartItem(input: RemoveCartItemInput!): RemoveCartItemResponse
applyCoupon(input: CouponInput!): Boolean
cancelCoupon: Boolean
signUp(input: SignUp!): Boolean
signIn(input: SignIn!): Boolean
signOut: Boolean
editCustomer(input: CustomerInput!): Customer
editAddress(input: EditAddressInput!): Address
addAddress(input: AddAddressInput!): Address
estimateShippingMethods(input: EstimateShippingInput!): [ShippingMethod]
removeCustomerAddress(id: Int!): Boolean
requestCustomerPasswordResetToken(input: EmailInput!): Boolean
changeCustomerPassword(input: CustomerPassword!): Boolean
resetCustomerPassword(input: CustomerPasswordReset!): Boolean
# set current customer order shipping information
setShipping(input: ShippingInput): ShippingInformation
placeOrder(input: PlaceOrderInput!): PlaceOrderResult
}
extend type BackendConfig {
shop: ShopConfig
}
type ShopConfig {
activeCurrency: String
activeStore: String
currencies: [String]
baseCurrency: String
stores: [ShopStoreEntry]
timezone: String
weightUnit: String
}
type ShopStoreEntry {
name: String
code: String
}
input EmailInput {
email: String!
}
input PlaceOrderInput {
billingAddress: AddressInput
email: String
paymentMethod: PaymentMethodInput
}
input PaymentMethodInput {
method: String
}
input ShippingInput {
billingAddress: AddressInput
shippingAddress: AddressInput
shippingCarrierCode: String
shippingMethodCode: String
}
input EstimateShippingInput {
address: AddressInput
}
input ShopPageQuery {
# simple list of field to get aggregated result count
aggregations: [String]
perPage: Int
page: Int
}
input FilterInput {
operator: FilterOperator
field: String
value: [String]
}
enum FilterOperator {
"""
equals - can bee used also as a set, when array is passed
"""
eq
"""
not equals - can be used as "not in set" when array is passed
"""
neq
"""
less than
"""
lt
"""
less than or equals
"""
lte
"""
greater than
"""
gt
"""
greater than or equals
"""
gte
"""
in the set
"""
in
"""
not in the set
"""
nin
"""
in the range
"""
range
}
input CustomerInput {
websiteId: Int!
firstname: String
lastname: String
email: String
defaultBilling: String
defaultShipping: String
}
input AddressInput {
id: Int
# legacy from Magento 2 for placeOrder billingAddress input field
terms: Boolean
firstname: String
lastname: String
city: String
customerId: Int
customerAddressId: Int
postcode: String
sameAsBilling: Int
saveInAddressBook: Int
email: String
company: String
countryId: String
defaultBilling: Boolean
defaultShipping: Boolean
region: String
regionId: Int
street: [String]
telephone: String
}
input AddAddressInput {
company: String
firstname: String!
lastname: String!
telephone: String!
street: [String]
postcode: String!
city: String!
countryId: String!
defaultBilling: Boolean
defaultShipping: Boolean
regionId: Int
}
input EditAddressInput {
id: Int!
company: String
firstname: String!
lastname: String!
telephone: String
street: [String]
postcode: String!
city: String!
countryId: String!
defaultBilling: Boolean
defaultShipping: Boolean
regionId: Int
}
input CustomerPassword {
currentPassword: String!
password: String!
}
input CustomerPasswordReset {
resetToken: String!
password: String!
}
type Orders {
items: [Order]!
pagination: Pagination
}
type Order {
incrementId: String!
entityId: Int
createdAt: String
customerFirstname: String
customerLastname: String
status: String
orderCurrencyCode: String
baseGrandTotal: String
subtotal: String
shippingAmount: String
taxAmount: String
discountAmount: String
grandTotal: String
items: [OrderItem]
shippingDescription: String
paymentMethodName: String
shippingAddress: Address
billingAddress: Address
couponCode: String
}
type PlaceOrderResult {
# increment order id
orderId: Int
# like 0000001 - used for reference by customer
orderRealId: String
}
type Product {
id: String
sku: String!
name: String!
image: String
urlPath: String!
# Full url to resized product image
thumbnail: String
priceType: String
price: String
minPrice: String
maxPrice: String
currency: String
description: String
stock: Stock
type: String
configurableOptions: [ConfigurableProductOption]
bundleOptions: [BundleProductOption]
gallery: [GalleryEntry]
breadcrumbs(path: String!): [Breadcrumb]
seo: ProductSeo
}
type ShippingMethod {
carrierTitle: String
amount: Float
carrierCode: String
methodCode: String
methodTitle: String
priceExclTax: Float
priceInclTax: Float
currency: String
}
type ShippingInformation {
paymentMethods: [PaymentMethod]
totals: [CartTotal]
}
type PaymentMethod {
code: String
title: String
}
type MenuItem {
id: String!
name: String!
urlPath: String!
cssClass: String
children: [MenuItem]!
}
type Category {
id: String
name: String
children: [Category]
description: String
breadcrumbs(path: String!): [Breadcrumb]
products(pagination: PaginationInput, sort: SortOrderInput, filters: [FilterInput]): ProductList
}
type ProductList {
items: [Product]!
aggregations: [Aggregation]
pagination: Pagination
}
type Aggregation {
key: String
name: String
buckets: [AggregationBucket]
}
type AggregationBucket {
value: String
name: String
count: Int
}
type Stock {
isInStock: Boolean
qty: Float!
}
type ProductSeo {
title: String
description: String
keywords: String
}
type Cart {
active: Boolean
#state wheather products will be shipped or not
virtual: Boolean
items: [CartItem]
itemsCount: Int
itemsQty: Int
totals: [CartTotal]
quoteCurrency: String
couponCode: String
billingAddress: Address
}
type CartItem {
itemId: Int!
sku: String!
qty: Float!
name: String
availableQty: Float
price: Float
productType: String
priceInclTax: Float
rowTotal: Float
rowTotalInclTax: Float
rowTotalWithDiscount: Float
taxAmount: Float
taxPercent: Float
discountAmount: Float
discountPercent: Float
weeeTaxAmount: Float
weeeTaxApplied: Boolean
thumbnailUrl: String
urlKey: String
link: String
itemOptions: [CartItemOption]
}
type CartItemOption {
label: String
value: String
data: [CartItemOptionValue]
}
type CartItemOptionValue {
qty: String
name: String
price: String
}
type OrderItem {
itemId: Int!
sku: String!
qty: Float!
name: String
availableQty: Float
price: Float
productType: String
rowTotalInclTax: Float
basePrice: Float
basePriceInclTax: Float
thumbnailUrl: String
urlKey: String
link: String
parentItem: OrderItem
}
type CartTotal {
code: String!
title: String
value: Float
}
input AddToCartInput {
sku: String!
qty: Float!
configurableOptions: [ConfigurableOptionInput]
bundleOptions: [BundleOptionInput]
}
input UpdateCartItemInput {
itemId: Int!
# Magento 2 legacy both itemId and sku need to be provided for rest endpoint to work
sku: String!
qty: Float!
}
input RemoveCartItemInput {
itemId: Int!
}
input ConfigurableOptionInput {
optionId: Int!
value: Int!
}
input BundleOptionInput {
optionId: Int!
optionQty: Float!
optionSelections: [Int]
}
input CouponInput {
couponCode: String!
}
type CartItemPayload {
itemId: Int!
sku: String
qty: Float
name: String
price: Float
productType: String
}
type RemoveCartItemResponse {
itemId: Int
}
type Customer {
id: Int
websiteId: Int
addresses: [Address]
defaultBilling: String
defaultShipping: String
email: String
firstname: String
lastname: String
newsletterSubscriber: Boolean
}
type Address {
id: Int!
company: String
firstname: String!
lastname: String!
street: [String]!
city: String!
postcode: String!
countryId: String!
region: String
regionId: Int
telephone: String
fax: String
defaultBilling: Boolean!
defaultShipping: Boolean!
}
type AddressList {
items: [Address]!
}
input SignUp {
email: String
firstname: String
lastname: String
password: String
address: AddressInput
autoSignIn: Boolean
}
input SignIn {
email: String
password: String
}
type GalleryEntry {
type: String!
full: String!
thumbnail: String
embedUrl: String
}
type Breadcrumb {
name: String
urlPath: String
}
type ConfigurableProductOption {
id: String
attributeId: String
label: String
position: String
productId: String
values: [ConfigurableProductOptionValue]
}
type ConfigurableProductOptionValue {
inStock: [String]
label: String
valueIndex: String
}
type BundleProductOption {
optionId: Int
position: Int
productLinks: [BundleProductOptionLink]
required: Boolean
sku: String
title: String
type: String
}
type BundleProductOptionLink {
canChangeQuantity: Int
name: String
catalogDisplayPrice: String
id: String
isDefault: Boolean
optionId: Int
position: Int
price: String
priceType: String
qty: Int
sku: String
}
type Region {
id: Int
name: String
code: String!
}
type Country {
englishName: String
localName: String
code: String!
regions: [Region]
}
type CountryList {
items: [Country]
}
type CmsBlock {
id: String
title: String
content: String
active: Boolean
}
type CmsPage {
id: String
title: String
content: String
}