add context subscription
This commit is contained in:
@@ -127,10 +127,13 @@ export class UserSchema extends PothosSchema {
|
||||
},
|
||||
}),
|
||||
me: t.prismaField({
|
||||
description: 'Retrieve the current user by token.',
|
||||
description: 'Retrieve the current user in context.',
|
||||
type: this.user(),
|
||||
resolve: async (query, root, args, ctx) => {
|
||||
return ctx.me;
|
||||
if (ctx.isSubscription) {
|
||||
throw new Error('Not allowed');
|
||||
}
|
||||
return ctx.http.me;
|
||||
},
|
||||
}),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user