feat: Integrate Data Connect and Implement Staff List View Directory
This commit is contained in:
36
backend/dataconnect/example/role/mutations.gql
Normal file
36
backend/dataconnect/example/role/mutations.gql
Normal file
@@ -0,0 +1,36 @@
|
||||
mutation createRole(
|
||||
$name: String!
|
||||
$costPerHour: Float!
|
||||
$vendorId: UUID!
|
||||
$roleCategoryId: UUID!
|
||||
) @auth(level: USER) {
|
||||
role_insert(
|
||||
data: {
|
||||
name: $name
|
||||
costPerHour: $costPerHour
|
||||
vendorId: $vendorId
|
||||
roleCategoryId: $roleCategoryId
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
mutation updateRole(
|
||||
$id: UUID!
|
||||
$name: String
|
||||
$costPerHour: Float
|
||||
$roleCategoryId: UUID!
|
||||
) @auth(level: USER) {
|
||||
role_update(
|
||||
id: $id
|
||||
data: {
|
||||
name: $name
|
||||
costPerHour: $costPerHour
|
||||
roleCategoryId: $roleCategoryId
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
mutation deleteRole($id: UUID!) @auth(level: USER) {
|
||||
role_delete(id: $id)
|
||||
}
|
||||
43
backend/dataconnect/example/role/queries.gql
Normal file
43
backend/dataconnect/example/role/queries.gql
Normal file
@@ -0,0 +1,43 @@
|
||||
query listRoles @auth(level: USER) {
|
||||
roles {
|
||||
id
|
||||
name
|
||||
costPerHour
|
||||
vendorId
|
||||
roleCategoryId
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
|
||||
query getRoleById($id: UUID!) @auth(level: USER) {
|
||||
role(id: $id) {
|
||||
id
|
||||
name
|
||||
costPerHour
|
||||
vendorId
|
||||
roleCategoryId
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
|
||||
query listRolesByVendorId($vendorId: UUID!) @auth(level: USER) {
|
||||
roles(where: { vendorId: { eq: $vendorId } }) {
|
||||
id
|
||||
name
|
||||
costPerHour
|
||||
vendorId
|
||||
roleCategoryId
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
|
||||
query listRolesByroleCategoryId($roleCategoryId: UUID!) @auth(level: USER) {
|
||||
roles(where: { roleCategoryId: { eq: $roleCategoryId } }) {
|
||||
id
|
||||
name
|
||||
costPerHour
|
||||
vendorId
|
||||
roleCategoryId
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user