Skip to content

Commit ae543a7

Browse files
committed
feat(graph): implement easier "userSubmissions" API
1 parent 33c928c commit ae543a7

File tree

3 files changed

+22
-783
lines changed

3 files changed

+22
-783
lines changed

graph/question.graphqls

Lines changed: 5 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ extend type Mutation {
6363
extend type Question {
6464
referenceAnswerResult: SQLExecutionResult! @scope(scope: "question:read")
6565

66+
"""
67+
List of your submissions for this question.
68+
"""
69+
userSubmissions: [Submission!]!
70+
6671
"""
6772
Have you tried to solve the question?
6873
"""
@@ -74,51 +79,6 @@ extend type Question {
7479
solved: Boolean!
7580
}
7681

77-
extend type User {
78-
"""
79-
Get all submissions of a question.
80-
"""
81-
submissionsOfQuestion(
82-
"""
83-
The question ID.
84-
"""
85-
questionID: ID!,
86-
"""
87-
Returns the elements in the list that come after the specified cursor.
88-
"""
89-
after: Cursor
90-
91-
"""
92-
Returns the first _n_ elements from the list.
93-
"""
94-
first: Int
95-
96-
"""
97-
Returns the elements in the list that come before the specified cursor.
98-
"""
99-
before: Cursor
100-
101-
"""
102-
Returns the last _n_ elements from the list.
103-
"""
104-
last: Int
105-
106-
"""
107-
The where input to filter the submissions.
108-
"""
109-
where: SubmissionsOfQuestionWhereInput
110-
111-
"""
112-
The order by input to order the submissions.
113-
"""
114-
orderBy: SubmissionOrder
115-
): SubmissionConnection!
116-
}
117-
118-
input SubmissionsOfQuestionWhereInput {
119-
status: SubmissionStatus
120-
}
121-
12282
type SQLExecutionResult {
12383
columns: [String!]!
12484
rows: [[String!]!]!

graph/question.resolvers.go

Lines changed: 17 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)