Skip to content

Commit e54d27a

Browse files
committed
fix: bigint
1 parent 574d572 commit e54d27a

File tree

4 files changed

+27
-30
lines changed

4 files changed

+27
-30
lines changed

api/generated-schema.graphql

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ type ArrayDisk implements Node {
8484
device: String
8585

8686
"""(KB) Disk Size total"""
87-
size: Long
87+
size: BigInt
8888
status: ArrayDiskStatus
8989

9090
"""Is the disk a HDD or SSD."""
@@ -96,26 +96,26 @@ type ArrayDisk implements Node {
9696
"""
9797
Count of I/O read requests sent to the device I/O drivers. These statistics may be cleared at any time.
9898
"""
99-
numReads: Long
99+
numReads: BigInt
100100

101101
"""
102102
Count of I/O writes requests sent to the device I/O drivers. These statistics may be cleared at any time.
103103
"""
104-
numWrites: Long
104+
numWrites: BigInt
105105

106106
"""
107107
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.
108108
"""
109-
numErrors: Long
109+
numErrors: BigInt
110110

111111
"""(KB) Total Size of the FS (Not present on Parity type drive)"""
112-
fsSize: Long
112+
fsSize: BigInt
113113

114114
"""(KB) Free Size on the FS (Not present on Parity type drive)"""
115-
fsFree: Long
115+
fsFree: BigInt
116116

117117
"""(KB) Used Size on the FS (Not present on Parity type drive)"""
118-
fsUsed: Long
118+
fsUsed: BigInt
119119
exportable: Boolean
120120

121121
"""Type of Disk - used to differentiate Cache / Flash / Array / Parity"""
@@ -145,8 +145,10 @@ interface Node {
145145
id: PrefixedID!
146146
}
147147

148-
"""The `Long` scalar type represents 52-bit integers"""
149-
scalar Long
148+
"""
149+
The `BigInt` scalar type represents non-fractional signed whole numeric values.
150+
"""
151+
scalar BigInt
150152

151153
enum ArrayDiskStatus {
152154
DISK_NP
@@ -222,13 +224,13 @@ type Share implements Node {
222224
name: String
223225

224226
"""(KB) Free space"""
225-
free: Long
227+
free: BigInt
226228

227229
"""(KB) Used Size"""
228-
used: Long
230+
used: BigInt
229231

230232
"""(KB) Total size"""
231-
size: Long
233+
size: BigInt
232234

233235
"""Disks that are included in this share"""
234236
include: [String!]
@@ -1116,7 +1118,7 @@ enum Temperature {
11161118

11171119
type MemoryLayout implements Node {
11181120
id: PrefixedID!
1119-
size: Int!
1121+
size: BigInt!
11201122
bank: String
11211123
type: String
11221124
clockSpeed: Int
@@ -1131,16 +1133,16 @@ type MemoryLayout implements Node {
11311133

11321134
type InfoMemory implements Node {
11331135
id: PrefixedID!
1134-
max: Int!
1135-
total: Int!
1136-
free: Int!
1137-
used: Int!
1138-
active: Int!
1139-
available: Int!
1140-
buffcache: Int!
1141-
swaptotal: Int!
1142-
swapused: Int!
1143-
swapfree: Int!
1136+
max: BigInt!
1137+
total: BigInt!
1138+
free: BigInt!
1139+
used: BigInt!
1140+
active: BigInt!
1141+
available: BigInt!
1142+
buffcache: BigInt!
1143+
swaptotal: BigInt!
1144+
swapused: BigInt!
1145+
swapfree: BigInt!
11441146
layout: [MemoryLayout!]!
11451147
}
11461148

api/src/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import '@app/dotenv.js';
2-
import 'json-bigint-patch';
32

43
import { execa } from 'execa';
54
import { CommandFactory } from 'nest-commander';
@@ -21,6 +20,7 @@ const getUnraidApiLocation = async () => {
2120
};
2221

2322
try {
23+
await import('json-bigint-patch');
2424
await CommandFactory.run(CliModule, {
2525
cliName: 'unraid-api',
2626
logger: LOG_LEVEL === 'TRACE' ? new LogService() : false, // - enable this to see nest initialization issues

api/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import 'reflect-metadata';
22
import 'global-agent/bootstrap.js';
3-
import 'json-bigint-patch';
43
import '@app/dotenv.js';
54

65
import { type NestFastifyApplication } from '@nestjs/platform-fastify';
@@ -41,6 +40,7 @@ const unlinkUnixPort = () => {
4140

4241
export const viteNodeApp = async () => {
4342
try {
43+
await import('json-bigint-patch');
4444
environment.IS_MAIN_PROCESS = true;
4545

4646
logger.info('ENV %o', envVars);

api/src/unraid-api/graph/graph.module.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@ import { PluginModule } from '@app/unraid-api/plugin/plugin.module.js';
4747
path: '/graphql',
4848
},
4949
},
50-
resolvers: {
51-
JSON: JSONResolver,
52-
Long: GraphQLBigInt,
53-
URL: URLResolver,
54-
},
5550
buildSchemaOptions: {
5651
dateScalarMode: 'isoDate',
5752
directives: [UsePermissionsDirective],

0 commit comments

Comments
 (0)