feat: expose version with healthcheck query
This commit is contained in:
7
packages/backend/src/graphql/queries/healthcheck.ts
Normal file
7
packages/backend/src/graphql/queries/healthcheck.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
const healthcheck = () => {
|
||||
return {
|
||||
version: process.env.npm_package_version,
|
||||
}
|
||||
};
|
||||
|
||||
export default healthcheck;
|
@@ -9,6 +9,7 @@ import getExecutions from './queries/get-executions';
|
||||
import getExecutionSteps from './queries/get-execution-steps';
|
||||
import getData from './queries/get-data';
|
||||
import getCurrentUser from './queries/get-current-user';
|
||||
import healthcheck from './queries/healthcheck';
|
||||
|
||||
const queryResolvers = {
|
||||
getApps,
|
||||
@@ -22,6 +23,7 @@ const queryResolvers = {
|
||||
getExecutionSteps,
|
||||
getData,
|
||||
getCurrentUser,
|
||||
healthcheck,
|
||||
};
|
||||
|
||||
export default queryResolvers;
|
||||
|
@@ -14,6 +14,7 @@ type Query {
|
||||
): ExecutionStepConnection
|
||||
getData(stepId: String!, key: String!, parameters: JSONObject): JSONObject
|
||||
getCurrentUser: User
|
||||
healthcheck: AppHealth
|
||||
}
|
||||
|
||||
type Mutation {
|
||||
@@ -424,6 +425,10 @@ type ExecutionStepConnection {
|
||||
pageInfo: PageInfo
|
||||
}
|
||||
|
||||
type AppHealth {
|
||||
version: String
|
||||
}
|
||||
|
||||
schema {
|
||||
query: Query
|
||||
mutation: Mutation
|
||||
|
@@ -24,6 +24,7 @@ const authentication = shield(
|
||||
{
|
||||
Query: {
|
||||
'*': isAuthenticated,
|
||||
healthcheck: allow,
|
||||
},
|
||||
Mutation: {
|
||||
'*': isAuthenticated,
|
||||
|
Reference in New Issue
Block a user