Sale
Sales allow creating discounts for categories, collections or products and are visible to all the customers.
DEPRECATED: this type will be removed in Saleor 4.0. Use Promotion
type instead.
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 miscellaneous
The ID of the sale.
Sale.privateMetadata
● [MetadataItem!]!
non-null object miscellaneous
List of private metadata items. Requires staff permissions to access.
Sale.privateMetafield
● String
scalar miscellaneous
A single key from private metadata. Requires staff permissions to access.
Tip: Use GraphQL aliases to fetch multiple keys.
Added in Saleor 3.3
Sale.privateMetafield.key
●String!
non-null scalar miscellaneous
Sale.privateMetafields
● Metadata
scalar miscellaneous
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.
Sale.privateMetafields.keys
●[String!]
list scalar miscellaneous
Sale.metadata
● [MetadataItem!]!
non-null object miscellaneous
List of public metadata items. Can be accessed without permissions.
Sale.metafield
● String
scalar miscellaneous
A single key from public metadata.
Tip: Use GraphQL aliases to fetch multiple keys.
Added in Saleor 3.3
Sale.metafield.key
●String!
non-null scalar miscellaneous
Sale.metafields
● Metadata
scalar miscellaneous
Public metadata. Use
Added in Saleor 3.3keys
to control which fields you want to include. The default is to include everything.
Sale.metafields.keys
●[String!]
list scalar miscellaneous
Sale.name
● String!
non-null scalar miscellaneous
The name of the sale.
Sale.type
● SaleType!
non-null enum discounts
Type of the sale, fixed or percentage.
Sale.startDate
● DateTime!
non-null scalar miscellaneous
The start date and time of the sale.
Sale.endDate
● DateTime
scalar miscellaneous
The end date and time of the sale.
Sale.created
● DateTime!
non-null scalar miscellaneous
The date and time when the sale was created.
Sale.updatedAt
● DateTime!
non-null scalar miscellaneous
The date and time when the sale was updated.
Sale.categories
● CategoryCountableConnection
object products
List of categories this sale applies to.
Sale.categories.before
●String
scalar miscellaneousReturn the elements in the list that come before the specified cursor.
Sale.categories.after
● String
scalar miscellaneous
Return the elements in the list that come after the specified cursor.
Sale.categories.first
● Int
scalar miscellaneous
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 miscellaneous
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 products
List of collections this sale applies to.
Sale.collections.before
●String
scalar miscellaneousReturn the elements in the list that come before the specified cursor.
Sale.collections.after
● String
scalar miscellaneous
Return the elements in the list that come after the specified cursor.
Sale.collections.first
● Int
scalar miscellaneous
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 miscellaneous
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 products
List of products this sale applies to.
Sale.products.before
●String
scalar miscellaneousReturn the elements in the list that come before the specified cursor.
Sale.products.after
● String
scalar miscellaneous
Return the elements in the list that come after the specified cursor.
Sale.products.first
● Int
scalar miscellaneous
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 miscellaneous
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 products
List of product variants this sale applies to.
Added in Saleor 3.1
Sale.variants.before
●String
scalar miscellaneousReturn the elements in the list that come before the specified cursor.
Sale.variants.after
● String
scalar miscellaneous
Return the elements in the list that come after the specified cursor.
Sale.variants.first
● Int
scalar miscellaneous
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 miscellaneous
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 discounts
Returns translated sale fields for the given language code.
Sale.translation.languageCode
●LanguageCodeEnum!
non-null enum miscellaneousA language code to return the translation for sale.
Sale.channelListings
● [SaleChannelListing!]
list object discounts
List of channels available for the sale.
Sale.discountValue
● Float
scalar miscellaneous
Sale value.
Sale.currency
● String
scalar miscellaneous
Currency code for sale.
Interfaces
Node
interface miscellaneous
An object with an ID
ObjectWithMetadata
interface miscellaneous
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