feat: Integrate Data Connect and Implement Staff List View Directory
This commit is contained in:
35
backend/dataconnect/example/emergencyContact/mutations.gql
Normal file
35
backend/dataconnect/example/emergencyContact/mutations.gql
Normal file
@@ -0,0 +1,35 @@
|
||||
mutation createEmergencyContact(
|
||||
$name: String!
|
||||
$phone: String!
|
||||
$relationship: RelationshipType!
|
||||
$staffId: UUID!
|
||||
) @auth(level: USER) {
|
||||
emergencyContact_insert(
|
||||
data: {
|
||||
name: $name
|
||||
phone: $phone
|
||||
relationship: $relationship
|
||||
staffId: $staffId
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
mutation updateEmergencyContact(
|
||||
$id: UUID!
|
||||
$name: String
|
||||
$phone: String
|
||||
$relationship: RelationshipType
|
||||
) @auth(level: USER) {
|
||||
emergencyContact_update(
|
||||
id: $id
|
||||
data: {
|
||||
name: $name
|
||||
phone: $phone
|
||||
relationship: $relationship
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
mutation deleteEmergencyContact($id: UUID!) @auth(level: USER) {
|
||||
emergencyContact_delete(id: $id)
|
||||
}
|
||||
38
backend/dataconnect/example/emergencyContact/queries.gql
Normal file
38
backend/dataconnect/example/emergencyContact/queries.gql
Normal file
@@ -0,0 +1,38 @@
|
||||
query listEmergencyContacts @auth(level: USER) {
|
||||
emergencyContacts {
|
||||
id
|
||||
name
|
||||
phone
|
||||
relationship
|
||||
staffId
|
||||
createdAt
|
||||
updatedAt
|
||||
createdBy
|
||||
}
|
||||
}
|
||||
|
||||
query getEmergencyContactById($id: UUID!) @auth(level: USER) {
|
||||
emergencyContact(id: $id) {
|
||||
id
|
||||
name
|
||||
phone
|
||||
relationship
|
||||
staffId
|
||||
createdAt
|
||||
updatedAt
|
||||
createdBy
|
||||
}
|
||||
}
|
||||
|
||||
query getEmergencyContactsByStaffId($staffId: UUID!) @auth(level: USER) {
|
||||
emergencyContacts(where: { staffId: { eq: $staffId } }) {
|
||||
id
|
||||
name
|
||||
phone
|
||||
relationship
|
||||
staffId
|
||||
createdAt
|
||||
updatedAt
|
||||
createdBy
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user