hotfix: fixing type errors in backend graphql layer (HBE-174) (#45)
* chore: added the nest graphql fix for making it use Int over Float * chore: changed the type of cursor to Int in PaginationArgs * chore: fixed description mismatch in rootUserCreation functions in UserCollection module * chore: removed unused title type in UserRequest input-args * fix: added ID scaler in user-request input type * fix: added ID scaler in team-invitation and user-history --------- Co-authored-by: Mir Arif Hasan <arif.ishan05@gmail.com>
This commit is contained in:
@@ -21,6 +21,9 @@ import { COOKIES_NOT_FOUND } from './errors';
|
|||||||
@Module({
|
@Module({
|
||||||
imports: [
|
imports: [
|
||||||
GraphQLModule.forRoot<ApolloDriverConfig>({
|
GraphQLModule.forRoot<ApolloDriverConfig>({
|
||||||
|
buildSchemaOptions: {
|
||||||
|
numberScalarMode: 'integer',
|
||||||
|
},
|
||||||
cors: process.env.PRODUCTION !== 'true' && {
|
cors: process.env.PRODUCTION !== 'true' && {
|
||||||
origin: process.env.WHITELISTED_ORIGINS.split(','),
|
origin: process.env.WHITELISTED_ORIGINS.split(','),
|
||||||
credentials: true,
|
credentials: true,
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export class TeamInvitation {
|
|||||||
})
|
})
|
||||||
creatorUid: string;
|
creatorUid: string;
|
||||||
|
|
||||||
@Field(() => ID, {
|
@Field({
|
||||||
description: 'Email of the invitee',
|
description: 'Email of the invitee',
|
||||||
})
|
})
|
||||||
inviteeEmail: string;
|
inviteeEmail: string;
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { ArgsType, Field, InputType } from '@nestjs/graphql';
|
import { ArgsType, Field, ID, InputType } from '@nestjs/graphql';
|
||||||
|
|
||||||
@ArgsType()
|
@ArgsType()
|
||||||
@InputType()
|
@InputType()
|
||||||
export class PaginationArgs {
|
export class PaginationArgs {
|
||||||
@Field({
|
@Field(() => ID, {
|
||||||
nullable: true,
|
nullable: true,
|
||||||
defaultValue: undefined,
|
defaultValue: undefined,
|
||||||
description: 'Cursor for pagination, ID of the last item in the list',
|
description: 'Cursor for pagination, ID of the last item in the list',
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ export class UserCollectionResolver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Mutation(() => UserCollection, {
|
@Mutation(() => UserCollection, {
|
||||||
description: 'Creates a new child REST user collection',
|
description: 'Creates a new child GraphQL user collection',
|
||||||
})
|
})
|
||||||
@UseGuards(GqlAuthGuard)
|
@UseGuards(GqlAuthGuard)
|
||||||
async createGQLChildUserCollection(
|
async createGQLChildUserCollection(
|
||||||
@@ -229,7 +229,7 @@ export class UserCollectionResolver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Mutation(() => UserCollection, {
|
@Mutation(() => UserCollection, {
|
||||||
description: 'Creates a new child GraphQL user collection',
|
description: 'Creates a new child REST user collection',
|
||||||
})
|
})
|
||||||
@UseGuards(GqlAuthGuard)
|
@UseGuards(GqlAuthGuard)
|
||||||
async createRESTChildUserCollection(
|
async createRESTChildUserCollection(
|
||||||
@@ -309,7 +309,8 @@ export class UserCollectionResolver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Mutation(() => Boolean, {
|
@Mutation(() => Boolean, {
|
||||||
description: 'Move user collection into new parent or root',
|
description:
|
||||||
|
'Update the order of UserCollections inside parent collection or in root',
|
||||||
})
|
})
|
||||||
@UseGuards(GqlAuthGuard)
|
@UseGuards(GqlAuthGuard)
|
||||||
async updateUserCollectionOrder(
|
async updateUserCollectionOrder(
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Args, Mutation, Resolver, Subscription } from '@nestjs/graphql';
|
import { Args, ID, Mutation, Resolver, Subscription } from '@nestjs/graphql';
|
||||||
import { UserHistoryService } from './user-history.service';
|
import { UserHistoryService } from './user-history.service';
|
||||||
import { PubSubService } from '../pubsub/pubsub.service';
|
import { PubSubService } from '../pubsub/pubsub.service';
|
||||||
import { UserHistory } from './user-history.model';
|
import { UserHistory } from './user-history.model';
|
||||||
@@ -59,6 +59,7 @@ export class UserHistoryResolver {
|
|||||||
@Args({
|
@Args({
|
||||||
name: 'id',
|
name: 'id',
|
||||||
description: 'ID of User History',
|
description: 'ID of User History',
|
||||||
|
type: () => ID,
|
||||||
})
|
})
|
||||||
id: string,
|
id: string,
|
||||||
): Promise<UserHistory> {
|
): Promise<UserHistory> {
|
||||||
@@ -77,6 +78,7 @@ export class UserHistoryResolver {
|
|||||||
@Args({
|
@Args({
|
||||||
name: 'id',
|
name: 'id',
|
||||||
description: 'ID of User History',
|
description: 'ID of User History',
|
||||||
|
type: () => ID,
|
||||||
})
|
})
|
||||||
id: string,
|
id: string,
|
||||||
): Promise<UserHistory> {
|
): Promise<UserHistory> {
|
||||||
|
|||||||
@@ -10,13 +10,6 @@ export class GetUserRequestArgs extends PaginationArgs {
|
|||||||
description: 'Collection ID of the user request',
|
description: 'Collection ID of the user request',
|
||||||
})
|
})
|
||||||
collectionID?: string;
|
collectionID?: string;
|
||||||
|
|
||||||
@Field({
|
|
||||||
nullable: true,
|
|
||||||
defaultValue: undefined,
|
|
||||||
description: 'Title of the user request',
|
|
||||||
})
|
|
||||||
title?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ArgsType()
|
@ArgsType()
|
||||||
@@ -46,13 +39,15 @@ export class MoveUserRequestArgs {
|
|||||||
|
|
||||||
@ArgsType()
|
@ArgsType()
|
||||||
export class CreateUserRequestArgs {
|
export class CreateUserRequestArgs {
|
||||||
@Field({ nullable: false, description: 'Collection ID of the user request' })
|
@Field(() => ID, {
|
||||||
|
description: 'Collection ID of the user request',
|
||||||
|
})
|
||||||
collectionID: string;
|
collectionID: string;
|
||||||
|
|
||||||
@Field({ nullable: false, description: 'Title of the user request' })
|
@Field({ description: 'Title of the user request' })
|
||||||
title: string;
|
title: string;
|
||||||
|
|
||||||
@Field({ nullable: false, description: 'content/body of the user request' })
|
@Field({ description: 'content/body of the user request' })
|
||||||
request: string;
|
request: string;
|
||||||
|
|
||||||
type: ReqType;
|
type: ReqType;
|
||||||
|
|||||||
Reference in New Issue
Block a user