# import PaginatorParts from '../fragments/paginator.fragment.graphql'

query Refunds(
  $orderBy: String
  $sortedBy: String
  $shop_id: Int
  $order_id: Int
  $customer_id: Int
  $first: Int = 10
  $page: Int
) {
  refunds(
    orderBy: $orderBy
    sortedBy: $sortedBy
    shop_id: $shop_id
    order_id: $order_id
    customer_id: $customer_id
    first: $first
    page: $page
  ) {
    data {
      id
      title
      amount
      status
      order {
        # id
        tracking_number
        # amount
        # payment_gateway
      }
      # customer {
      #   id
      #   email
      # }
      created_at
      updated_at
    }
    paginatorInfo {
      ...PaginatorParts
    }
  }
}

query RefundReasons(
  $search: String
  $orderBy: String
  $sortedBy: String
  $language: String
  $searchJoin: String
  $first: Int = 15
  $page: Int
) {
  refundReasons(
    search: $search
    orderBy: $orderBy
    sortedBy: $sortedBy
    language: $language
    searchJoin: $searchJoin
    first: $first
    page: $page
  ) {
    data {
      id
      name
      slug
    }
    paginatorInfo {
      ...PaginatorParts
    }
  }
}

mutation CreateRefund($input: CreateRefundInput!) {
  createRefund(input: $input) {
    id
    title
    description
    images {
      thumbnail
      original
      id
    }
  }
}
