2020-07-07 10:14:12 +00:00
|
|
|
import gql from "graphql-tag";
|
|
|
|
|
2020-08-28 12:45:11 +00:00
|
|
|
import { metadataFragment } from "./metadata";
|
|
|
|
|
2020-07-07 10:14:12 +00:00
|
|
|
export const collectionFragment = gql`
|
|
|
|
fragment CollectionFragment on Collection {
|
|
|
|
id
|
|
|
|
isPublished
|
|
|
|
name
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const collectionDetailsFragment = gql`
|
|
|
|
${collectionFragment}
|
2020-08-28 12:45:11 +00:00
|
|
|
${metadataFragment}
|
2020-07-07 10:14:12 +00:00
|
|
|
fragment CollectionDetailsFragment on Collection {
|
|
|
|
...CollectionFragment
|
2020-08-28 12:45:11 +00:00
|
|
|
...MetadataFragment
|
2020-07-07 10:14:12 +00:00
|
|
|
backgroundImage {
|
|
|
|
alt
|
|
|
|
url
|
|
|
|
}
|
2020-09-18 14:40:48 +00:00
|
|
|
slug
|
2020-07-07 10:14:12 +00:00
|
|
|
descriptionJson
|
|
|
|
publicationDate
|
|
|
|
seoDescription
|
|
|
|
seoTitle
|
|
|
|
isPublished
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
// 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`
|
|
|
|
fragment CollectionProductFragment on Product {
|
|
|
|
id
|
|
|
|
isPublished
|
|
|
|
name
|
|
|
|
productType {
|
|
|
|
id
|
|
|
|
name
|
|
|
|
}
|
|
|
|
thumbnail {
|
|
|
|
url
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|