-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgraphql.py
71 lines (69 loc) · 1.59 KB
/
graphql.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
BASE_URL = "https://leetcode.com/graphql"
QUESTION_CONTENT = """
query questionContent($titleSlug: String!) {
question(titleSlug: $titleSlug) {
content
mysqlSchemas
dataSchemas
}
}
"""
QUESTION_TITLE = """
query questionTitle($titleSlug: String!) {
question(titleSlug: $titleSlug) {
questionId
questionFrontendId
title
titleSlug
isPaidOnly
difficulty
likes
dislikes
stats
}
}
"""
SINGLE_QUESTION_TOPIC_TAGS = """
query singleQuestionTopicTags($titleSlug: String!) {
question(titleSlug: $titleSlug) {
topicTags {
name
slug
}
}
}
"""
QUESTION_DETAIL_COMPANY_TAGS = """
query questionDetailCompanyTags($titleSlug: String!) {
question(titleSlug: $titleSlug) {
companyTags {
name
slug
imgUrl
}
}
}
"""
COMMUNITY_SOLUTIONS = """
query communitySolutions($titleSlug: String!, $skip: Int!, $first: Int!, $query: String, $orderBy: TopicSortingOption, $languageTags: [String!], $topicTags: [String!]) {
questionSolutions(
filters: {questionSlug: $titleSlug, skip: $skip, first: $first, query: $query, orderBy: $orderBy, languageTags: $languageTags, topicTags: $topicTags}
) {
hasDirectResults
totalNum
solutions {
id
title
commentCount
topLevelCommentCount
viewCount
pinned
isFavorite
solutionTags {
name
slug
}
}
}
}
"""