diff --git a/__dummy__/getExercisesData.ts b/__dummy__/getExercisesData.ts index 0ce97d11c..1735c3393 100644 --- a/__dummy__/getExercisesData.ts +++ b/__dummy__/getExercisesData.ts @@ -68,11 +68,13 @@ const getExercisesData: GetExercisesQuery = { id: 1, username: 'noob', email: 'noob@c0d3.com', - discordUsername: 'noobOnDiscord' + discordId: '8321' }, description: '```\nlet a = 5\na = a + 10\n// what is a?\n```', answer: '15', - explanation: 'You can reassign variables that were created with "let".' + explanation: 'You can reassign variables that were created with "let".', + flaggedAt: null, + flagReason: null }, { id: 2, @@ -86,11 +88,13 @@ const getExercisesData: GetExercisesQuery = { id: 1, username: 'noob', email: 'noob@c0d3.com', - discordUsername: 'noobOnDiscord' + discordId: '8321' }, description: '```\nlet a = 1\na += 2\n// what is a?\n```', answer: '3', - explanation: '`a += 2` is a shorter way to write `a = a + 2`' + explanation: '`a += 2` is a shorter way to write `a = a + 2`', + flaggedAt: null, + flagReason: null }, { id: 3, @@ -104,11 +108,13 @@ const getExercisesData: GetExercisesQuery = { id: 1, username: 'noob', email: 'noob@c0d3.com', - discordUsername: 'noobOnDiscord' + discordId: '8321' }, description: '```\nlet a = 1\na -= 2\n// what is a?\n```', answer: '-1', - explanation: null + explanation: null, + flaggedAt: null, + flagReason: null } ], exerciseSubmissions: [{ exerciseId: 1, userAnswer: '15' }] diff --git a/graphql/index.tsx b/graphql/index.tsx index f960f323f..6ca7dbfa2 100644 --- a/graphql/index.tsx +++ b/graphql/index.tsx @@ -421,6 +421,7 @@ export type User = { __typename?: 'User' cliToken?: Maybe discordAvatarUrl: Scalars['String'] + discordId?: Maybe discordUserId: Scalars['String'] discordUsername: Scalars['String'] email: Scalars['String'] @@ -865,12 +866,14 @@ export type GetExercisesQuery = { description: string answer: string explanation?: string | null + flaggedAt?: string | null + flagReason?: string | null author: { __typename?: 'User' id: number username: string email: string - discordUsername: string + discordId?: string | null } module: { __typename?: 'Module' @@ -1979,6 +1982,7 @@ export type UserResolvers< > = ResolversObject<{ cliToken?: Resolver, ParentType, ContextType> discordAvatarUrl?: Resolver + discordId?: Resolver, ParentType, ContextType> discordUserId?: Resolver discordUsername?: Resolver email?: Resolver @@ -3693,7 +3697,7 @@ export const GetExercisesDocument = gql` id username email - discordUsername + discordId } module { name @@ -3704,6 +3708,8 @@ export const GetExercisesDocument = gql` description answer explanation + flaggedAt + flagReason } exerciseSubmissions { exerciseId @@ -5968,6 +5974,7 @@ export type TokenResponseFieldPolicy = { export type UserKeySpecifier = ( | 'cliToken' | 'discordAvatarUrl' + | 'discordId' | 'discordUserId' | 'discordUsername' | 'email' @@ -5982,6 +5989,7 @@ export type UserKeySpecifier = ( export type UserFieldPolicy = { cliToken?: FieldPolicy | FieldReadFunction discordAvatarUrl?: FieldPolicy | FieldReadFunction + discordId?: FieldPolicy | FieldReadFunction discordUserId?: FieldPolicy | FieldReadFunction discordUsername?: FieldPolicy | FieldReadFunction email?: FieldPolicy | FieldReadFunction diff --git a/graphql/queries/getExercises.ts b/graphql/queries/getExercises.ts index e80cce4da..4a73b1d33 100644 --- a/graphql/queries/getExercises.ts +++ b/graphql/queries/getExercises.ts @@ -20,7 +20,7 @@ const GET_EXERCISES = gql` id username email - discordUsername + discordId } module { name @@ -31,6 +31,8 @@ const GET_EXERCISES = gql` description answer explanation + flaggedAt + flagReason } exerciseSubmissions { exerciseId diff --git a/graphql/typeDefs.ts b/graphql/typeDefs.ts index 1dfac77b2..b556b1758 100644 --- a/graphql/typeDefs.ts +++ b/graphql/typeDefs.ts @@ -189,6 +189,7 @@ export default gql` isAdmin: Boolean! isConnectedToDiscord: Boolean! cliToken: String + discordId: String discordUserId: String! discordUsername: String! discordAvatarUrl: String!