saleor-dashboard/src/fragments/collections.ts
Jakub Majorek 10131163c1
SALEOR-2036 Drop descriptionJson and contentJson fields (#950)
* Drop descriptionJson and contentJson fields

* Bump EditorJS version

* Update changelog

* Update tests
2021-01-22 12:13:40 +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
description
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
}
}
`;