admin-definitions.ts 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. import { paymentMethodFragment, refundFragment } from './fragments-admin';
  2. import { graphql } from './graphql-admin';
  3. export const createPaymentMethodDocument = graphql(
  4. `
  5. mutation CreatePaymentMethod($input: CreatePaymentMethodInput!) {
  6. createPaymentMethod(input: $input) {
  7. ...PaymentMethod
  8. }
  9. }
  10. `,
  11. [paymentMethodFragment],
  12. );
  13. export const getCustomerListDocument = graphql(`
  14. query GetCustomerList($options: CustomerListOptions) {
  15. customers(options: $options) {
  16. items {
  17. id
  18. title
  19. firstName
  20. lastName
  21. emailAddress
  22. phoneNumber
  23. user {
  24. id
  25. verified
  26. }
  27. }
  28. totalItems
  29. }
  30. }
  31. `);
  32. export const getOrderPaymentsDocument = graphql(`
  33. query order($id: ID!) {
  34. order(id: $id) {
  35. id
  36. state
  37. totalWithTax
  38. payments {
  39. id
  40. transactionId
  41. method
  42. amount
  43. state
  44. errorMessage
  45. metadata
  46. }
  47. }
  48. }
  49. `);
  50. export const refundOrderDocument = graphql(
  51. `
  52. mutation RefundOrder($input: RefundOrderInput!) {
  53. refundOrder(input: $input) {
  54. ...Refund
  55. ... on ErrorResult {
  56. errorCode
  57. message
  58. }
  59. }
  60. }
  61. `,
  62. [refundFragment],
  63. );
  64. export const createChannelDocument = graphql(`
  65. mutation CreateChannel($input: CreateChannelInput!) {
  66. createChannel(input: $input) {
  67. ... on Channel {
  68. id
  69. code
  70. token
  71. currencyCode
  72. }
  73. ... on ErrorResult {
  74. errorCode
  75. message
  76. }
  77. }
  78. }
  79. `);
  80. export const createCouponDocument = graphql(`
  81. mutation CreatePromotion($input: CreatePromotionInput!) {
  82. createPromotion(input: $input) {
  83. ... on ErrorResult {
  84. errorCode
  85. }
  86. __typename
  87. }
  88. }
  89. `);