diff --git a/api/generated-schema.graphql b/api/generated-schema.graphql index c3481f12e..cb565af0e 100644 --- a/api/generated-schema.graphql +++ b/api/generated-schema.graphql @@ -84,7 +84,7 @@ type ArrayDisk implements Node { device: String """(KB) Disk Size total""" - size: Long + size: BigInt status: ArrayDiskStatus """Is the disk a HDD or SSD.""" @@ -96,26 +96,26 @@ type ArrayDisk implements Node { """ Count of I/O read requests sent to the device I/O drivers. These statistics may be cleared at any time. """ - numReads: Long + numReads: BigInt """ Count of I/O writes requests sent to the device I/O drivers. These statistics may be cleared at any time. """ - numWrites: Long + numWrites: BigInt """ Number of unrecoverable errors reported by the device I/O drivers. Missing data due to unrecoverable array read errors is filled in on-the-fly using parity reconstruct (and we attempt to write this data back to the sector(s) which failed). Any unrecoverable write error results in disabling the disk. """ - numErrors: Long + numErrors: BigInt """(KB) Total Size of the FS (Not present on Parity type drive)""" - fsSize: Long + fsSize: BigInt """(KB) Free Size on the FS (Not present on Parity type drive)""" - fsFree: Long + fsFree: BigInt """(KB) Used Size on the FS (Not present on Parity type drive)""" - fsUsed: Long + fsUsed: BigInt exportable: Boolean """Type of Disk - used to differentiate Cache / Flash / Array / Parity""" @@ -145,8 +145,10 @@ interface Node { id: PrefixedID! } -"""The `Long` scalar type represents 52-bit integers""" -scalar Long +""" +The `BigInt` scalar type represents non-fractional signed whole numeric values. +""" +scalar BigInt enum ArrayDiskStatus { DISK_NP @@ -222,13 +224,13 @@ type Share implements Node { name: String """(KB) Free space""" - free: Long + free: BigInt """(KB) Used Size""" - used: Long + used: BigInt """(KB) Total size""" - size: Long + size: BigInt """Disks that are included in this share""" include: [String!] @@ -1116,7 +1118,7 @@ enum Temperature { type MemoryLayout implements Node { id: PrefixedID! - size: Int! + size: BigInt! bank: String type: String clockSpeed: Int @@ -1131,16 +1133,16 @@ type MemoryLayout implements Node { type InfoMemory implements Node { id: PrefixedID! - max: Int! - total: Int! - free: Int! - used: Int! - active: Int! - available: Int! - buffcache: Int! - swaptotal: Int! - swapused: Int! - swapfree: Int! + max: BigInt! + total: BigInt! + free: BigInt! + used: BigInt! + active: BigInt! + available: BigInt! + buffcache: BigInt! + swaptotal: BigInt! + swapused: BigInt! + swapfree: BigInt! layout: [MemoryLayout!]! } diff --git a/api/src/cli.ts b/api/src/cli.ts index e84372137..f0d3d5f14 100644 --- a/api/src/cli.ts +++ b/api/src/cli.ts @@ -1,5 +1,4 @@ import '@app/dotenv.js'; -import 'json-bigint-patch'; import { execa } from 'execa'; import { CommandFactory } from 'nest-commander'; @@ -21,6 +20,7 @@ const getUnraidApiLocation = async () => { }; try { + await import('json-bigint-patch'); await CommandFactory.run(CliModule, { cliName: 'unraid-api', logger: LOG_LEVEL === 'TRACE' ? new LogService() : false, // - enable this to see nest initialization issues diff --git a/api/src/index.ts b/api/src/index.ts index 4c272944d..86b82e09d 100644 --- a/api/src/index.ts +++ b/api/src/index.ts @@ -1,6 +1,5 @@ import 'reflect-metadata'; import 'global-agent/bootstrap.js'; -import 'json-bigint-patch'; import '@app/dotenv.js'; import { type NestFastifyApplication } from '@nestjs/platform-fastify'; @@ -41,6 +40,7 @@ const unlinkUnixPort = () => { export const viteNodeApp = async () => { try { + await import('json-bigint-patch'); environment.IS_MAIN_PROCESS = true; logger.info('ENV %o', envVars); diff --git a/api/src/unraid-api/graph/graph.module.ts b/api/src/unraid-api/graph/graph.module.ts index 06a666029..49b5f8bb7 100644 --- a/api/src/unraid-api/graph/graph.module.ts +++ b/api/src/unraid-api/graph/graph.module.ts @@ -47,11 +47,6 @@ import { PluginModule } from '@app/unraid-api/plugin/plugin.module.js'; path: '/graphql', }, }, - resolvers: { - JSON: JSONResolver, - Long: GraphQLBigInt, - URL: URLResolver, - }, buildSchemaOptions: { dateScalarMode: 'isoDate', directives: [UsePermissionsDirective],