mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-19 08:50:29 +00:00
update schema types for backwards compatibility with current schema
This commit is contained in:
@@ -65,23 +65,17 @@ type Query {
|
|||||||
systems: [System!]!
|
systems: [System!]!
|
||||||
system(id: ID): System
|
system(id: ID): System
|
||||||
|
|
||||||
isNotificationScheduled(input: NotificationLookupArguments!): Boolean
|
isNotificationScheduled(input: NotificationInput!): Boolean
|
||||||
secondsThresholdForNotification(input: NotificationLookupArguments!): Int
|
secondsThresholdForNotification(input: NotificationInput!): Int
|
||||||
}
|
}
|
||||||
|
|
||||||
# Mutations
|
# Mutations
|
||||||
type Mutation {
|
type Mutation {
|
||||||
scheduleNotification(input: NotificationSchedulingArguments!): NotificationResponse!
|
scheduleNotification(input: NotificationInput!): NotificationResponse!
|
||||||
cancelNotification(input: NotificationLookupArguments!): NotificationResponse!
|
cancelNotification(input: NotificationInput!): NotificationResponse!
|
||||||
}
|
}
|
||||||
|
|
||||||
input NotificationLookupArguments {
|
input NotificationInput {
|
||||||
deviceId: ID!
|
|
||||||
shuttleId: ID!
|
|
||||||
stopId: ID!
|
|
||||||
}
|
|
||||||
|
|
||||||
input NotificationSchedulingArguments {
|
|
||||||
deviceId: ID!
|
deviceId: ID!
|
||||||
shuttleId: ID!
|
shuttleId: ID!
|
||||||
stopId: ID!
|
stopId: ID!
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
addMockSystemToRepository
|
addMockSystemToRepository
|
||||||
} from "../testHelpers/repositorySetupHelpers";
|
} from "../testHelpers/repositorySetupHelpers";
|
||||||
import assert = require("node:assert");
|
import assert = require("node:assert");
|
||||||
import { NotificationSchedulingArguments } from "../../src/generated/graphql";
|
import { NotificationInput } from "../../src/generated/graphql";
|
||||||
|
|
||||||
describe("MutationResolvers", () => {
|
describe("MutationResolvers", () => {
|
||||||
const holder = setupTestServerHolder()
|
const holder = setupTestServerHolder()
|
||||||
@@ -25,7 +25,7 @@ describe("MutationResolvers", () => {
|
|||||||
|
|
||||||
describe("scheduleNotification", () => {
|
describe("scheduleNotification", () => {
|
||||||
const query = `
|
const query = `
|
||||||
mutation ScheduleNotification($input: NotificationSchedulingArguments!) {
|
mutation ScheduleNotification($input: NotificationInput!) {
|
||||||
scheduleNotification(input: $input) {
|
scheduleNotification(input: $input) {
|
||||||
success
|
success
|
||||||
message
|
message
|
||||||
@@ -38,7 +38,7 @@ describe("MutationResolvers", () => {
|
|||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
function assertFailedResponse(response: any, notificationInput: NotificationSchedulingArguments) {
|
function assertFailedResponse(response: any, notificationInput: NotificationInput) {
|
||||||
assert(response.body.kind === "single");
|
assert(response.body.kind === "single");
|
||||||
expect(response.body.singleResult.errors).toBeUndefined();
|
expect(response.body.singleResult.errors).toBeUndefined();
|
||||||
const notificationResponse = response.body.singleResult.data?.scheduleNotification as any;
|
const notificationResponse = response.body.singleResult.data?.scheduleNotification as any;
|
||||||
@@ -126,7 +126,7 @@ describe("MutationResolvers", () => {
|
|||||||
|
|
||||||
describe("cancelNotification", () => {
|
describe("cancelNotification", () => {
|
||||||
const query = `
|
const query = `
|
||||||
mutation CancelNotification($input: NotificationLookupArguments!) {
|
mutation CancelNotification($input: NotificationInput!) {
|
||||||
cancelNotification(input: $input) {
|
cancelNotification(input: $input) {
|
||||||
success
|
success
|
||||||
message
|
message
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ describe("QueryResolvers", () => {
|
|||||||
|
|
||||||
describe("isNotificationScheduled and secondsThresholdForNotification", () => {
|
describe("isNotificationScheduled and secondsThresholdForNotification", () => {
|
||||||
const query = `
|
const query = `
|
||||||
query IsNotificationScheduled($input: NotificationLookupArguments!) {
|
query IsNotificationScheduled($input: NotificationInput!) {
|
||||||
isNotificationScheduled(input: $input)
|
isNotificationScheduled(input: $input)
|
||||||
secondsThresholdForNotification(input: $input)
|
secondsThresholdForNotification(input: $input)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user