-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathqueries.py
134 lines (124 loc) · 2.65 KB
/
queries.py
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# Login mutation
login_mutation = """
mutation ($k1: String!, $sig: String!) {
lnurlauth(k1: $k1, sig: $sig) {
ok
jwt
error
}
}
"""
# Logout mutation
logout_mutation = """
mutation {
logout {
ok
}
}
"""
# Get items query
get_items_query = """
query ($limit: Int, $cursor: String, $sort: String, $type: String, $sub: String, $name: String, $when: String, $by: String) {
items(limit: $limit, cursor: $cursor, sort: $sort, type: $type, sub: $sub, name: $name, when: $when, by: $by) {
items {
id
createdAt
updatedAt
title
url
text
user {
id
}
boost
upvotes
wvotes
ncomments
}
}
}
"""
# Search items query
search_items_query = """
query ($q: String, $sub: String, $cursor: String, $what: String, $sort: String, $when: String) {
search(q: $q, sub: $sub, cursor: $cursor, what: $what, sort: $sort, when: $when) {
items {
id
title
url
text
user {
id
name
}
}
}
}
"""
# Get item by ID query, depth removed
get_item_by_id_query = """
query ($id: ID!) {
item(id: $id) {
id
createdAt
updatedAt
title
url
text
user {
id
name
}
boost
bounty
upvotes
wvotes
ncomments
}
}
"""
# Get current session query
get_current_session_query = """
query {
me {
id
name
bio {
title
url
}
}
}
"""
# Get notes query
get_notes_query = """
query ($limit: Int, $skip: Int) {
notes(limit: $limit, skip: $skip) {
id
text
createdAt
updatedAt
user {
id
name
}
}
}
"""
# Check duplicate query
check_duplicate_query = """
query ($url: String!) {
dupes(url: $url) {
id
title
createdAt
}
}
"""
create_comment_query = """
mutation upsertComment($text: String!, $parentId: ID!) {
upsertComment(text: $text, parentId: $parentId) {
id
}
}
"""