saleor-dashboard/src/fragments/pages.ts
Wojciech Mista 66705e7f3e
Don't display pricing by default in Product List (#1891)
* Update build-types script

* Remove "pricing" where it's unused; exclude pricing query if no channel is selected

* Update fixtures

* Fix minor preorder issue

* Update types

* Fix build-types script

* Remove unnecessary product fragment

* Fetch only data that is visible in products list (#1892)

* Conditionally include attributes in product list query

* Add 'hasSelectedAtrributes' variable to product list query

* Refactor condition

* Create AttributeValueDetailsFragment fragment

* Use attributeValueDetailsFragment

* Update fragment in products
2022-03-03 11:14:18 +01:00

79 lines
1.5 KiB
TypeScript

import { gql } from "@apollo/client";
import {
attributeValueDetailsFragment,
attributeValueListFragment
} from "./attributes";
import { metadataFragment } from "./metadata";
export const pageFragment = gql`
fragment PageFragment on Page {
id
title
slug
isPublished
}
`;
export const pageAttributesFragment = gql`
${attributeValueDetailsFragment}
${attributeValueListFragment}
fragment PageAttributesFragment on Page {
attributes {
attribute {
id
slug
name
inputType
entityType
valueRequired
unit
choices(
first: $firstValues
after: $afterValues
last: $lastValues
before: $beforeValues
) {
...AttributeValueListFragment
}
}
values {
...AttributeValueDetailsFragment
}
}
pageType {
id
name
attributes {
id
name
inputType
entityType
valueRequired
choices(
first: $firstValues
after: $afterValues
last: $lastValues
before: $beforeValues
) {
...AttributeValueListFragment
}
}
}
}
`;
export const pageDetailsFragment = gql`
${pageFragment}
${pageAttributesFragment}
${metadataFragment}
fragment PageDetailsFragment on Page {
...PageFragment
...PageAttributesFragment
...MetadataFragment
content
seoTitle
seoDescription
publicationDate
}
`;