saleor-dashboard/src/fragments/attributes.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

83 lines
1.6 KiB
TypeScript

import { gql } from "@apollo/client";
import { fileFragment } from "./file";
import { metadataFragment } from "./metadata";
import { pageInfoFragment } from "./pageInfo";
export const attributeValueFragment = gql`
${fileFragment}
fragment AttributeValueFragment on AttributeValue {
id
name
slug
file {
...FileFragment
}
reference
boolean
date
dateTime
value
}
`;
export const attributeValueDetailsFragment = gql`
${attributeValueFragment}
fragment AttributeValueDetailsFragment on AttributeValue {
...AttributeValueFragment
richText
}
`;
export const attributeFragment = gql`
fragment AttributeFragment on Attribute {
id
name
slug
type
visibleInStorefront
filterableInDashboard
filterableInStorefront
unit
inputType
}
`;
export const attributeDetailsFragment = gql`
${attributeFragment}
${metadataFragment}
fragment AttributeDetailsFragment on Attribute {
...AttributeFragment
...MetadataFragment
availableInGrid
inputType
entityType
unit
storefrontSearchPosition
valueRequired
}
`;
export const attributeValueListFragment = gql`
${attributeValueDetailsFragment}
${pageInfoFragment}
fragment AttributeValueListFragment on AttributeValueCountableConnection {
pageInfo {
...PageInfoFragment
}
edges {
cursor
node {
...AttributeValueDetailsFragment
}
}
}
`;
export const availableAttributeFragment = gql`
fragment AvailableAttributeFragment on Attribute {
id
name
slug
}
`;