saleor-dashboard/src/taxes/queries.ts

36 lines
820 B
TypeScript
Raw Normal View History

import {
countryWithTaxesFragment,
shopTaxesFragment,
taxTypeFragment
} from "@saleor/fragments/taxes";
import makeQuery from "@saleor/hooks/makeQuery";
2019-06-19 14:40:52 +00:00
import gql from "graphql-tag";
2019-06-19 14:40:52 +00:00
import { TypedQuery } from "../queries";
import { CountryList } from "./types/CountryList";
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);
const taxTypeList = gql`
${taxTypeFragment}
query TaxTypeList {
taxTypes {
...TaxTypeFragment
}
}
`;
2020-09-25 15:02:27 +00:00
export const useTaxTypeList = makeQuery<TaxTypeList, {}>(taxTypeList);