diff --git a/dataconnect/connector/teamHub/mutations.gql b/dataconnect/connector/teamHub/mutations.gql new file mode 100644 index 00000000..eeee0ce5 --- /dev/null +++ b/dataconnect/connector/teamHub/mutations.gql @@ -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) +} diff --git a/dataconnect/connector/teamHub/queries.gql b/dataconnect/connector/teamHub/queries.gql new file mode 100644 index 00000000..93564956 --- /dev/null +++ b/dataconnect/connector/teamHub/queries.gql @@ -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 + } +} diff --git a/dataconnect/schema/teamHub.gql b/dataconnect/schema/teamHub.gql new file mode 100644 index 00000000..f299c999 --- /dev/null +++ b/dataconnect/schema/teamHub.gql @@ -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") +}