mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-22 09:37:17 +00:00
18 lines
383 B
TypeScript
18 lines
383 B
TypeScript
import { Ctx } from "..";
|
|
import { Query } from "./QueryResolver";
|
|
|
|
/** @gqlType User */
|
|
export default class UserResolver {
|
|
/** @gqlField */
|
|
username(_args: unknown, { ctx }: Ctx): string | null {
|
|
return ctx.username;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* The currently authenticated user, if any.
|
|
* @gqlField
|
|
*/
|
|
export function me(_: Query): UserResolver | null {
|
|
return new UserResolver();
|
|
}
|