type SearchReindexResponse {
    success: Boolean!
}

type SearchResponse {
    items: [SearchResult!]!
    totalItems: Int!
    facetValues: [FacetValueResult!]!
}

"""
Which FacetValues are present in the products returned
by the search, and in what quantity.
"""
type FacetValueResult {
    facetValue: FacetValue!
    count: Int!
}

type SearchResult {
    sku: String!
    slug: String!
    productId: ID!
    productName: String!
    productPreview: String!
    productVariantId: ID!
    productVariantName: String!
    productVariantPreview: String!
    price: SearchResultPrice!
    priceWithTax: SearchResultPrice!
    currencyCode: CurrencyCode!
    description: String!
    facetIds: [String!]!
    facetValueIds: [String!]!
    "An array of ids of the Collections in which this result appears"
    collectionIds: [String!]!
    "A relevence score for the result. Differs between database implementations"
    score: Float!
}

"The price of a search result product, either as a range or as a single price"
union SearchResultPrice = PriceRange | SinglePrice

"The price value where the result has a single price"
type SinglePrice {
    value: Int!
}

"The price range where the result has more than one price"
type PriceRange {
    min: Int!
    max: Int!
}
