Skip to content

Commit fe07409

Browse files
committed
feat(api): codegen for discussions
Signed-off-by: Adam Setch <[email protected]>
1 parent 07c7f4b commit fe07409

File tree

6 files changed

+264
-90
lines changed

6 files changed

+264
-90
lines changed

codegen.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ dotenv.config();
55

66
const config: CodegenConfig = {
77
overwrite: true,
8-
// Point the schema field to the GitHub GraphQL API endpoint
98
schema: {
109
'https://api.github.com/graphql': {
1110
// Add a custom header for authorization using your PAT
@@ -15,8 +14,6 @@ const config: CodegenConfig = {
1514
},
1615
},
1716
},
18-
// Define where your application's GraphQL queries/mutations are located
19-
// documents: 'src/**/*.graphql',
2017
documents: [
2118
'src/renderer/utils/api/**/*.ts',
2219
'!src/renderer/utils/api/graphql/generated/**',
@@ -25,19 +22,10 @@ const config: CodegenConfig = {
2522
// Configure generated outputs and plugins
2623
generates: {
2724
'src/renderer/utils/api/graphql/generated/': {
28-
preset: 'client', // Or use specific plugins like 'typescript', 'typescript-operations'
25+
preset: 'client',
2926
plugins: [],
3027
config: {
3128
documentMode: 'string',
32-
33-
// Additional plugin configuration, e.g. for scalars
34-
// scalars: {
35-
// DateTime: 'string',
36-
// URI: 'string',
37-
// GitTimestamp: 'string',
38-
// Html: 'string',
39-
// X509Certificate: 'string',
40-
// },
4129
},
4230
},
4331
'src/renderer/utils/api/graphql/generated/schema.graphql': {

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,15 @@
7676
"react-router-dom": "7.10.1"
7777
},
7878
"devDependencies": {
79+
"@0no-co/graphqlsp": "1.15.2",
7980
"@babel/core": "7.28.5",
8081
"@babel/preset-env": "7.28.5",
8182
"@biomejs/biome": "2.3.8",
8283
"@discordapp/twemoji": "16.0.1",
8384
"@electron/notarize": "3.1.1",
8485
"@graphql-codegen/cli": "6.1.0",
85-
"@graphql-codegen/typescript": "5.0.6",
86-
"@graphql-codegen/typescript-operations": "5.0.6",
86+
"@graphql-codegen/schema-ast": "5.0.0",
87+
"@parcel/watcher": "2.5.1",
8788
"@primer/css": "22.0.2",
8889
"@primer/octicons-react": "19.21.1",
8990
"@primer/primitives": "11.3.1",
@@ -111,7 +112,6 @@
111112
"electron-builder": "26.0.12",
112113
"final-form": "5.0.0",
113114
"graphql": "16.12.0",
114-
"graphql-tag": "2.12.6",
115115
"html-webpack-plugin": "5.6.5",
116116
"husky": "9.1.7",
117117
"identity-obj-proxy": "3.0.0",
@@ -148,4 +148,4 @@
148148
"*": "biome check --fix --no-errors-on-unmatched",
149149
"*.{js,ts,tsx}": "pnpm test --findRelatedTests --passWithNoTests --updateSnapshot"
150150
}
151-
}
151+
}

0 commit comments

Comments
 (0)