-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.js
192 lines (176 loc) · 4.33 KB
/
schema.js
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
185
186
187
188
189
190
191
192
const { gql } = require('apollo-server')
const typeDefs = gql`
type Follow {
type: String!
url: String!
}
type TimelineResult {
channel: String!
items: [Post]!
after: String
before: String
source: Source
}
type PostContent {
text: String
html: String
}
type SearchResult {
type: String!
url: String!
name: String!
photo: String
description: String
author: PostAuthor
}
type Source {
_id: ID!
name: String!
}
type PostAuthor {
type: String
name: String
url: String
photo: String
}
type PostLocation {
type: String
name: String
latitude: Float
longitude: Float
url: String
}
type Post {
_id: ID
_is_read: Boolean
_source: String
uid: String
url: String
postType: String
type: String
published: String
name: String
content: PostContent
summary: String
postStatus: String
visibility: String
category: [String]
featured: [String]
photo: [String]
video: [String]
audio: [String]
likeOf: [String]
repostOf: [String]
inReplyTo: [String]
bookmarkOf: [String]
quotationOf: [String]
syndication: [String]
author: PostAuthor
checkin: PostLocation
location: PostLocation
refs: [Post]
}
type PostConnection {
cursor: String!
hasMore: Boolean!
posts: [Post]!
}
type Channel {
uid: ID!
name: String!
unread: Int
_t_slug: String!
_t_layout: String!
_t_autoRead: Boolean!
_t_infiniteScroll: Boolean!
_t_unreadOnly: Boolean!
}
type UserSettings {
likeSyndication: [String]!
repostSyndication: [String]!
noteSyndication: [String]!
}
type User {
url: String!
name: String
photo: String
# token: String
hasMicrosub: Boolean!
hasMicropub: Boolean!
settings: UserSettings!
}
type LoginResponse {
token: String!
user: User!
}
type Subscription {
timelineSubscription(
channel: String!
limit: Int
before: String
after: String
source: String
unreadOnly: Boolean
): TimelineResult!
}
type Query {
channels: [Channel]
following(channel: String!): [SearchResult]
blocked(channel: String!): [SearchResult]
muted(channel: String!): [SearchResult]
# posts(channel: String!, limit: Int, before: String, after: String): [Post]!
timeline(
channel: String!
limit: Int
before: String
after: String
source: String
unreadOnly: Boolean
): TimelineResult!
search(query: String!): [SearchResult]!
preview(url: String!): [Post]!
user: User
micropubPosts(
postType: String
limit: Int
before: String
after: String
order: String
): TimelineResult!
micropubQuery(query: String): String
}
type Mutation {
getAuthUrl(url: String!): String
login(code: String!, state: String!): LoginResponse!
markPostRead(channel: String!, post: String!): Post!
markPostUnread(channel: String!, post: String!): Post!
removePost(channel: String!, post: String!): Post!
mute(channel: String!, url: String!): Boolean!
unmute(channel: String!, url: String!): Boolean!
block(channel: String!, url: String!): Boolean!
unblock(channel: String!, url: String!): Boolean!
markChannelRead(channel: String!, post: String!): Channel!
follow(channel: String!, url: String!): Boolean!
unfollow(channel: String!, url: String!): Boolean!
addChannel(name: String!): Channel!
reorderChannels(channels: [String!]!): Boolean!
removeChannel(channel: String!): Boolean!
setUserSetting(key: String!, value: String!): Boolean!
refetchPost(url: String!, post: String!): Post!
updateChannel(
uid: String!
name: String
unread: Int
_t_slug: String
_t_layout: String
_t_autoRead: Boolean
_t_infiniteScroll: Boolean
_t_unreadOnly: Boolean
): Channel!
micropubCreate(json: String!): String!
micropubUpdate(url: String!, json: String!): String!
micropubDelete(url: String!): Boolean!
micropubUndelete(url: String!): Boolean!
}
`
module.exports = typeDefs