Implement graphql query node for assignment
Closed this issue · 1 comments
sudan45 commented
Problem Statement
The 'Assignment' features uses a Rest API.
Acceptance Criteria
The 'Assignment' feature works with a graphql query.
Additional Information
serializers
server/apps/notification/serializers.py
Lines 72 to 93 in bbfdef2
views
server/apps/notification/views.py
Lines 80 to 103 in bbfdef2
testcases
server/apps/notification/tests/test_apis.py
Lines 235 to 266 in bbfdef2
Rest Framework urls
method: GET
url: /api/v1/assignments/
request params : ?is_done=3&offset=0&limit=5
response: [
{
"id": ID,
"createdAt": Datetime,
"projectDetails": ProjectDetails
"createdByDetails": UserDetails
"contentObjectDetails": ContentDetails(ie lead, entry details)
"contentType": ID,
"isDone": Boolean,
"contentObjectType": str
}
]
Expected graphql
enum AssignmentContentTypeEnum {
LEAD
ENTRY_REVIEW_COMMENT
}
type AssignmentContentDataType {
contentType: AssignmentContentTypeEnum
lead: AssignmentLeadDetailType
entryReviewComment: AssignmentEntryReviewCommentDetailType
}
input AssignmentInputType {
isDone: Boolean
}
type AssignmentLeadDetailType {
id: ID!
title: String!
}
type AssignmentProjectDetailType {
id: ID!
title: String!
}
type AssignmentType {
id: ID!
createdAt: DateTime!
createdBy: UserType
createdFor: UserType!
project: AssignmentProjectDetailType
isDone: Boolean!
objectId: Int!
contentData: AssignmentContentDataType
}
type AssignmentListType {
results: [AssignmentType!]
totalCount: Int
page: Int
pageSize: Int
}
type AssignmentUpdate {
errors: [GenericScalar!]
ok: Boolean
result: AssignmentType
}
sudan45 commented
@puranban @AdityaKhatri @subinasr
Note: The client needs to review the lead and entry content types. If contenttype is lead, map data with LeadType; if not, map with EntryType.