add notification support in schema

This commit is contained in:
2025-02-04 10:27:06 -08:00
parent 82a70ea04e
commit d730937b29
2 changed files with 36 additions and 7 deletions

6
package-lock.json generated
View File

@@ -9,7 +9,6 @@
"version": "1.0.0",
"dependencies": {
"@apollo/server": "^4.11.2",
"@types/jsonwebtoken": "^9.0.8",
"graphql": "^16.10.0",
"jsonwebtoken": "^9.0.2"
},
@@ -18,6 +17,7 @@
"@graphql-codegen/typescript": "4.1.2",
"@graphql-codegen/typescript-resolvers": "4.4.1",
"@jest/globals": "^29.7.0",
"@types/jsonwebtoken": "^9.0.8",
"@types/node": "^22.10.2",
"jest": "^29.7.0",
"ts-jest": "^29.2.5",
@@ -3571,6 +3571,7 @@
"version": "9.0.8",
"resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.8.tgz",
"integrity": "sha512-7fx54m60nLFUVYlxAB1xpe9CBWX2vSrk50Y6ogRJ1v5xxtba7qXTg5BgYDN5dq+yuQQ9HaVlHJyAAt1/mxryFg==",
"dev": true,
"dependencies": {
"@types/ms": "*",
"@types/node": "*"
@@ -3589,7 +3590,8 @@
"node_modules/@types/ms": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz",
"integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA=="
"integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==",
"dev": true
},
"node_modules/@types/node": {
"version": "22.10.2",

View File

@@ -1,8 +1,4 @@
type Query {
systems: [System!]!
system(id: ID): System
}
# Base types
type System {
id: ID!
name: String!
@@ -62,3 +58,34 @@ type Shuttle {
etas: [ETA!]
eta(forStopId: ID): ETA
}
# Queries
type Query {
systems: [System!]!
system(id: ID): System
}
# Mutations
type Mutation {
scheduleNotification(input: NotificationInput): NotificationResponse
cancelNotification(input: NotificationInput): NotificationResponse
cancelAllNotifications(deviceId: ID!): NotificationResponse
}
input NotificationInput {
deviceId: ID!
shuttleId: ID!
stopId: ID!
}
type NotificationResponse {
success: Boolean!
message: String!
data: Notification
}
type Notification {
deviceId: ID!
shuttleId: ID!
stopId: ID!
}