
* 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
58 lines
1 KiB
TypeScript
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
|
|
}
|
|
`;
|