package resolvers import ( "context" "errors" "git.aiterp.net/rpdata/api/models" ) func (r *queryResolver) Token(ctx context.Context) (*models.Token, error) { token := r.s.Auth.TokenFromContext(ctx) if !token.Authenticated() { return nil, errors.New("no (valid) token") } return token, nil }