
* Reset modal state in collection details * cover initial state * modal updates * cover case when there is no items to add Co-authored-by: andrzejewsky <vox3r69@gmail.com>
51 lines
1.1 KiB
TypeScript
51 lines
1.1 KiB
TypeScript
import { gql } from "@apollo/client";
|
|
import {
|
|
SearchProductsDocument,
|
|
SearchProductsQuery,
|
|
SearchProductsQueryVariables,
|
|
} from "@saleor/graphql";
|
|
import makeTopLevelSearch from "@saleor/hooks/makeTopLevelSearch";
|
|
|
|
export const searchProducts = gql`
|
|
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
|
|
}
|
|
}
|
|
}
|
|
collections {
|
|
id
|
|
}
|
|
}
|
|
}
|
|
pageInfo {
|
|
...PageInfo
|
|
}
|
|
}
|
|
}
|
|
`;
|
|
|
|
export default makeTopLevelSearch<
|
|
SearchProductsQuery,
|
|
SearchProductsQueryVariables
|
|
>(SearchProductsDocument);
|