saleor-dashboard/src/fragments/collections.ts
Dominik Żegleń 2765dc1324
Use product pricing instead of discounted price (#847)
* Use product pricing instead of discountedPrice

* Fix input width

* Update snapshots

* Fix reading price range of null pricing

Co-authored-by: Dawid Tarasiuk <tarasiukdawid@gmail.com>
2020-11-23 14:04:24 +01:00

58 lines
1.2 KiB
TypeScript

import { channelListingProductWithoutPricingFragment } from "@saleor/fragments/products";
import gql from "graphql-tag";
import { metadataFragment } from "./metadata";
export const collectionFragment = gql`
fragment CollectionFragment on Collection {
id
name
channelListings {
isPublished
publicationDate
channel {
id
name
}
}
}
`;
export const collectionDetailsFragment = gql`
${collectionFragment}
${metadataFragment}
fragment CollectionDetailsFragment on Collection {
...CollectionFragment
...MetadataFragment
backgroundImage {
alt
url
}
slug
descriptionJson
seoDescription
seoTitle
}
`;
// This fragment is used to make sure that product's fields that are returned
// are always the same - fixes apollo cache
// https://github.com/apollographql/apollo-client/issues/2496
// https://github.com/apollographql/apollo-client/issues/3468
export const collectionProductFragment = gql`
${channelListingProductWithoutPricingFragment}
fragment CollectionProductFragment on Product {
id
name
productType {
id
name
}
thumbnail {
url
}
channelListings {
...ChannelListingProductWithoutPricingFragment
}
}
`;