import { gql } from "@apollo/client"; import { countryWithTaxesFragment, shopTaxesFragment, taxTypeFragment } from "@saleor/fragments/taxes"; import makeQuery from "@saleor/hooks/makeQuery"; import { TypedQuery } from "../queries"; import { CountryList } from "./types/CountryList"; import { TaxTypeList } from "./types/TaxTypeList"; const countryList = gql` ${countryWithTaxesFragment} ${shopTaxesFragment} query CountryList { shop { ...ShopTaxesFragment countries { ...CountryWithTaxesFragment } } } `; export const TypedCountryListQuery = TypedQuery(countryList); const taxTypeList = gql` ${taxTypeFragment} query TaxTypeList { taxTypes { ...TaxTypeFragment } } `; export const useTaxTypeList = makeQuery(taxTypeList);