
* Update schema and biuld types for sale per variant * Create variant search module and generate types for it * Add listing component for sale view * Create dialog for variant assignment * Expand sale page with vairnats * Add new sale fixtures * Add transaltions for variants on sale view * Update snapshot * Refactor sales dialogs and tables, move styles and ittl to local files * Rework search dialog. Create item/subitem selectable table for variants, update spapshot * Adjust table columns width * Standardize the tables * Unify messages * Drop whole variant object in favor of just ids, simplify filtring functions * Update snapshots Co-authored-by: Jakub Majorek <majorek.jakub@gmail.com>
49 lines
1.1 KiB
TypeScript
49 lines
1.1 KiB
TypeScript
import { pageInfoFragment } from "@saleor/fragments/pageInfo";
|
|
import makeTopLevelSearch from "@saleor/hooks/makeTopLevelSearch";
|
|
import gql from "graphql-tag";
|
|
|
|
import {
|
|
SearchProducts,
|
|
SearchProductsVariables
|
|
} from "./types/SearchProducts";
|
|
|
|
export const searchProducts = gql`
|
|
${pageInfoFragment}
|
|
query SearchProducts($after: String, $first: Int!, $query: String!) {
|
|
search: products(after: $after, first: $first, filter: { search: $query }) {
|
|
edges {
|
|
node {
|
|
id
|
|
name
|
|
thumbnail {
|
|
url
|
|
}
|
|
variants {
|
|
id
|
|
name
|
|
sku
|
|
channelListings {
|
|
channel {
|
|
id
|
|
isActive
|
|
name
|
|
currencyCode
|
|
}
|
|
price {
|
|
amount
|
|
currency
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
pageInfo {
|
|
...PageInfoFragment
|
|
}
|
|
}
|
|
}
|
|
`;
|
|
|
|
export default makeTopLevelSearch<SearchProducts, SearchProductsVariables>(
|
|
searchProducts
|
|
);
|