admin-queries.ts 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. import { CHANNEL_FRAGMENT } from '@vendure/core/e2e/graphql/fragments';
  2. import gql from 'graphql-tag';
  3. export const PAYMENT_METHOD_FRAGMENT = gql`
  4. fragment PaymentMethod on PaymentMethod {
  5. id
  6. code
  7. name
  8. description
  9. enabled
  10. checker {
  11. code
  12. args {
  13. name
  14. value
  15. }
  16. }
  17. handler {
  18. code
  19. args {
  20. name
  21. value
  22. }
  23. }
  24. }
  25. `;
  26. export const CREATE_PAYMENT_METHOD = gql`
  27. mutation CreatePaymentMethod($input: CreatePaymentMethodInput!) {
  28. createPaymentMethod(input: $input) {
  29. ...PaymentMethod
  30. }
  31. }
  32. ${PAYMENT_METHOD_FRAGMENT}
  33. `;
  34. export const GET_CUSTOMER_LIST = gql`
  35. query GetCustomerList($options: CustomerListOptions) {
  36. customers(options: $options) {
  37. items {
  38. id
  39. title
  40. firstName
  41. lastName
  42. emailAddress
  43. phoneNumber
  44. user {
  45. id
  46. verified
  47. }
  48. }
  49. totalItems
  50. }
  51. }
  52. `;
  53. const REFUND_FRAGMENT = gql`
  54. fragment Refund on Refund {
  55. id
  56. state
  57. items
  58. transactionId
  59. shipping
  60. total
  61. metadata
  62. }
  63. `;
  64. export const REFUND_ORDER = gql`
  65. mutation RefundOrder($input: RefundOrderInput!) {
  66. refundOrder(input: $input) {
  67. ...Refund
  68. ... on ErrorResult {
  69. errorCode
  70. message
  71. }
  72. }
  73. }
  74. ${REFUND_FRAGMENT}
  75. `;
  76. export const GET_ORDER_PAYMENTS = gql`
  77. query order($id: ID!) {
  78. order(id: $id) {
  79. id
  80. state
  81. totalWithTax
  82. payments {
  83. id
  84. transactionId
  85. method
  86. amount
  87. state
  88. errorMessage
  89. metadata
  90. }
  91. }
  92. }
  93. `;
  94. export const CREATE_CHANNEL = gql`
  95. mutation CreateChannel($input: CreateChannelInput!) {
  96. createChannel(input: $input) {
  97. ... on Channel {
  98. id
  99. code
  100. token
  101. currencyCode
  102. }
  103. ... on ErrorResult {
  104. errorCode
  105. message
  106. }
  107. }
  108. }
  109. `;
  110. export const CREATE_COUPON = gql`
  111. mutation CreatePromotion($input: CreatePromotionInput!) {
  112. createPromotion(input: $input) {
  113. ... on ErrorResult {
  114. errorCode
  115. }
  116. __typename
  117. }
  118. }
  119. `;