-
Notifications
You must be signed in to change notification settings - Fork 2
/
queries.ts
59 lines (54 loc) · 957 Bytes
/
queries.ts
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
import { MessageType, PersonType } from "./types";
import { TypedDocumentNode, gql } from "@apollo/client";
interface GetPeopleData {
people: PersonType[];
}
export const GET_PEOPLE_QUERY: TypedDocumentNode<GetPeopleData> = gql`
query GetPeople {
people {
id
firstName
lastName
lastMessage {
id
sender {
id
self
}
recipient {
id
self
}
body
timestamp
}
lastRead
}
}
`;
export interface MessagesData {
messages: MessageType[];
}
export interface MessagesVariables {
personId?: string;
}
export const GET_MESSAGES_QUERY: TypedDocumentNode<
MessagesData,
MessagesVariables
> = gql`
query GetMessages($personId: ID) {
messages(personId: $personId) {
id
sender {
id
self
}
recipient {
id
self
}
body
timestamp
}
}
`;