# import UserParts from './fragments/user.fragment.graphql'
# import PaginatorParts from './paginator.fragment.graphql'
query UsersByPermission(
  $is_active: Boolean
  $permission: String!
  $search: String
  $orderBy: String
  $sortedBy: String
  $searchJoin: String = "AND"
  $first: Int
  $page: Int
  $shop_id: String
  $exclude: String
) {
  usersByPermission(
    is_active: $is_active
    permission: $permission
    search: $search
    orderBy: $orderBy
    sortedBy: $sortedBy
    searchJoin: $searchJoin
    first: $first
    page: $page
    shop_id: $shop_id
    exclude: $exclude
  ) {
    data {
      ...UserParts
    }
    paginatorInfo {
      ...PaginatorParts
    }
  }
}
query MyStaffs(
  $search: String
  $orderBy: String
  $sortedBy: String
  $searchJoin: String = "AND"
  $first: Int
  $page: Int
) {
  myStaffs(
    search: $search
    orderBy: $orderBy
    sortedBy: $sortedBy
    searchJoin: $searchJoin
    first: $first
    page: $page
  ) {
    data {
      ...UserParts
    }
    paginatorInfo {
      ...PaginatorParts
    }
  }
}

mutation UpdateUser($input: UpdateUserInput!) {
  updateUser(input: $input) {
    id
    name
    email
    permissions {
      id
      name
    }
    profile {
      avatar {
        id
        thumbnail
        original
      }
      contact
      bio
      socials {
        type
        link
      }
    }
    address {
      title
      default
      type
      address {
        street_address
        country
        city
        state
        zip
      }
    }
    wallet {
      id
      total_points
      points_used
      available_points
    }
  }
}

mutation AddPoints($input: AddPointsInput!) {
  addPoints(input: $input)
}

mutation MakeOrRevokeAdmin($input: MakeOrRevokeAdminInput!) {
  makeOrRevokeAdmin(input: $input)
}

mutation UpdateUserEmail($input: UpdateEmailUserInput!) {
  updateUserEmail(input: $input) {
    message
    success
  }
}
