package queries import ( "context" "errors" "git.aiterp.net/rpdata/api/internal/auth" "git.aiterp.net/rpdata/api/models" ) func (r *resolver) Token(ctx context.Context) (models.Token, error) { token := auth.TokenFromContext(ctx) if !token.Authenticated() { return models.Token{}, errors.New("No (valid) token") } return *token, nil }