From 9969e93fc96c8990de5159b13465bc0da94e0c41 Mon Sep 17 00:00:00 2001 From: Brendan Chen Date: Thu, 24 Apr 2025 09:56:36 -0700 Subject: [PATCH] use min/max version instead of one static version --- schema.graphqls | 3 ++- src/resolvers/QueryResolvers.ts | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/schema.graphqls b/schema.graphqls index 60a3d63..614bfa0 100644 --- a/schema.graphqls +++ b/schema.graphqls @@ -92,7 +92,8 @@ type Query { isNotificationScheduled(input: NotificationInput!): Boolean secondsThresholdForNotification(input: NotificationInput!): Int - schemaVersion: ID! + schemaMinVersion: Int! + schemaCurrentVersion: Int! } # Mutations diff --git a/src/resolvers/QueryResolvers.ts b/src/resolvers/QueryResolvers.ts index 5bbaed1..e1359ce 100644 --- a/src/resolvers/QueryResolvers.ts +++ b/src/resolvers/QueryResolvers.ts @@ -1,7 +1,8 @@ import { ServerContext } from "../ServerContext"; import { Resolvers } from "../generated/graphql"; -const GRAPHQL_SCHEMA_VERSION = "1"; +const GRAPHQL_SCHEMA_MIN_VERSION = 1; +const GRAPHQL_SCHEMA_CURRENT_VERSION = 1; export const QueryResolvers: Resolvers = { Query: { @@ -48,8 +49,11 @@ export const QueryResolvers: Resolvers = { return null; }, - schemaVersion: async (_parent, _args, _contextValue, _info) => { - return GRAPHQL_SCHEMA_VERSION; + schemaMinVersion: async (_parent, _args, _contextValue, _info) => { + return GRAPHQL_SCHEMA_MIN_VERSION; + }, + schemaCurrentVersion: async (_parent, _args, _contextValue, _info) => { + return GRAPHQL_SCHEMA_CURRENT_VERSION; }, }, }