Skip to content

Commit 84c50c4

Browse files
committed
chore: update GraphQL schema
1 parent 689bcb5 commit 84c50c4

File tree

2 files changed

+95
-42
lines changed

2 files changed

+95
-42
lines changed

gql/graphql.ts

Lines changed: 46 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,18 @@ export type Database = Node & {
103103
/** SQL schema */
104104
schema: Scalars['String']['output'];
105105
slug: Scalars['String']['output'];
106+
structure: DatabaseStructure;
107+
};
108+
109+
export type DatabaseStructure = {
110+
__typename?: 'DatabaseStructure';
111+
tables: Array<DatabaseTable>;
112+
};
113+
114+
export type DatabaseTable = {
115+
__typename?: 'DatabaseTable';
116+
columns: Array<Scalars['String']['output']>;
117+
name: Scalars['String']['output'];
106118
};
107119

108120
/**
@@ -796,6 +808,8 @@ export type QueryUsersArgs = {
796808

797809
export type Question = Node & {
798810
__typename?: 'Question';
811+
/** Have you tried to solve the question? */
812+
attempted: Scalars['Boolean']['output'];
799813
/** Question category, e.g. 'query' */
800814
category: Scalars['String']['output'];
801815
database: Database;
@@ -804,12 +818,28 @@ export type Question = Node & {
804818
/** Question difficulty, e.g. 'easy' */
805819
difficulty: QuestionDifficulty;
806820
id: Scalars['ID']['output'];
821+
/** Get the last submission for this question. */
822+
lastSubmission?: Maybe<Submission>;
807823
/** Reference answer */
808824
referenceAnswer: Scalars['String']['output'];
809825
referenceAnswerResult: SqlExecutionResult;
810-
submissions?: Maybe<Array<Submission>>;
826+
/** Have you solved the question? */
827+
solved: Scalars['Boolean']['output'];
828+
submissions: SubmissionConnection;
811829
/** Question title */
812830
title: Scalars['String']['output'];
831+
/** List of your submissions for this question, ordered by submitted at descending. */
832+
userSubmissions: Array<Submission>;
833+
};
834+
835+
836+
export type QuestionSubmissionsArgs = {
837+
after?: InputMaybe<Scalars['Cursor']['input']>;
838+
before?: InputMaybe<Scalars['Cursor']['input']>;
839+
first?: InputMaybe<Scalars['Int']['input']>;
840+
last?: InputMaybe<Scalars['Int']['input']>;
841+
orderBy?: InputMaybe<SubmissionOrder>;
842+
where?: InputMaybe<SubmissionWhereInput>;
813843
};
814844

815845
/** A connection to a list of items. */
@@ -1019,6 +1049,12 @@ export type ScopeSetWhereInput = {
10191049
slugNotIn?: InputMaybe<Array<Scalars['String']['input']>>;
10201050
};
10211051

