feat: user session resolver added for sessions updates

This commit is contained in:
Mir Arif Hasan
2023-01-24 17:19:24 +06:00
parent e6fcb1272a
commit 08ca57cba2
4 changed files with 115 additions and 107 deletions

View File

@@ -1,4 +1,10 @@
import { ObjectType, ID, Field, InputType } from '@nestjs/graphql';
import {
ObjectType,
ID,
Field,
InputType,
registerEnumType,
} from '@nestjs/graphql';
@ObjectType()
export class User {
@@ -38,33 +44,11 @@ export class User {
currentGQLSession?: string;
}
@InputType()
export class UpdateUserInput {
@Field({
nullable: true,
name: 'displayName',
description: 'Displayed name of the user (if given)',
})
displayName?: string;
@Field({
nullable: true,
name: 'photoURL',
description: 'URL to the profile photo of the user (if given)',
})
photoURL?: string;
@Field({
nullable: true,
name: 'currentRESTSession',
description: 'JSON string of the saved REST session',
})
currentRESTSession?: string;
@Field({
nullable: true,
name: 'currentGQLSession',
description: 'JSON string of the saved GQL session',
})
currentGQLSession?: string;
export enum SessionType {
REST = 'REST',
GQL = 'GQL',
}
registerEnumType(SessionType, {
name: 'SessionType',
});