32 lines
723 B
TypeScript
32 lines
723 B
TypeScript
import gql from "graphql-tag";
|
|
|
|
import makeTopLevelSearch from "@saleor/hooks/makeTopLevelSearch";
|
|
import { pageInfoFragment } from "@saleor/queries";
|
|
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, query: $query) {
|
|
edges {
|
|
node {
|
|
id
|
|
name
|
|
thumbnail {
|
|
url
|
|
}
|
|
}
|
|
}
|
|
pageInfo {
|
|
...PageInfoFragment
|
|
}
|
|
}
|
|
}
|
|
`;
|
|
|
|
export default makeTopLevelSearch<SearchProducts, SearchProductsVariables>(
|
|
searchProducts
|
|
);
|