-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
184 lines (167 loc) · 6.87 KB
/
schema.graphql
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
type Usermadras @aws_api_key @aws_cognito_user_pools
@model
@auth(rules: [{ allow: owner, operations: [create, update, delete] },{allow:private, operations:[read]},{allow:public, operations:[read]}]) {
id: ID!
username: String!
useravatar: String
bio: String
website: String
location: String
activityidlikes: [String]
chatrooms: [RoomLinkmadras] @connection(name: "UserLinksmadras")
messages: [Messagemadras] @connection(name: "UserMessagesmadras")
createdAt: String
updatedAt: String
comments: [Commentmadras] @connection(keyName: "byUsermadras", fields: ["id"])
}
type PushNotificationsubscribersmadras @aws_cognito_user_pools
@model
@auth(rules: [{ allow: owner, operations: [create, update, delete]},{allow:private, operations:[read, create]},{allow:public, operations:[read, create]}]) {
id: ID!
subscription: String
tempfield: String
createdAt: String
updatedAt: String
}
type UserNotificationsmadras @aws_cognito_user_pools
@model
@auth(rules: [{ allow: owner, ownerField: "userID", operations: [create, update, delete] }]) {
id: ID!
userID: ID!
messages: String
readstatus: Boolean
createdAt: String
updatedAt: String
}
type Chatroommadras @aws_cognito_user_pools
@model(
mutations: { create: "createRoommadras", update: "updateRoommadras", delete: "deleteRoommadras" }
queries: { get: "getRoommadras", list: "listRoomsmadras" }
subscriptions: null
)
@auth(rules: [{ allow: owner, ownerField: "memberids" , operations: [create, update, delete, read]}]) {
id: ID!
messages: [Messagemadras] @connection(name: "RoomMsgsmadras", sortField: "createdAt")
associated: [RoomLinkmadras] @connection(name: "AssociatedLinksmadras")
name: String!
members: [String!]!
memberids: [String!]!
ownerId: String
Moderators: [String]
createdAt: String
updatedAt: String
}
type Messagemadras @aws_cognito_user_pools
@model(subscriptions: null, queries: null)
@auth(rules: [{ allow: owner, ownerField: "authorId", operations: [create, update, delete] }]) {
id: ID!
author: Usermadras @connection(name: "UserMessagesmadras", keyField: "authorId")
authorId: String
authorName: String!
authorImage: String!
content: String!
chatroom: Chatroommadras! @connection(name: "RoomMsgsmadras")
messageRoomId: ID!
messageChatroomId: ID!
createdAt: String
updatedAt: String
}
type RoomLinkmadras @aws_cognito_user_pools
@model(
mutations: { create: "createRoomLinkmadras", update: "updateRoomLinkmadras", delete: "deleteRoomLinkmadras" }
queries: { get: "getRoomlinkmadras", list: "listRoomlinkmadras" }
subscriptions: null
)
@auth(rules: [{ allow: owner, ownerField: "members", operations: [create, update, delete] }]) {
id: ID!
user: Usermadras! @connection(name: "UserLinksmadras")
roomLinkUserId: ID
chatroom: Chatroommadras! @connection(name: "AssociatedLinksmadras")
roomLinkChatroomId: ID!
chatroomName: String
createdAt: String
updatedAt: String
}
type Blogmadras @aws_api_key @aws_cognito_user_pools @model
@auth(rules: [{ allow: owner, operations: [create, update, delete] },{allow:private, operations:[read]},{allow:public, operations:[read]}]) {
id: ID!
name: String!
posts: [Postmadras] @connection(keyName: "byBlogmadras", fields: ["id"])
}
type Postmadras @aws_api_key @aws_cognito_user_pools @model @key(name: "byBlogmadras", fields: ["blogID"], queryField: "byBlogmadras")
@auth(rules: [{ allow: owner, operations: [create, update, delete] },{allow:private, operations:[read]},{allow:public, operations:[read]}]) {
id: ID!
title: String!
content: String
blogID: ID!
blog: Blogmadras @connection(fields: ["blogID"])
comments: [Commentmadras] @connection(keyName: "byPostmadras", fields: ["id"])
}
type Groupmadras @aws_api_key @aws_cognito_user_pools @model
@auth(rules: [{ allow: owner, operations: [create, update, delete] },{allow:private, operations:[read]},{allow:public, operations:[read]}]) {
id: ID!
name: String
groupslug: String
content: String
description: String
groupImage: String
activities: [Activitymadras] @connection(keyName: "byGroupmadras", fields: ["id"])
}
type Activitymadras @aws_api_key @aws_cognito_user_pools @model
@key(name: "byGroupmadras", fields: ["groupID"], queryField: "byGroupmadras")
@key(name: "bysortIDmadras", fields: ["sorTid"], queryField: "bysortIDmadras")
@key(name: "byorderIDmadras", fields: ["sorTid", "id"], queryField: "byorderIDmadras")
@key(name: "orderbyIDmadras", fields: ["sorTid", "updatedAt","id"], queryField: "orderbyIDmadras")
@key(name: "orderbydateIDmadras", fields: ["sorTid", "id","updatedAt"], queryField: "orderbydateIDmadras")
@key(name: "orderbyupdatedIDmadras", fields: ["sorTid", "updatedAt"], queryField: "orderbyupdatedIDmadras")
@auth(rules: [{ allow: owner, operations: [create, update, delete] },{allow:private, operations:[read,update]},{allow:public, operations:[read]}]) {
id: ID!
sorTid: ID!
title: String
slug: String
content: String
contentLowercase: String
groupID: ID!
likeids: [Int]
group: Groupmadras @connection(fields: ["groupID"])
authorId: ID!
authorName: String
userdetails: Usermadras @connection(fields:["authorId"])
authorImage: String
activityImage: String
createdAt: AWSDateTime
updatedAt: AWSDateTime
}
type Commentmadras @aws_api_key @aws_cognito_user_pools @model(subscriptions: null)
@key(name: "byPostmadras", fields: ["postID", "content"], queryField: "byPostmadras")
@key(name: "byUsermadras", fields: ["authorId"], queryField: "byUsermadras")
@auth(rules: [{ allow: owner, operations: [create, update, delete] },{allow:private, operations:[read]},{allow:public, operations:[read]}]){
id: ID
postID: ID!
post: Postmadras @connection(fields: ["postID"])
content: String!
authorId: ID!
authorName: String!
userdetails: Usermadras @connection(fields:["authorId"])
authorImage: String!
createdAt: String
updatedAt: String
}
type Subscription @aws_api_key @aws_cognito_user_pools {
onCreateRoomLinkmadras(roomLinkUserId: ID!): RoomLinkmadras
@aws_subscribe(mutations: ["createRoomLinkmadras"])
onDeleteRoomLinkmadras(roomLinkUserId: ID!): RoomLinkmadras
@aws_subscribe(mutations: ["deleteRoomLinkmadras"])
onCreateUsernotificationmadras(userID: ID!): UserNotificationsmadras
@aws_subscribe(mutations: ["createUserNotificationsmadras"])
onDeleteUserNotificationmadras(userID: ID!): UserNotificationsmadras
@aws_subscribe(mutations: ["deleteUserNotificationsmadras"])
onCreateMessagemadras(messageRoomId: ID!,messageChatroomId: ID!): Messagemadras
@aws_subscribe(mutations: ["createMessagemadras"])
onDeleteMessagemadras(messageRoomId: ID!,messageChatroomId: ID!): Messagemadras
@aws_subscribe(mutations: ["deleteMessagemadras"])
onCreateCommentmadras(postID: ID): Commentmadras
@aws_subscribe(mutations: ["createCommentmadras"])
onDeleteCommentmadras(postID: ID): Commentmadras
@aws_subscribe(mutations: ["deleteCommentmadras"])
}