saleor-dashboard/src/taxes/queries.ts

46 lines
933 B
TypeScript
Raw Normal View History

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";
export const countryFragment = gql`
fragment CountryFragment on CountryDisplay {
country
code
}
`;
export const countryWithTaxesFragment = gql`
${countryFragment}
fragment CountryWithTaxesFragment on CountryDisplay {
...CountryFragment
vat {
standardRate
reducedRates {
rateType
rate
}
}
}
`;
export const shopTaxesFragment = gql`
fragment ShopTaxesFragment on Shop {
chargeTaxesOnShipping
includeTaxesInPrices
displayGrossPrices
}
`;
const countryList = gql`
${countryWithTaxesFragment}
${shopTaxesFragment}
query CountryList {
shop {
...ShopTaxesFragment
countries {
...CountryWithTaxesFragment
}
}
}
`;
export const TypedCountryListQuery = TypedQuery<CountryList, {}>(countryList);