Email Request
May 24th, 2024
  • mutation to create an email request requires an email in argument. 
    example:
mutation CreateEmailRequest {
  createEmailRequest(email: "mahaveer3@commutatus.com") {
    approved_at
    created_at
    email
    expired_at
    id
    rejected_at
    status
    updated_at
    permissions {
      can_approve
      can_reject
    }
    member {
      full_name
      home_lc {
        id
        name
      }
      id
    }
  }
}

  • mutation to approve an email request requires the id of an email request.
    example:
mutation ApproveEmailRequest {
  approveEmailRequest(id: "9") {
    approved_at
    approved_by {
      id
      full_name
    }
  }
}

  • mutation to reject an email request requires the id of an email request.
    example:
mutation RejectEmailRequest {
  rejectEmailRequest(id: "9") {
    rejected_at
    rejected_by {
      id
      full_name
    }
  }
}

  • query to get all email requests with pagination.
example:
query EmailRequests {
  emailRequests(pagination: { per_page: 10, page: 1 }) {
    data {
      approved_at
      created_at
      email
      expired_at
      id
      rejected_at
      status
      updated_at
      approved_by {
        id
        full_name
      }
      rejected_by {
        id
        full_name
      }
      permissions {
        can_approve
        can_reject
      }
      member {
        full_name
        home_lc {
          id
          name
        }
        id
      }
    }
    paging {
      current_page
      total_items
      total_pages
    }
  }
}
  • member will be the person who requested an email and it will return the Person type and we can get home_lc from it.
  • permissions will have can_approve and can_reject for permission to approve and reject an email request.
  • approved_by and rejected_by will also be of Person type.

  • Filter based on mc are added now.
    example:
emailRequests(pagination: { per_page: 10, page: 1 }, filters: { mc_id: "79" })
X
Crafted by