the build was successful
gqlgen Squashed commit of the following: commit162ccf6bfbAuthor: Gisle Aune <dev@gisle.me> Date: Fri May 17 11:51:23 2019 +0200 The great module madness continus, now with pointers. commit7e3dc49635Author: Gisle Aune <dev@gisle.me> Date: Thu May 16 15:57:08 2019 +0200 Basic stuff, doesn't compile
23 lines
404 B
Go
23 lines
404 B
Go
package types
|
|
|
|
import (
|
|
"context"
|
|
|
|
"git.aiterp.net/rpdata/api/models"
|
|
"git.aiterp.net/rpdata/api/models/users"
|
|
)
|
|
|
|
type tokenResolver struct{}
|
|
|
|
func (r *tokenResolver) User(ctx context.Context, token *models.Token) (*models.User, error) {
|
|
user, err := users.Find(token.UserID)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &user, nil
|
|
}
|
|
|
|
// TokenResolver is a resolver
|
|
var TokenResolver tokenResolver
|