File tree Expand file tree Collapse file tree 3 files changed +71
-6
lines changed Expand file tree Collapse file tree 3 files changed +71
-6
lines changed Original file line number Diff line number Diff line change 1
1
import gql from 'graphql-tag' ;
2
2
import { Query } from 'overmind-graphql' ;
3
+ import {
4
+ AddCommentResponse ,
5
+ AddCommentVariables ,
6
+ DeleteCommentVariables ,
7
+ DeleteCommentResponse ,
8
+ UpdateCommentVariables ,
9
+ UpdateCommentResponse ,
10
+ } from './types' ;
3
11
4
- export const addComment : Query < any , any > = gql `
12
+ export const addComment : Query < AddCommentResponse , AddCommentVariables > = gql `
5
13
mutation AddComment(
6
14
$sandboxId: String!
7
15
$comment: String!
8
16
$username: String!
17
+ $metadata: String
9
18
) {
10
- addComment(sandboxId: $sandboxId, comment: $comment, username: $username) {
19
+ addComment(
20
+ sandboxId: $sandboxId
21
+ comment: $comment
22
+ username: $username
23
+ metadata: $metadata
24
+ ) {
11
25
id
12
26
isResolved
13
27
originalMessage {
@@ -22,25 +36,37 @@ export const addComment: Query<any, any> = gql`
22
36
replies {
23
37
id
24
38
}
39
+ metadata
25
40
insertedAt
26
41
updatedAt
27
42
}
28
43
}
29
44
` ;
30
45
31
- export const deleteComment : Query < any , any > = gql `
46
+ export const deleteComment : Query <
47
+ DeleteCommentResponse ,
48
+ DeleteCommentVariables
49
+ > = gql `
32
50
mutation DeleteComment($id: String!) {
33
51
deleteComment(id: $id) {
34
52
id
35
53
}
36
54
}
37
55
` ;
38
56
39
- export const updateComment : Query < any , any > = gql `
40
- mutation UpdateComment($id: String!, $comment: String, $isResolved: Boolean) {
57
+ export const updateComment : Query <
58
+ UpdateCommentResponse ,
59
+ UpdateCommentVariables
60
+ > = gql `
61
+ mutation UpdateComment(
62
+ $id: String!
63
+ $comment: String
64
+ $isResolved: Boolean
65
+ $metadata: String
66
+ ) {
41
67
updateComment(
42
68
id: $id
43
- data: { comment: $comment, isResolved: $isResolved }
69
+ data: { comment: $comment, isResolved: $isResolved, metadata: $metadata }
44
70
) {
45
71
id
46
72
isResolved
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ export const allComments: Query<CommentsResponse, CommentsVariables> = gql`
32
32
}
33
33
insertedAt
34
34
updatedAt
35
+ metadata
35
36
}
36
37
}
37
38
` ;
@@ -59,6 +60,7 @@ export const comment: Query<CommentResponse, CommentVariables> = gql`
59
60
}
60
61
insertedAt
61
62
updatedAt
63
+ metadata
62
64
}
63
65
}
64
66
` ;
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ export type Comment = {
17
17
replies : Message [ ] ;
18
18
insertedAt : string ;
19
19
updatedAt ?: string ;
20
+ metadata ?: string ;
20
21
} ;
21
22
22
23
export type CommentsVariables = {
@@ -32,6 +33,7 @@ export type CommentsResponse = {
32
33
originalMessage : Message ;
33
34
insertedAt : string ;
34
35
updatedAt : string ;
36
+ metadata : string ;
35
37
}
36
38
] ;
37
39
} ;
@@ -40,12 +42,46 @@ export type AddCommentVariables = {
40
42
sandboxId : string ;
41
43
comment : string ;
42
44
username : string ;
45
+ metadata ?: string ;
43
46
} ;
44
47
45
48
export type AddCommentResponse = {
46
49
addComment : {
47
50
id : string ;
51
+ isResolved : boolean ;
52
+ replies : Pick < Message , 'id' > [ ] ;
48
53
originalMessage : Message ;
54
+ insertedAt : string ;
55
+ updatedAt : string ;
56
+ metadata : string ;
57
+ } ;
58
+ } ;
59
+
60
+ export type DeleteCommentVariables = {
61
+ id : string ;
62
+ } ;
63
+
64
+ export type DeleteCommentResponse = {
65
+ deleteComment : {
66
+ id : string ;
67
+ } ;
68
+ } ;
69
+
70
+ export type UpdateCommentVariables = {
71
+ id : string ;
72
+ comment ?: string ;
73
+ isResolved ?: boolean ;
74
+ metadata ?: string ;
75
+ } ;
76
+
77
+ export type UpdateCommentResponse = {
78
+ updateComment : {
79
+ id : string ;
80
+ isResolved : string ;
81
+ originalMessage : {
82
+ id : string ;
83
+ content : string ;
84
+ } ;
49
85
} ;
50
86
} ;
51
87
@@ -65,5 +101,6 @@ export type CommentResponse = {
65
101
replies : Message [ ] ;
66
102
insertedAt : string ;
67
103
updatedAt : string ;
104
+ metadata : string ;
68
105
} ;
69
106
} ;
You can’t perform that action at this time.
0 commit comments