diff --git a/package-lock.json b/package-lock.json index f9544cc..4d485f2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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", diff --git a/schema.graphqls b/schema.graphqls index 3d26683..ab2ab99 100644 --- a/schema.graphqls +++ b/schema.graphqls @@ -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! +}