Merge pull request #45 from brendan-ch/hotfix/update-schema-version-system

hotfix/update-schema-version-system
This commit is contained in:
2025-04-24 12:09:26 -07:00
committed by GitHub
2 changed files with 9 additions and 4 deletions

View File

@@ -92,7 +92,8 @@ type Query {
isNotificationScheduled(input: NotificationInput!): Boolean
secondsThresholdForNotification(input: NotificationInput!): Int
schemaVersion: ID!
schemaMinVersion: Int!
schemaCurrentVersion: Int!
}
# Mutations

View File

@@ -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<ServerContext> = {
Query: {
@@ -48,8 +49,11 @@ export const QueryResolvers: Resolvers<ServerContext> = {
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;
},
},
}