Skip to content

Commit 7a4799e

Browse files
Michael Datelleelibosley
andauthored
fix: authorization type error (#987)
Co-authored-by: Eli Bosley <[email protected]>
1 parent a99ee03 commit 7a4799e

File tree

9 files changed

+27895
-27580
lines changed

9 files changed

+27895
-27580
lines changed

api/codegen.ts

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
import type { CodegenConfig } from '@graphql-codegen/cli';
2+
3+
const config: CodegenConfig = {
4+
overwrite: true,
5+
emitLegacyCommonJSImports: false,
6+
verbose: true,
7+
config: {
8+
namingConvention: {
9+
typeNames: './fix-array-type.cjs',
10+
enumValues: 'change-case#upperCase',
11+
useTypeImports: true,
12+
},
13+
scalars: {
14+
DateTime: 'string',
15+
Long: 'number',
16+
JSON: '{ [key: string]: any }',
17+
URL: 'URL',
18+
Port: 'number',
19+
UUID: 'string',
20+
},
21+
},
22+
generates: {
23+
'src/graphql/generated/client/': {
24+
documents: './src/graphql/mothership/*.ts',
25+
schema: {
26+
[process.env.MOTHERSHIP_GRAPHQL_LINK as string]: {
27+
headers: {
28+
origin: 'https://forums.unraid.net',
29+
},
30+
},
31+
},
32+
preset: 'client',
33+
presetConfig: {
34+
gqlTagName: 'graphql',
35+
},
36+
config: {
37+
useTypeImports: true,
38+
withObjectType: true,
39+
},
40+
plugins: [
41+
{ add: { content: '/* eslint-disable */' } },
42+
],
43+
},
44+
// Generate Types for the API Server
45+
'src/graphql/generated/api/types.ts': {
46+
schema: [
47+
'./src/graphql/types.ts',
48+
'./src/graphql/schema/types/**/*.graphql',
49+
],
50+
plugins: [
51+
'typescript',
52+
'typescript-resolvers',
53+
{ add: { content: '/* eslint-disable */' } },
54+
],
55+
config: {
56+
contextType: '@app/graphql/schema/utils#Context',
57+
useIndexSignature: true,
58+
},
59+
},
60+
// Generate Operations for any built-in API Server Operations (e.g., report.ts)
61+
'src/graphql/generated/api/operations.ts': {
62+
documents: './src/graphql/client/api/*.ts',
63+
schema: [
64+
'./src/graphql/types.ts',
65+
'./src/graphql/schema/types/**/*.graphql',
66+
],
67+
preset: 'import-types',
68+
presetConfig: {
69+
typesPath: '@app/graphql/generated/api/types',
70+
},
71+
plugins: [
72+
'typescript-validation-schema',
73+
'typescript-operations',
74+
'typed-document-node',
75+
{ add: { content: '/* eslint-disable */' } },
76+
],
77+
config: {
78+
importFrom: '@app/graphql/generated/api/types',
79+
strictScalars: false,
80+
schema: 'zod',
81+
withObjectType: true,
82+
},
83+
},
84+
'src/graphql/generated/client/validators.ts': {
85+
schema: {
86+
[process.env.MOTHERSHIP_GRAPHQL_LINK as string]: {
87+
headers: {
88+
origin: 'https://forums.unraid.net',
89+
},
90+
},
91+
},
92+
plugins: [
93+
'typescript-validation-schema',
94+
{ add: { content: '/* eslint-disable */' } },
95+
],
96+
config: {
97+
importFrom: '@app/graphql/generated/client/graphql',
98+
strictScalars: false,
99+
schema: 'zod',
100+
},
101+
},
102+
},
103+
};
104+
105+
export default config;

api/codegen.yml

Lines changed: 0 additions & 77 deletions
This file was deleted.

api/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ x-volumes: &volumes
1717
- ./.env.staging:/app/.env.staging
1818
- ./.env.test:/app/.env.test
1919
- ./.env.development:/app/.env.development
20-
- ./codegen.yml:/app/codegen.yml
20+
- ./codegen.ts:/app/codegen.ts
2121
- ./fix-array-type.cjs:/app/fix-array-type.cjs
2222
- /var/run/docker.sock:/var/run/docker.sock
2323
- ./unraid-api.js:/app/unraid-api.js

0 commit comments

Comments
 (0)