-
Notifications
You must be signed in to change notification settings - Fork 3
/
schema.graphql
59 lines (55 loc) · 1.63 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
scalar Time
type StorageProvider {
id: Int!
providerId: Int!
email: String!
photo: String!
}
type User {
id: Int!
email: String!
name: String!
dropboxAuthorized: Boolean!
dropboxEmail: String
dropboxAvatar: String
connectedStorageProviders: [StorageProvider!]!
}
type Token {
loginToken: String!
#expiry: Time
}
type Link {
id: Int!
title: String!
isProtected: Boolean!
slug: String
description: String
deadline: Time
storageProvider: StorageProvider
## storageProvider is null if the link is not connected to any storage provider
}
type Message {
message: String!
}
# the schema allows the following query:
type Query {
## TODO: change links type below to [Link!]!
links: [Link]
me: User
link(slug: String!): Link
}
type Mutation {
# Register new user
register(email: String!, password: String!, name: String!): Token
login(email: String!, password: String!): Token
requestPasswordRecovery(email: String!): Message
recoverPassword(email: String!, recoverToken: String!, newPassword: String!): Token
updatePassword(oldPassword: String!, newPassword: String!): Message
updateProfile(newName: String!): Message
connectStorageProvider(providerId: Int!, providerToken: String!): Message
disconnectStorageProvider(providerId: Int!): Message
createLink(title: String!, slug: String!, description: String, deadline: Time, password: String, providerId: Int): Link
updateLink(linkId: Int!, title: String!, slug: String!, description: String, deadline: Time, password: String, providerId: Int): Link
deleteLink(linkId: Int!): Message
checkLinkPassword(linkId: Int!, password: String!): Message
}