saleor-dashboard/src/searches/useCollectionSearch.ts
2019-11-21 15:59:34 +01:00

30 lines
702 B
TypeScript

import gql from "graphql-tag";
import makeTopLevelSearch from "@saleor/hooks/makeTopLevelSearch";
import { pageInfoFragment } from "@saleor/queries";
import {
SearchCollections,
SearchCollectionsVariables
} from "./types/SearchCollections";
export const searchCollections = gql`
${pageInfoFragment}
query SearchCollections($after: String, $first: Int!, $query: String!) {
search: collections(after: $after, first: $first, query: $query) {
edges {
node {
id
name
}
}
pageInfo {
...PageInfoFragment
}
}
}
`;
export default makeTopLevelSearch<
SearchCollections,
SearchCollectionsVariables
>(searchCollections);