mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-21 20:16:26 +08:00
31 lines
641 B
TypeScript
31 lines
641 B
TypeScript
import { Module } from '@nestjs/common';
|
|
import { Field, ObjectType, Query } from '@nestjs/graphql';
|
|
|
|
import { SERVER_FLAVOR } from '../config';
|
|
|
|
@ObjectType()
|
|
export class ServerConfigType {
|
|
@Field({ description: 'server version' })
|
|
version!: string;
|
|
|
|
@Field({ description: 'server flavor' })
|
|
flavor!: string;
|
|
}
|
|
|
|
export class ServerConfigResolver {
|
|
@Query(() => ServerConfigType, {
|
|
description: 'server config',
|
|
})
|
|
serverConfig(): ServerConfigType {
|
|
return {
|
|
version: AFFiNE.version,
|
|
flavor: SERVER_FLAVOR,
|
|
};
|
|
}
|
|
}
|
|
|
|
@Module({
|
|
providers: [ServerConfigResolver],
|
|
})
|
|
export class ServerConfigModule {}
|