settings-definitions.ts 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. import gql from 'graphql-tag';
  2. export const COUNTRY_FRAGMENT = gql`
  3. fragment Country on Country {
  4. id
  5. code
  6. name
  7. enabled
  8. translations {
  9. id
  10. languageCode
  11. name
  12. }
  13. }
  14. `;
  15. export const GET_COUNTRY_LIST = gql`
  16. query GetCountryList($options: CountryListOptions) {
  17. countries(options: $options) {
  18. items {
  19. id
  20. code
  21. name
  22. enabled
  23. }
  24. totalItems
  25. }
  26. }
  27. `;
  28. export const GET_COUNTRY = gql`
  29. query GetCountry($id: ID!) {
  30. country(id: $id) {
  31. ...Country
  32. }
  33. }
  34. ${COUNTRY_FRAGMENT}
  35. `;
  36. export const CREATE_COUNTRY = gql`
  37. mutation CreateCountry($input: CreateCountryInput!) {
  38. createCountry(input: $input) {
  39. ...Country
  40. }
  41. }
  42. ${COUNTRY_FRAGMENT}
  43. `;
  44. export const UPDATE_COUNTRY = gql`
  45. mutation UpdateCountry($input: UpdateCountryInput!) {
  46. updateCountry(input: $input) {
  47. ...Country
  48. }
  49. }
  50. ${COUNTRY_FRAGMENT}
  51. `;
  52. export const ZONE_FRAGMENT = gql`
  53. fragment Zone on Zone {
  54. id
  55. name
  56. members {
  57. ...Country
  58. }
  59. }
  60. ${COUNTRY_FRAGMENT}
  61. `;
  62. export const GET_ZONES = gql`
  63. query GetZones {
  64. zones {
  65. id
  66. name
  67. members {
  68. id
  69. name
  70. code
  71. }
  72. }
  73. }
  74. `;
  75. export const GET_ZONE = gql`
  76. query GetZone($id: ID!) {
  77. zone(id: $id) {
  78. ...Zone
  79. }
  80. }
  81. ${ZONE_FRAGMENT}
  82. `;
  83. export const CREATE_ZONE = gql`
  84. mutation CreateZone($input: CreateZoneInput!) {
  85. createZone(input: $input) {
  86. ...Zone
  87. }
  88. }
  89. ${ZONE_FRAGMENT}
  90. `;
  91. export const UPDATE_ZONE = gql`
  92. mutation UpdateZone($input: UpdateZoneInput!) {
  93. updateZone(input: $input) {
  94. ...Zone
  95. }
  96. }
  97. ${ZONE_FRAGMENT}
  98. `;
  99. export const ADD_MEMBERS_TO_ZONE = gql`
  100. mutation AddMembersToZone($zoneId: ID!, $memberIds: [ID!]!) {
  101. addMembersToZone(zoneId: $zoneId, memberIds: $memberIds) {
  102. ...Zone
  103. }
  104. }
  105. ${ZONE_FRAGMENT}
  106. `;
  107. export const REMOVE_MEMBERS_FROM_ZONE = gql`
  108. mutation RemoveMembersFromZone($zoneId: ID!, $memberIds: [ID!]!) {
  109. removeMembersFromZone(zoneId: $zoneId, memberIds: $memberIds) {
  110. ...Zone
  111. }
  112. }
  113. ${ZONE_FRAGMENT}
  114. `;
  115. export const TAX_CATEGORY_FRAGMENT = gql`
  116. fragment TaxCategory on TaxCategory {
  117. id
  118. name
  119. }
  120. `;
  121. export const GET_TAX_CATEGORIES = gql`
  122. query GetTaxCategories {
  123. taxCategories {
  124. ...TaxCategory
  125. }
  126. }
  127. ${TAX_CATEGORY_FRAGMENT}
  128. `;
  129. export const GET_TAX_CATEGORY = gql`
  130. query GetTaxCategory($id: ID!) {
  131. taxCategory(id: $id) {
  132. ...TaxCategory
  133. }
  134. }
  135. ${TAX_CATEGORY_FRAGMENT}
  136. `;
  137. export const CREATE_TAX_CATEGORY = gql`
  138. mutation CreateTaxCategory($input: CreateTaxCategoryInput!) {
  139. createTaxCategory(input: $input) {
  140. ...TaxCategory
  141. }
  142. }
  143. ${TAX_CATEGORY_FRAGMENT}
  144. `;
  145. export const UPDATE_TAX_CATEGORY = gql`
  146. mutation UpdateTaxCategory($input: UpdateTaxCategoryInput!) {
  147. updateTaxCategory(input: $input) {
  148. ...TaxCategory
  149. }
  150. }
  151. ${TAX_CATEGORY_FRAGMENT}
  152. `;
  153. export const TAX_RATE_FRAGMENT = gql`
  154. fragment TaxRate on TaxRate {
  155. id
  156. name
  157. enabled
  158. value
  159. category {
  160. id
  161. name
  162. }
  163. zone {
  164. id
  165. name
  166. }
  167. customerGroup {
  168. id
  169. name
  170. }
  171. }
  172. `;
  173. export const GET_TAX_RATE_LIST = gql`
  174. query GetTaxRateList($options: TaxRateListOptions) {
  175. taxRates(options: $options) {
  176. items {
  177. ...TaxRate
  178. }
  179. totalItems
  180. }
  181. }
  182. ${TAX_RATE_FRAGMENT}
  183. `;
  184. export const GET_TAX_RATE = gql`
  185. query GetTaxRate($id: ID!) {
  186. taxRate(id: $id) {
  187. ...TaxRate
  188. }
  189. }
  190. ${TAX_RATE_FRAGMENT}
  191. `;
  192. export const CREATE_TAX_RATE = gql`
  193. mutation CreateTaxRate($input: CreateTaxRateInput!) {
  194. createTaxRate(input: $input) {
  195. ...TaxRate
  196. }
  197. }
  198. ${TAX_RATE_FRAGMENT}
  199. `;
  200. export const UPDATE_TAX_RATE = gql`
  201. mutation UpdateTaxRate($input: UpdateTaxRateInput!) {
  202. updateTaxRate(input: $input) {
  203. ...TaxRate
  204. }
  205. }
  206. ${TAX_RATE_FRAGMENT}
  207. `;
  208. export const CHANNEL_FRAGMENT = gql`
  209. fragment Channel on Channel {
  210. id
  211. code
  212. token
  213. pricesIncludeTax
  214. defaultLanguageCode
  215. defaultShippingZone {
  216. id
  217. name
  218. }
  219. defaultTaxZone {
  220. id
  221. name
  222. }
  223. }
  224. `;
  225. export const GET_CHANNELS = gql`
  226. query GetChannels {
  227. channels {
  228. ...Channel
  229. }
  230. }
  231. ${CHANNEL_FRAGMENT}
  232. `;
  233. export const GET_CHANNEL = gql`
  234. query GetChannel($id: ID!) {
  235. channel(id: $id) {
  236. ...Channel
  237. }
  238. }
  239. ${CHANNEL_FRAGMENT}
  240. `;
  241. export const GET_ACTIVE_CHANNEL = gql`
  242. query GetActiveChannel {
  243. activeChannel {
  244. ...Channel
  245. }
  246. }
  247. ${CHANNEL_FRAGMENT}
  248. `;
  249. export const CREATE_CHANNEL = gql`
  250. mutation CreateChannel($input: CreateChannelInput!) {
  251. createChannel(input: $input) {
  252. ...Channel
  253. }
  254. }
  255. ${CHANNEL_FRAGMENT}
  256. `;
  257. export const UPDATE_CHANNEL = gql`
  258. mutation UpdateChannel($input: UpdateChannelInput!) {
  259. updateChannel(input: $input) {
  260. ...Channel
  261. }
  262. }
  263. ${CHANNEL_FRAGMENT}
  264. `;
  265. export const PAYMENT_METHOD_FRAGMENT = gql`
  266. fragment PaymentMethod on PaymentMethod {
  267. id
  268. code
  269. enabled
  270. configArgs {
  271. name
  272. type
  273. value
  274. }
  275. }
  276. `;
  277. export const GET_PAYMENT_METHOD_LIST = gql`
  278. query GetPaymentMethodList($options: PaymentMethodListOptions!) {
  279. paymentMethods(options: $options) {
  280. items {
  281. ...PaymentMethod
  282. }
  283. totalItems
  284. }
  285. }
  286. ${PAYMENT_METHOD_FRAGMENT}
  287. `;
  288. export const GET_PAYMENT_METHOD = gql`
  289. query GetPaymentMethod($id: ID!) {
  290. paymentMethod(id: $id) {
  291. ...PaymentMethod
  292. }
  293. }
  294. ${PAYMENT_METHOD_FRAGMENT}
  295. `;
  296. export const UPDATE_PAYMENT_METHOD = gql`
  297. mutation UpdatePaymentMethod($input: UpdatePaymentMethodInput!) {
  298. updatePaymentMethod(input: $input) {
  299. ...PaymentMethod
  300. }
  301. }
  302. ${PAYMENT_METHOD_FRAGMENT}
  303. `;