-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcodegen.ts
66 lines (62 loc) · 2.72 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import { CodegenConfig } from "@graphql-codegen/cli";
const codegen: CodegenConfig = {
schema: "./src/graphql/schema/schema.graphql",
generates: {
"./src/graphql/__generated__/types.ts": {
config: {
contextType: "@context/type#Context",
namingConvention: {
enumValues: "upper-case#upperCase",
},
mappers: {
Login: "@users/models/login.model#LoginModel",
User: "@users/models/user.model#UserModel",
UserRole: "@users/models/user.model#UserRoleModel",
Post: "@posts/models/post.model#PostModel",
CreatePostInput: "@posts/models/post.model#CreatePostInputModel",
UpdatePostInput: "@posts/models/post.model#UpdatePostInputModel",
LoginInput: "@users/models/user.model#LoginInputModel",
StringFilterInput:
"@core/filters/filters.model#StringFilterInputModel",
DateTimeFilterInput:
"@core/filters/filters.model#DateTimeFilterInputModel",
ReplyPostInput: "@posts/models/post.model#ReplyPostInputModel",
Notification:
"@notifications/models/notifications.model#BaseNotificationModel",
ReplyPostNotification:
"@notifications/models/notifications.model#ReplyPostNotificationModel",
NotificationsInput:
"@notifications/models/notifications.model#NotificationsInputModel",
Conversation:
"@conversations/models/conversations.model#ConversationModel",
ConversationDirect:
"@conversations/models/conversations.model#ConversationDirectModel",
ConversationGroup:
"@conversations/models/conversations.model#ConversationGroupModel",
CreateConversationDirectInput:
"@conversations/models/conversations.model#CreateConversationDirectInputModel",
CreateConversationGroupInputModel:
"@conversations/models/conversations.model#CreateConversationGroupInputModel",
SendMessageInput:
"@conversations/models/conversations.model#SendMessageInputModel",
Message: "@conversations/models/conversations.model#MessageModel",
MessagesInput:
"@conversations/models/conversations.model#MessagesInputModel",
//OrderBy: '@posts/models/post.model#OrderByModel'
},
enumValues: {
UserRole: "@users/models/user.model#UserRoleModel",
//OrderBy: '@posts/models/post.model#OrderByModel',
},
maybeValue: "T | undefined",
customResolveTypes: {
Query: {
feed: "@posts/models/post.model#FeedModel",
},
},
},
plugins: ["typescript", "typescript-resolvers"],
},
},
};
export default codegen;