feat: Integrate Data Connect and Implement Staff List View Directory
This commit is contained in:
53
backend/dataconnect/example/course/mutations.gql
Normal file
53
backend/dataconnect/example/course/mutations.gql
Normal file
@@ -0,0 +1,53 @@
|
||||
mutation createCourse(
|
||||
$title: String
|
||||
$description: String
|
||||
$thumbnailUrl: String
|
||||
$durationMinutes: Int
|
||||
$xpReward: Int
|
||||
$categoryId: UUID!
|
||||
$levelRequired: String
|
||||
$isCertification: Boolean
|
||||
) @auth(level: USER) {
|
||||
course_insert(
|
||||
data: {
|
||||
title: $title
|
||||
description: $description
|
||||
thumbnailUrl: $thumbnailUrl
|
||||
durationMinutes: $durationMinutes
|
||||
xpReward: $xpReward
|
||||
categoryId: $categoryId
|
||||
levelRequired: $levelRequired
|
||||
isCertification: $isCertification
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
mutation updateCourse(
|
||||
$id: UUID!
|
||||
$title: String
|
||||
$description: String
|
||||
$thumbnailUrl: String
|
||||
$durationMinutes: Int
|
||||
$xpReward: Int
|
||||
$categoryId: UUID!
|
||||
$levelRequired: String
|
||||
$isCertification: Boolean
|
||||
) @auth(level: USER) {
|
||||
course_update(
|
||||
id: $id
|
||||
data: {
|
||||
title: $title
|
||||
description: $description
|
||||
thumbnailUrl: $thumbnailUrl
|
||||
durationMinutes: $durationMinutes
|
||||
xpReward: $xpReward
|
||||
categoryId: $categoryId
|
||||
levelRequired: $levelRequired
|
||||
isCertification: $isCertification
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
mutation deleteCourse($id: UUID!) @auth(level: USER) {
|
||||
course_delete(id: $id)
|
||||
}
|
||||
68
backend/dataconnect/example/course/queries.gql
Normal file
68
backend/dataconnect/example/course/queries.gql
Normal file
@@ -0,0 +1,68 @@
|
||||
query listCourses @auth(level: USER) {
|
||||
courses {
|
||||
id
|
||||
title
|
||||
description
|
||||
thumbnailUrl
|
||||
durationMinutes
|
||||
xpReward
|
||||
categoryId
|
||||
levelRequired
|
||||
isCertification
|
||||
createdAt
|
||||
|
||||
category{
|
||||
id
|
||||
label
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
query getCourseById($id: UUID!) @auth(level: USER) {
|
||||
course(id: $id) {
|
||||
id
|
||||
title
|
||||
description
|
||||
thumbnailUrl
|
||||
durationMinutes
|
||||
xpReward
|
||||
categoryId
|
||||
levelRequired
|
||||
isCertification
|
||||
createdAt
|
||||
|
||||
category{
|
||||
id
|
||||
label
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
query filterCourses(
|
||||
$categoryId: UUID
|
||||
$isCertification: Boolean
|
||||
$levelRequired: String
|
||||
$completed: Boolean
|
||||
) @auth(level: USER) {
|
||||
courses(
|
||||
where: {
|
||||
categoryId: { eq: $categoryId }
|
||||
isCertification: { eq: $isCertification }
|
||||
levelRequired: { eq: $levelRequired }
|
||||
}
|
||||
) {
|
||||
id
|
||||
title
|
||||
categoryId
|
||||
levelRequired
|
||||
isCertification
|
||||
|
||||
category{
|
||||
id
|
||||
label
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user