Created
April 26, 2024 07:59
-
-
Save ashish-mj/fd2ef51b8d6efff7def4832905c35d50 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from graphene import ObjectType, String,Int,Float | |
class EmployeeObject(ObjectType): | |
id = String() | |
firstName = String() | |
lastName = String() | |
age = Int() | |
email = String() | |
phone = Float() | |
sex = String() | |
department = String() | |
salary = Float() | |
role = String() | |
def __init__(self, id: str, firstName: str, lastName: str, age: int, email: str, phone: float, sex: str, | |
department: str, salary: float, role: str): | |
self.id=id | |
self.firstName=firstName | |
self.lastName=lastName | |
self.age=age | |
self.email=email | |
self.phone=phone | |
self.sex=sex | |
self.department=department | |
self.salary=salary | |
self.role=role | |
def getEmployee(self): | |
emp = {"id": self.id, "firstName": self.firstName, "lastName": self.lastName, "age": self.age, "email": self.email, "phone": self.phone, | |
"sex": self.sex, "department": self.department, "salary": self.salary, "role": self.role} | |
return emp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment