-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathschema.graphql
121 lines (108 loc) · 2.74 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
schema {
query: Query
mutation: Mutation
subscription: Subscription
}
type Subscription {
addedPost: Post @aws_subscribe(mutations: ["createPost", "updatePost"])
}
type Query {
getUsers(
page: Int
limit: Int
search: String
lowerRange: AWSDateTime
higherRange: AWSDateTime
sortBy: String
active: Boolean
): UserSearch @aws_cognito_user_pools(cognito_groups: ["superadmin"])
getUser(_id: ID!): User @aws_api_key @aws_cognito_user_pools
getUserByCognitoUserId(userId: String!): User
getPosts(page: Int, limit: Int, sortBy: String, search: String): Posts
getMyPosts(page: Int, limit: Int, sortBy: String, search: String): Posts
getPostsByUserId(userId: ID!, page: Int, limit: Int, sortBy: String, search: String): Posts
@aws_api_key
@aws_cognito_user_pools
getPost(_id: ID!): Post
getMyBookmarks(page: Int, limit: Int, sortBy: String, search: String): Bookmarks
getBookmark(_id: ID!): Bookmark
}
type Mutation {
createUser(userId: String!, name: String!, email: String!, picture: String): User
@aws_cognito_user_pools(cognito_groups: ["superadmin"])
updateUser(
userId: String!
updatedBy: String!
name: String
email: String
picture: String
): User
updateUserStatus(userId: String!, updatedBy: String!, status: Boolean!): User
@aws_cognito_user_pools(cognito_groups: ["superadmin"])
createPost(body: String!, media: [MediaInput]): Post
updatePost(_id: ID!, body: String, media: [MediaInput]): Post
deletePost(_id: ID!): Boolean
createBookmark(parentId: String, bookmark: String!): Bookmark
updateBookmark(_id: ID!, parentId: String, bookmark: String): Bookmark
deleteBookmark(_id: ID!): Boolean
}
type Bookmarks {
data: [Bookmark]
count: Int
}
type Bookmark {
_id: ID
parentId: String
bookmark: String
createdBy: ID
updatedBy: ID
createdAt: AWSDateTime
updatedAt: AWSDateTime
}
type Logo {
_id: ID
logo: String
description: String
}
type Posts @aws_api_key @aws_cognito_user_pools {
data: [Post]
count: Int
}
type Tags @aws_api_key @aws_cognito_user_pools {
tag: Page
}
type Post @aws_api_key @aws_cognito_user_pools {
_id: ID
body: String
media: [Media]
tags: [Tags]
createdBy: User
updatedBy: ID
createdAt: AWSDateTime
updatedAt: AWSDateTime
}
type Media @aws_api_key @aws_cognito_user_pools {
url: String
caption: String
}
input MediaInput {
url: String
caption: String
}
type UserSearch @aws_cognito_user_pools(cognito_groups: ["superadmin"]) {
users: [User]
count: Int
}
type User @aws_api_key @aws_cognito_user_pools {
_id: ID!
userId: String!
name: String!
email: String!
picture: String
active: Boolean!
confirmed: Boolean!
createdAt: String
createdBy: String
updatedAt: String
updatedBy: String
}