feat: Integrate Data Connect and Implement Staff List View Directory
This commit is contained in:
34
backend/dataconnect/example/category/mutations.gql
Normal file
34
backend/dataconnect/example/category/mutations.gql
Normal file
@@ -0,0 +1,34 @@
|
||||
mutation createCategory(
|
||||
$categoryId: String!
|
||||
$label: String!
|
||||
$icon: String
|
||||
) @auth(level: USER) {
|
||||
category_insert(
|
||||
data: {
|
||||
categoryId: $categoryId
|
||||
label: $label
|
||||
icon: $icon
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
mutation updateCategory(
|
||||
$id: UUID!
|
||||
$categoryId: String
|
||||
$label: String
|
||||
$icon: String
|
||||
) @auth(level: USER) {
|
||||
category_update(
|
||||
id: $id
|
||||
data: {
|
||||
categoryId: $categoryId
|
||||
label: $label
|
||||
icon: $icon
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
mutation deleteCategory($id: UUID!) @auth(level: USER) {
|
||||
category_delete(id: $id)
|
||||
}
|
||||
43
backend/dataconnect/example/category/queries.gql
Normal file
43
backend/dataconnect/example/category/queries.gql
Normal file
@@ -0,0 +1,43 @@
|
||||
query listCategories @auth(level: USER) {
|
||||
categories {
|
||||
id
|
||||
categoryId
|
||||
label
|
||||
icon
|
||||
createdAt
|
||||
updatedAt
|
||||
createdBy
|
||||
}
|
||||
}
|
||||
|
||||
query getCategoryById($id: UUID!) @auth(level: USER) {
|
||||
category(id: $id) {
|
||||
id
|
||||
categoryId
|
||||
label
|
||||
icon
|
||||
createdAt
|
||||
updatedAt
|
||||
createdBy
|
||||
}
|
||||
}
|
||||
|
||||
query filterCategories(
|
||||
$categoryId: String
|
||||
$label: String
|
||||
) @auth(level: USER) {
|
||||
categories(
|
||||
where: {
|
||||
categoryId: { eq: $categoryId }
|
||||
label: { eq: $label }
|
||||
}
|
||||
) {
|
||||
id
|
||||
categoryId
|
||||
label
|
||||
icon
|
||||
createdAt
|
||||
updatedAt
|
||||
createdBy
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user