Sale
Sales allow creating discounts for categories, collections or products and are visible to all the customers.
type Sale implements Node, ObjectWithMetadata {
id: ID!
privateMetadata: [MetadataItem!]!
privateMetafield(key: String!): String
privateMetafields(keys: [String!]): Metadata
metadata: [MetadataItem!]!
metafield(key: String!): String
metafields(keys: [String!]): Metadata
name: String!
type: SaleType!
startDate: DateTime!
endDate: DateTime
created: DateTime!
updatedAt: DateTime!
categories(
before: String
after: String
first: Int
last: Int
): CategoryCountableConnection
collections(
before: String
after: String
first: Int
last: Int
): CollectionCountableConnection
products(
before: String
after: String
first: Int
last: Int
): ProductCountableConnection
variants(
before: String
after: String
first: Int
last: Int
): ProductVariantCountableConnection
translation(languageCode: LanguageCodeEnum!): SaleTranslation
channelListings: [SaleChannelListing!]
discountValue: Float
currency: String
}
Fields
Sale.id
● ID!
non-null scalar
Sale.privateMetadata
● [MetadataItem!]!
non-null object
List of private metadata items. Requires staff permissions to access.
Sale.privateMetafield
● String
scalar
A single key from private metadata. Requires staff permissions to access.
Tip: Use GraphQL aliases to fetch multiple keys.
Added in Saleor 3.3This API is currently in Feature Preview and can be subject to changes at later point.
Sale.privateMetafield.key
●String!
non-null scalar
Sale.privateMetafields
● Metadata
scalar
Private metadata. Requires staff permissions to access. Use
Added in Saleor 3.3keys
to control which fields you want to include. The default is to include everything.This API is currently in Feature Preview and can be subject to changes at later point.
Sale.privateMetafields.keys
●[String!]
list scalar
Sale.metadata
● [MetadataItem!]!
non-null object
List of public metadata items. Can be accessed without permissions.
Sale.metafield
● String
scalar
A single key from public metadata.
Tip: Use GraphQL aliases to fetch multiple keys.
Added in Saleor 3.3This API is currently in Feature Preview and can be subject to changes at later point.
Sale.metafield.key
●String!
non-null scalar
Sale.metafields
● Metadata
scalar
Public metadata. Use
Added in Saleor 3.3keys
to control which fields you want to include. The default is to include everything.This API is currently in Feature Preview and can be subject to changes at later point.
Sale.metafields.keys
●[String!]
list scalar
Sale.name
● String!
non-null scalar
Sale.type
● SaleType!
non-null enum
Sale.startDate
● DateTime!
non-null scalar
Sale.endDate
● DateTime
scalar
Sale.created
● DateTime!
non-null scalar
Sale.updatedAt
● DateTime!
non-null scalar
Sale.categories
● CategoryCountableConnection
object
List of categories this sale applies to.
Sale.categories.before
●String
scalarReturn the elements in the list that come before the specified cursor.
Sale.categories.after
● String
scalar
Return the elements in the list that come after the specified cursor.
Sale.categories.first
● Int
scalar
Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.
Sale.categories.last
● Int
scalar
Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.
Sale.collections
● CollectionCountableConnection
object
List of collections this sale applies to.
Sale.collections.before
●String
scalarReturn the elements in the list that come before the specified cursor.
Sale.collections.after
● String
scalar
Return the elements in the list that come after the specified cursor.
Sale.collections.first
● Int
scalar
Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.
Sale.collections.last
● Int
scalar
Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.
Sale.products
● ProductCountableConnection
object
List of products this sale applies to.
Sale.products.before
●String
scalarReturn the elements in the list that come before the specified cursor.
Sale.products.after
● String
scalar
Return the elements in the list that come after the specified cursor.
Sale.products.first
● Int
scalar
Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.
Sale.products.last
● Int
scalar
Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.
Sale.variants
● ProductVariantCountableConnection
object
List of product variants this sale applies to.
Added in Saleor 3.1
Sale.variants.before
●String
scalarReturn the elements in the list that come before the specified cursor.
Sale.variants.after
● String
scalar
Return the elements in the list that come after the specified cursor.
Sale.variants.first
● Int
scalar
Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.
Sale.variants.last
● Int
scalar
Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.
Sale.translation
● SaleTranslation
object
Returns translated sale fields for the given language code.
Sale.translation.languageCode
●LanguageCodeEnum!
non-null enumA language code to return the translation for sale.
Sale.channelListings
● [SaleChannelListing!]
list object
List of channels available for the sale.
Sale.discountValue
● Float
scalar
Sale value.
Sale.currency
● String
scalar
Currency code for sale.
Interfaces
Node
interface
An object with an ID
ObjectWithMetadata
interface
Returned by
sale
query
Member of
SaleAddCatalogues
object ● SaleChannelListingUpdate
object ● SaleCountableEdge
object ● SaleCreate
object ● SaleCreated
object ● SaleDelete
object ● SaleDeleted
object ● SaleRemoveCatalogues
object ● SaleToggle
object ● SaleTranslatableContent
object ● SaleTranslate
object ● SaleUpdate
object ● SaleUpdated
object