repltalk 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/queries.rb +10 -0
- data/lib/repltalk.rb +25 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a90787033dba7f358725b78a75e013fe4dce8f6ba58129097efbebf908bb74ea
|
4
|
+
data.tar.gz: de1143f3aa2068eef3a62e781bd3cea4bc734623f39167b7a38f77538eb77bc8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9695086e996e64538e30321da4163b3891e0f72561f97e1a329346dd681de05c62fd8cebacd0b6301986d1ce5b57513395057c6c64f260dbb12640a391ac7831
|
7
|
+
data.tar.gz: 5b940e9378ef07c3f42b1b7cd2ce1906a6acebbe470bcc67bfec605c8cbdcb3e0ffedaa8bc6c35fad91618ed4e77e1992f60788283e46f857a68220c6c6029ea
|
data/lib/queries.rb
CHANGED
@@ -339,4 +339,14 @@ class Mutations < Queries
|
|
339
339
|
}
|
340
340
|
}"
|
341
341
|
end
|
342
|
+
|
343
|
+
def Mutations.create_comment
|
344
|
+
"mutation createComment($input: CreateCommentInput!) {
|
345
|
+
createComment(input: $input) {
|
346
|
+
comment {
|
347
|
+
#{@@comment}
|
348
|
+
}
|
349
|
+
}
|
350
|
+
}"
|
351
|
+
end
|
342
352
|
end
|
data/lib/repltalk.rb
CHANGED
@@ -208,6 +208,19 @@ class Comment
|
|
208
208
|
c["comment"]["parentComment"] == nil ? nil : Comment.new(@client, c["comment"]["parentComment"])
|
209
209
|
end
|
210
210
|
|
211
|
+
def create_comment(content)
|
212
|
+
c = @client.graphql(
|
213
|
+
"createComment",
|
214
|
+
Mutations.create_comment,
|
215
|
+
input: {
|
216
|
+
postId: @post_id,
|
217
|
+
commentId: @id,
|
218
|
+
body: content
|
219
|
+
}
|
220
|
+
)
|
221
|
+
Comment.new(@client, c["createComment"]["comment"])
|
222
|
+
end
|
223
|
+
|
211
224
|
def to_s
|
212
225
|
@content
|
213
226
|
end
|
@@ -270,6 +283,18 @@ class Post
|
|
270
283
|
u["post"]["votes"]["items"].map { |vote| User.new(@client, vote["user"]) }
|
271
284
|
end
|
272
285
|
|
286
|
+
def create_comment(content)
|
287
|
+
c = @client.graphql(
|
288
|
+
"createComment",
|
289
|
+
Mutations.create_comment,
|
290
|
+
input: {
|
291
|
+
postId: @id,
|
292
|
+
body: content
|
293
|
+
}
|
294
|
+
)
|
295
|
+
Comment.new(@client, c["createComment"]["comment"])
|
296
|
+
end
|
297
|
+
|
273
298
|
def to_s
|
274
299
|
@title
|
275
300
|
end
|