From c42b6e2fdb91130b99d3c2d7640622160e428d7a Mon Sep 17 00:00:00 2001 From: Mir Arif Hasan Date: Thu, 22 Dec 2022 12:46:03 +0600 Subject: [PATCH] feat: added fields for user-session of rest and gql --- packages/hoppscotch-backend/prisma/schema.prisma | 10 ++++++---- packages/hoppscotch-backend/src/user/user.model.ts | 12 ++++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/packages/hoppscotch-backend/prisma/schema.prisma b/packages/hoppscotch-backend/prisma/schema.prisma index 947d158a8..7d88dbcf2 100644 --- a/packages/hoppscotch-backend/prisma/schema.prisma +++ b/packages/hoppscotch-backend/prisma/schema.prisma @@ -79,10 +79,12 @@ model TeamEnvironment { } model User { - uid String @id @default(cuid()) - displayName String? - email String? - photoURL String? + uid String @id @default(cuid()) + displayName String? + email String? + photoURL String? + currentRESTSession String? + currentGQLSession String? } enum TeamMemberRole { diff --git a/packages/hoppscotch-backend/src/user/user.model.ts b/packages/hoppscotch-backend/src/user/user.model.ts index 779dbc4db..e2f2eb4a4 100644 --- a/packages/hoppscotch-backend/src/user/user.model.ts +++ b/packages/hoppscotch-backend/src/user/user.model.ts @@ -24,4 +24,16 @@ export class User { description: 'URL to the profile photo of the user (if given)', }) photoURL?: string; + + @Field({ + nullable: true, + description: 'JSON string of current REST session for logged-in User', + }) + currentRESTSession?: string; + + @Field({ + nullable: true, + description: 'JSON string of current GraphQL session for logged-in User', + }) + currentGQLSession?: string; }