mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-21 09:09:01 +00:00
17 lines
357 B
TypeScript
17 lines
357 B
TypeScript
import UserContext from "../../../data/UserContext.js";
|
|
|
|
/** @gqlType User */
|
|
export default class UserResolver {
|
|
/** @gqlField */
|
|
username(ctx: UserContext): string | null {
|
|
return ctx.username;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* The currently authenticated user, if any.
|
|
* @gqlQueryField
|
|
*/
|
|
export function me(): UserResolver | null {
|
|
return new UserResolver();
|
|
}
|