2020-07-07 10:14:12 +00:00
|
|
|
import {
|
|
|
|
countryWithTaxesFragment,
|
2020-09-24 10:55:02 +00:00
|
|
|
shopTaxesFragment,
|
|
|
|
taxTypeFragment
|
2020-07-07 10:14:12 +00:00
|
|
|
} from "@saleor/fragments/taxes";
|
2020-09-24 10:55:02 +00:00
|
|
|
import makeQuery from "@saleor/hooks/makeQuery";
|
2019-06-19 14:40:52 +00:00
|
|
|
import gql from "graphql-tag";
|
2020-05-14 09:30:32 +00:00
|
|
|
|
2019-06-19 14:40:52 +00:00
|
|
|
import { TypedQuery } from "../queries";
|
|
|
|
import { CountryList } from "./types/CountryList";
|
2020-09-24 10:55:02 +00:00
|
|
|
import { TaxTypeList } from "./types/TaxTypeList";
|
2019-06-19 14:40:52 +00:00
|
|
|
|
|
|
|
const countryList = gql`
|
|
|
|
${countryWithTaxesFragment}
|
|
|
|
${shopTaxesFragment}
|
|
|
|
query CountryList {
|
|
|
|
shop {
|
|
|
|
...ShopTaxesFragment
|
|
|
|
countries {
|
|
|
|
...CountryWithTaxesFragment
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
export const TypedCountryListQuery = TypedQuery<CountryList, {}>(countryList);
|
2020-09-24 10:55:02 +00:00
|
|
|
|
|
|
|
const taxTypeList = gql`
|
|
|
|
${taxTypeFragment}
|
|
|
|
query TaxTypeList {
|
|
|
|
taxTypes {
|
|
|
|
...TaxTypeFragment
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
2020-09-25 15:02:27 +00:00
|
|
|
export const useTaxTypeList = makeQuery<TaxTypeList, {}>(taxTypeList);
|