-
Notifications
You must be signed in to change notification settings - Fork 2
/
typeDefs.graphql
57 lines (49 loc) · 951 Bytes
/
typeDefs.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
scalar DateTime
type Person {
id: ID!
firstName: String!
lastName: String!
self: Boolean!
lastMessage: Message
lastRead: DateTime
}
type Message {
id: ID!
sender: Person!
recipient: Person!
body: String!
timestamp: DateTime!
}
type Query {
self: Person!
people: [Person!]!
messages(personId: ID): [Message!]!
}
interface MutationResponse {
code: String!
success: Boolean!
message: String!
}
type SendMessageMutationResponse implements MutationResponse {
code: String!
success: Boolean!
message: String!
result: Message
}
type MarkReadMutationResponse implements MutationResponse {
code: String!
success: Boolean!
message: String!
result: Person
}
type Mutation {
sendMessage(
messageId: ID!
recipientId: ID!
body: String!
): SendMessageMutationResponse
markRead(personId: ID!, lastRead: DateTime!): MarkReadMutationResponse
}
type Subscription {
messageReceived: Message
}