-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathcodegen.ts
43 lines (42 loc) · 1.47 KB
/
codegen.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import type { CodegenConfig } from "@graphql-codegen/cli";
const config: CodegenConfig = {
schema: "./src/modules/**/typedefs/*.graphql",
emitLegacyCommonJSImports: false,
generates: {
"./src/modules/": {
preset: "@0xflick/graphql-modules-preset" as "graphql-modules",
config: {
useTypeImports: true,
useEsmImports: true,
graphqlModulesImportPath: "@0xflick/graphql-modules",
contextType: "../context/index.js#Context",
mappers: {
InscriptionTransaction:
"../modules/inscriptionTransaction/models.js#InscriptionTransactionModel",
InscriptionFunding:
"../modules/inscriptionFunding/models.js#InscriptionFundingModel",
InscriptionTransactionContent:
"../modules/inscriptionRequest/models.js#InscriptionTransactionContentModel",
Role: "../modules/permissions/models.js#RoleModel",
Web3User: "../modules/user/models.js#Web3UserModel",
Web3LoginUser: "../modules/user/models.js#Web3LoginUserModel",
Collection: "../modules/collections/models.js#CollectionModel",
},
},
presetConfig: {
baseTypesPath: "../generated-types/graphql.ts",
filename: "generated-types/module-types.ts",
},
plugins: [
{
add: {
content: "/* eslint-disable */",
},
},
"typescript",
"typescript-resolvers",
],
},
},
};
export default config;