1052+
export type SolvedQuestionByDifficulty = {
1053+
__typename?: 'SolvedQuestionByDifficulty';
1054+
difficulty: QuestionDifficulty;
1055+
solvedQuestions: Scalars['Int']['output'];
1056+
};
1057+
10221058
export type Submission = Node & {
10231059
__typename?: 'Submission';
10241060
error?: Maybe<Scalars['String']['output']>;
@@ -1070,6 +1106,14 @@ export type SubmissionResult = {
10701106
result?: Maybe<UserSqlExecutionResult>;
10711107
};
10721108

1109+
export type SubmissionStatistics = {
1110+
__typename?: 'SubmissionStatistics';
1111+
attemptedQuestions: Scalars['Int']['output'];
1112+
solvedQuestionByDifficulty: Array<SolvedQuestionByDifficulty>;
1113+
solvedQuestions: Scalars['Int']['output'];
1114+
totalQuestions: Scalars['Int']['output'];
1115+
};
1116+
10731117
/** SubmissionStatus is enum for the field status */
10741118
export enum SubmissionStatus {
10751119
Failed = 'failed',
@@ -1146,10 +1190,6 @@ export type SubmissionWhereInput = {
11461190
submittedCodeNotIn?: InputMaybe<Array<Scalars['String']['input']>>;
11471191
};
11481192

1149-
export type SubmissionsOfQuestionWhereInput = {
1150-
status?: InputMaybe<SubmissionStatus>;
1151-
};
1152-
11531193
/**
11541194
* UpdateDatabaseInput is used for update Database object.
11551195
* Input was generated by ent.
@@ -1245,9 +1285,8 @@ export type User = Node & {
12451285
impersonatedBy?: Maybe<User>;
12461286
name: Scalars['String']['output'];
12471287
points: PointConnection;
1288+
submissionStatistics: SubmissionStatistics;
12481289
submissions: SubmissionConnection;
1249-
/** Get all submissions of a question. */
1250-
submissionsOfQuestion: SubmissionConnection;
12511290
/** The total points of the user. */
12521291
totalPoints: Scalars['Int']['output'];
12531292
updatedAt: Scalars['Time']['output'];
@@ -1283,17 +1322,6 @@ export type UserSubmissionsArgs = {
12831322
where?: InputMaybe<SubmissionWhereInput>;
12841323
};
12851324

1286-
1287-
export type UserSubmissionsOfQuestionArgs = {
1288-
after?: InputMaybe<Scalars['Cursor']['input']>;
1289-
before?: InputMaybe<Scalars['Cursor']['input']>;
1290-
first?: InputMaybe<Scalars['Int']['input']>;
1291-
last?: InputMaybe<Scalars['Int']['input']>;
1292-
orderBy?: InputMaybe<SubmissionOrder>;
1293-
questionID: Scalars['ID']['input'];
1294-
where?: InputMaybe<SubmissionsOfQuestionWhereInput>;
1295-
};
1296-
12971325
/** A connection to a list of items. */
12981326
export type UserConnection = {
12991327
__typename?: 'UserConnection';

schema.graphql

Lines changed: 49 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,16 @@ type Database implements Node {
102102
"""SQL schema"""
103103
schema: String!
104104
slug: String!
105+
structure: DatabaseStructure!
106+
}
107+
108+
type DatabaseStructure {
109+
tables: [DatabaseTable!]!
110+
}
111+
112+
type DatabaseTable {
113+
columns: [String!]!
114+
name: String!
105115
}
106116

107117
"""
@@ -674,6 +684,8 @@ type Query {
674684
}
675685

676686
type Question implements Node {
687+
"""Have you tried to solve the question?"""
688+
attempted: Boolean!
677689
"""Question category, e.g. 'query'"""
678690
category: String!
679691
database: Database!
@@ -682,12 +694,35 @@ type Question implements Node {
682694
"""Question difficulty, e.g. 'easy'"""
683695
difficulty: QuestionDifficulty!
684696
id: ID!
697+
"""Get the last submission for this question."""
698+
lastSubmission: Submission
685699
"""Reference answer"""
686700
referenceAnswer: String!
687701
referenceAnswerResult: SQLExecutionResult!
688-
submissions: [Submission!]
702+
"""Have you solved the question?"""
703+
solved: Boolean!
704+
submissions(
705+
"""Returns the elements in the list that come after the specified cursor."""
706+
after: Cursor
707+
"""
708+
Returns the elements in the list that come before the specified cursor.
709+
"""
710+
before: Cursor
711+
"""Returns the first _n_ elements from the list."""
712+
first: Int
713+
"""Returns the last _n_ elements from the list."""
714+
last: Int
715+
"""Ordering options for Submissions returned from the connection."""
716+
orderBy: SubmissionOrder
717+
"""Filtering options for Submissions returned from the connection."""
718+
where: SubmissionWhereInput
719+
): SubmissionConnection!
689720
"""Question title"""
690721
title: String!
722+
"""
723+
List of your submissions for this question, ordered by submitted at descending.
724+
"""
725+
userSubmissions: [Submission!]!
691726
}
692727

693728
"""A connection to a list of items."""
@@ -893,6 +928,11 @@ input ScopeSetWhereInput {
893928
slugNotIn: [String!]
894929
}
895930

931+
type SolvedQuestionByDifficulty {
932+
difficulty: QuestionDifficulty!
933+
solvedQuestions: Int!
934+
}
935+
896936
type Submission implements Node {
897937
error: String
898938
id: ID!
@@ -940,6 +980,13 @@ type SubmissionResult {
940980
result: UserSQLExecutionResult
941981
}
942982

983+
type SubmissionStatistics {
984+
attemptedQuestions: Int!
985+
solvedQuestionByDifficulty: [SolvedQuestionByDifficulty!]!
986+
solvedQuestions: Int!
987+
totalQuestions: Int!
988+
}
989+
943990
"""SubmissionStatus is enum for the field status"""
944991
enum SubmissionStatus {
945992
failed
@@ -1016,10 +1063,6 @@ input SubmissionWhereInput {
10161063
submittedCodeNotIn: [String!]
10171064
}
10181065

1019-
input SubmissionsOfQuestionWhereInput {
1020-
status: SubmissionStatus
1021-
}
1022-
10231066
"""The builtin Time type"""
10241067
scalar Time
10251068

@@ -1147,6 +1190,7 @@ type User implements Node {
11471190
"""Filtering options for Points returned from the connection."""
11481191
where: PointWhereInput
11491192
): PointConnection!
1193+
submissionStatistics: SubmissionStatistics!
11501194
submissions(
11511195
"""Returns the elements in the list that come after the specified cursor."""
11521196
after: Cursor
@@ -1163,25 +1207,6 @@ type User implements Node {
11631207
"""Filtering options for Submissions returned from the connection."""
11641208
where: SubmissionWhereInput
11651209
): SubmissionConnection!
1166-
"""Get all submissions of a question."""
1167-
submissionsOfQuestion(
1168-
"""Returns the elements in the list that come after the specified cursor."""
1169-
after: Cursor
1170-
"""
1171-
Returns the elements in the list that come before the specified cursor.
1172-
"""
1173-
before: Cursor
1174-
"""Returns the first _n_ elements from the list."""
1175-
first: Int
1176-
"""Returns the last _n_ elements from the list."""
1177-
last: Int
1178-
"""The order by input to order the submissions."""
1179-
orderBy: SubmissionOrder
1180-
"""The question ID."""
1181-
questionID: ID!
1182-
"""The where input to filter the submissions."""
1183-
where: SubmissionsOfQuestionWhereInput
1184-
): SubmissionConnection!
11851210
"""The total points of the user."""
11861211
totalPoints: Int!
11871212
updatedAt: Time!

0 commit comments

Comments
 (0)