Skip to content

Commit f2c4f37

Browse files
authored
Merge pull request #14 from database-playground/pan93412/implement-statistics
feat: implement SubmissionStatistics
2 parents 3e4e166 + e763cf7 commit f2c4f37

File tree

7 files changed

+658
-3
lines changed

7 files changed

+658
-3
lines changed

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ require (
1515
github.com/joho/godotenv v1.5.1
1616
github.com/mattn/go-sqlite3 v1.14.28
1717
github.com/redis/rueidis v1.0.64
18+
github.com/samber/lo v1.51.0
1819
github.com/stretchr/testify v1.11.1
1920
github.com/testcontainers/testcontainers-go v0.38.0
2021
github.com/urfave/cli/v3 v3.4.1

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,8 @@ github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0t
221221
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
222222
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
223223
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
224+
github.com/samber/lo v1.51.0 h1:kysRYLbHy/MB7kQZf5DSN50JHmMsNEdeY24VzJFu7wI=
225+
github.com/samber/lo v1.51.0/go.mod h1:4+MXEGsJzbKGaUEQFKBq2xtfuznW9oz/WrgyzMzRoM0=
224226
github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=
225227
github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=
226228
github.com/shirou/gopsutil/v4 v4.25.8 h1:NnAsw9lN7587WHxjJA9ryDnqhJpFH6A+wagYWTOH970=

graph/ent.resolvers.go

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

graph/model/models_gen.go

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

graph/question.graphqls

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,23 @@ extend type Question {
7979
solved: Boolean!
8080
}
8181

82+
extend type User {
83+
submissionStatistics: SubmissionStatistics!
84+
}
85+
86+
type SubmissionStatistics {
87+
totalQuestions: Int!
88+
attemptedQuestions: Int!
89+
solvedQuestions: Int!
90+
91+
solvedQuestionByDifficulty: [SolvedQuestionByDifficulty!]!
92+
}
93+
94+
type SolvedQuestionByDifficulty {
95+
difficulty: QuestionDifficulty!
96+
solvedQuestions: Int!
97+
}
98+
8299
type SQLExecutionResult {
83100
columns: [String!]!
84101
rows: [[String!]!]!

graph/question.resolvers.go

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

0 commit comments

Comments
 (0)