saleor-dashboard/src/fragments/attributes.ts
Piotr Grundas 2a21609eae
Numeric attributes (#1065)
* Update schema, types

* Add numeric unit control

* Improvements, tests

* Cleanup

* Add messages

* Small fixes

* Add test id's

* Improve useForm, logic

* Use short names

* Review corrections

* Small improvements
2021-04-29 10:58:03 +02:00

58 lines
1 KiB
TypeScript

import gql from "graphql-tag";
import { fileFragment } from "./file";
import { metadataFragment } from "./metadata";
export const attributeValueFragment = gql`
${fileFragment}
fragment AttributeValueFragment on AttributeValue {
id
name
slug
file {
...FileFragment
}
reference
richText
}
`;
export const attributeFragment = gql`
fragment AttributeFragment on Attribute {
id
name
slug
type
visibleInStorefront
filterableInDashboard
filterableInStorefront
unit
}
`;
export const attributeDetailsFragment = gql`
${attributeFragment}
${metadataFragment}
${attributeValueFragment}
fragment AttributeDetailsFragment on Attribute {
...AttributeFragment
...MetadataFragment
availableInGrid
inputType
entityType
unit
storefrontSearchPosition
valueRequired
values {
...AttributeValueFragment
}
}
`;
export const availableAttributeFragment = gql`
fragment AvailableAttributeFragment on Attribute {
id
name
slug
}
`;