Skip to content

Commit

Permalink
Add required fields
Browse files Browse the repository at this point in the history
  • Loading branch information
flacial committed Oct 18, 2022
1 parent e56f540 commit efbafca
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 7 deletions.
21 changes: 15 additions & 6 deletions __dummy__/getExercisesData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,14 @@ const getExercisesData: GetExercisesQuery = {
author: {
id: 1,
username: 'noob',
email: 'noob@c0d3.com'
email: 'noob@c0d3.com',
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,
Expand All @@ -84,11 +87,14 @@ const getExercisesData: GetExercisesQuery = {
author: {
id: 1,
username: 'noob',
email: 'noob@c0d3.com'
email: 'noob@c0d3.com',
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,
Expand All @@ -101,11 +107,14 @@ const getExercisesData: GetExercisesQuery = {
author: {
id: 1,
username: 'noob',
email: 'noob@c0d3.com'
email: 'noob@c0d3.com',
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' }]
Expand Down
17 changes: 16 additions & 1 deletion graphql/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@ export type User = {
__typename?: 'User'
cliToken?: Maybe<Scalars['String']>
discordAvatarUrl: Scalars['String']
discordId?: Maybe<Scalars['String']>
discordUserId: Scalars['String']
discordUsername: Scalars['String']
email: Scalars['String']
Expand Down Expand Up @@ -865,7 +866,15 @@ export type GetExercisesQuery = {
description: string
answer: string
explanation?: string | null
author: { __typename?: 'User'; id: number; username: string; email: string }
flaggedAt?: string | null
flagReason?: string | null
author: {
__typename?: 'User'
id: number
username: string
email: string
discordId?: string | null
}
module: {
__typename?: 'Module'
name: string
Expand Down Expand Up @@ -1973,6 +1982,7 @@ export type UserResolvers<
> = ResolversObject<{
cliToken?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>
discordAvatarUrl?: Resolver<ResolversTypes['String'], ParentType, ContextType>
discordId?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>
discordUserId?: Resolver<ResolversTypes['String'], ParentType, ContextType>
discordUsername?: Resolver<ResolversTypes['String'], ParentType, ContextType>
email?: Resolver<ResolversTypes['String'], ParentType, ContextType>
Expand Down Expand Up @@ -3687,6 +3697,7 @@ export const GetExercisesDocument = gql`
id
username
email
discordId
}
module {
name
Expand All @@ -3697,6 +3708,8 @@ export const GetExercisesDocument = gql`
description
answer
explanation
flaggedAt
flagReason
}
exerciseSubmissions {
exerciseId
Expand Down Expand Up @@ -5961,6 +5974,7 @@ export type TokenResponseFieldPolicy = {
export type UserKeySpecifier = (
| 'cliToken'
| 'discordAvatarUrl'
| 'discordId'
| 'discordUserId'
| 'discordUsername'
| 'email'
Expand All @@ -5975,6 +5989,7 @@ export type UserKeySpecifier = (
export type UserFieldPolicy = {
cliToken?: FieldPolicy<any> | FieldReadFunction<any>
discordAvatarUrl?: FieldPolicy<any> | FieldReadFunction<any>
discordId?: FieldPolicy<any> | FieldReadFunction<any>
discordUserId?: FieldPolicy<any> | FieldReadFunction<any>
discordUsername?: FieldPolicy<any> | FieldReadFunction<any>
email?: FieldPolicy<any> | FieldReadFunction<any>
Expand Down
3 changes: 3 additions & 0 deletions graphql/queries/getExercises.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const GET_EXERCISES = gql`
id
username
email
discordId
}
module {
name
Expand All @@ -30,6 +31,8 @@ const GET_EXERCISES = gql`
description
answer
explanation
flaggedAt
flagReason
}
exerciseSubmissions {
exerciseId
Expand Down
1 change: 1 addition & 0 deletions graphql/typeDefs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ export default gql`
isAdmin: Boolean!
isConnectedToDiscord: Boolean!
cliToken: String
discordId: String
discordUserId: String!
discordUsername: String!
discordAvatarUrl: String!
Expand Down

0 comments on commit efbafca

Please sign in to comment.