-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
66 lines (54 loc) · 1.62 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
schema {
query: Query
mutation: Mutation
subscription: Subscription
}
type Query {
aiRequest(aiRequestId: Int!): AiRequest!
@juniper(ownership: "owned", async: true)
unansweredAiRequests: [AiRequest!]!
@juniper(ownership: "owned", async: true)
}
type Mutation {
"""
If a valid session uuid is provided, it will become associated with this user and the same session will be
returned, otherwise a new session will be created.
"""
register(username: String!, password: String!): Session!
@juniper(ownership: "owned", async: true)
authAnon: Session! @juniper(ownership: "owned", async: true)
"""
If a valid session uuid is provided, it will become associated with this user and the same session will be
returned, otherwise a new session will be created.
"""
authUser(username: String!, password: String!): Session!
@juniper(ownership: "owned", async: true)
"""
If a valid session uuid is provided, expires session and returns true, otherwise returns false.
"""
logout: Boolean! @juniper(ownership: "owned", async: true)
createAiRequest(text: String!): AiRequest!
@juniper(ownership: "owned", async: true)
createAiReply(aiRequestId: Int!, text: String!): AiRequest!
@juniper(ownership: "owned", async: true)
}
type Subscription {
aiReply(aiRequestId: Int!): AiRequest!
@juniper(ownership: "owned", async: true)
}
type Session {
uuid: Uuid!
}
type AiRequest {
id: Int!
sessionId: Int!
query: String!
queryCreated: DateTimeUtc!
reply: String
replyCreated: DateTimeUtc
history: [AiRequest!]! @juniper(ownership: "owned", async: true)
}
# ISO 8601 string
scalar DateTimeUtc
# Hex string with dashes
scalar Uuid