2019-06-19 14:40:52 +00:00
|
|
|
import gql from "graphql-tag";
|
|
|
|
|
2019-10-15 12:17:35 +00:00
|
|
|
import { pageInfoFragment } from "@saleor/queries";
|
|
|
|
import TopLevelSearch from "../TopLevelSearch";
|
2019-06-19 14:40:52 +00:00
|
|
|
import {
|
|
|
|
SearchCustomers,
|
|
|
|
SearchCustomersVariables
|
|
|
|
} from "./types/SearchCustomers";
|
|
|
|
|
|
|
|
export const searchCustomers = gql`
|
2019-10-15 12:17:35 +00:00
|
|
|
${pageInfoFragment}
|
2019-06-19 14:40:52 +00:00
|
|
|
query SearchCustomers($after: String, $first: Int!, $query: String!) {
|
2019-10-15 12:17:35 +00:00
|
|
|
search: customers(after: $after, first: $first, query: $query) {
|
2019-06-19 14:40:52 +00:00
|
|
|
edges {
|
|
|
|
node {
|
|
|
|
id
|
|
|
|
email
|
|
|
|
}
|
|
|
|
}
|
2019-10-15 12:17:35 +00:00
|
|
|
pageInfo {
|
|
|
|
...PageInfoFragment
|
|
|
|
}
|
2019-06-19 14:40:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2019-10-15 12:17:35 +00:00
|
|
|
export default TopLevelSearch<SearchCustomers, SearchCustomersVariables>(
|
2019-06-19 14:40:52 +00:00
|
|
|
searchCustomers
|
|
|
|
);
|