Merge pull request #95 from Oloodi/94-backend-define-and-deploy-teamhub-schema
new teamHub entity
This commit is contained in:
35
dataconnect/connector/teamHub/mutations.gql
Normal file
35
dataconnect/connector/teamHub/mutations.gql
Normal file
@@ -0,0 +1,35 @@
|
||||
mutation CreateTeamHub(
|
||||
$teamId: UUID!,
|
||||
$hubName: String!,
|
||||
$departments: String
|
||||
) @auth(level: USER) {
|
||||
teamHub_insert(
|
||||
data: {
|
||||
teamId: $teamId
|
||||
hubName: $hubName
|
||||
departments: $departments
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
mutation UpdateTeamHub(
|
||||
$id: UUID!,
|
||||
$teamId: UUID,
|
||||
$hubName: String,
|
||||
$departments: String
|
||||
) @auth(level: USER) {
|
||||
teamHub_update(
|
||||
id: $id,
|
||||
data: {
|
||||
teamId: $teamId
|
||||
hubName: $hubName
|
||||
departments: $departments
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
mutation DeleteTeamHub(
|
||||
$id: UUID!
|
||||
) @auth(level: USER) {
|
||||
teamHub_delete(id: $id)
|
||||
}
|
||||
36
dataconnect/connector/teamHub/queries.gql
Normal file
36
dataconnect/connector/teamHub/queries.gql
Normal file
@@ -0,0 +1,36 @@
|
||||
query listTeamHub @auth(level: USER) {
|
||||
teamHubs {
|
||||
id
|
||||
teamId
|
||||
hubName
|
||||
departments
|
||||
}
|
||||
}
|
||||
|
||||
query getTeamHubById(
|
||||
$id: UUID!
|
||||
) @auth(level: USER) {
|
||||
teamHub(id: $id) {
|
||||
id
|
||||
teamId
|
||||
hubName
|
||||
departments
|
||||
}
|
||||
}
|
||||
|
||||
query filterTeamHub(
|
||||
$teamId: UUID,
|
||||
$hubName: String
|
||||
) @auth(level: USER) {
|
||||
teamHubs(
|
||||
where: {
|
||||
teamId: { eq: $teamId }
|
||||
hubName: { eq: $hubName }
|
||||
}
|
||||
) {
|
||||
id
|
||||
teamId
|
||||
hubName
|
||||
departments
|
||||
}
|
||||
}
|
||||
9
dataconnect/schema/teamHub.gql
Normal file
9
dataconnect/schema/teamHub.gql
Normal file
@@ -0,0 +1,9 @@
|
||||
type TeamHub @table(name: "team_hubs") {
|
||||
id: UUID! @default(expr: "uuidV4()")
|
||||
teamId: UUID!
|
||||
hubName: String!
|
||||
departments: String
|
||||
createdDate: Timestamp @default(expr: "request.time")
|
||||
updatedDate: Timestamp @default(expr: "request.time")
|
||||
createdBy: String @default(expr: "auth.uid")
|
||||
}
|
||||
Reference in New Issue
Block a user