42 lines
1.4 KiB
Go
42 lines
1.4 KiB
Go
package graph
|
|
|
|
// This file will be automatically regenerated based on the schema, any resolver implementations
|
|
// will be copied through when generating and any unknown code will be moved to the end.
|
|
|
|
import (
|
|
"context"
|
|
"strconv"
|
|
|
|
"forge.cadoles.com/Cadoles/daddy/internal/graph/generated"
|
|
model1 "forge.cadoles.com/Cadoles/daddy/internal/model"
|
|
)
|
|
|
|
func (r *queryResolver) UserProfile(ctx context.Context) (*model1.User, error) {
|
|
return handleUserProfile(ctx)
|
|
}
|
|
|
|
func (r *queryResolver) Workgroups(ctx context.Context, filter *model1.WorkgroupsFilter) ([]*model1.Workgroup, error) {
|
|
return handleWorkgroups(ctx, filter)
|
|
}
|
|
|
|
func (r *userResolver) ID(ctx context.Context, obj *model1.User) (string, error) {
|
|
return strconv.FormatUint(uint64(obj.ID), 10), nil
|
|
}
|
|
|
|
func (r *workgroupResolver) ID(ctx context.Context, obj *model1.Workgroup) (string, error) {
|
|
return strconv.FormatUint(uint64(obj.ID), 10), nil
|
|
}
|
|
|
|
// Query returns generated.QueryResolver implementation.
|
|
func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} }
|
|
|
|
// User returns generated.UserResolver implementation.
|
|
func (r *Resolver) User() generated.UserResolver { return &userResolver{r} }
|
|
|
|
// Workgroup returns generated.WorkgroupResolver implementation.
|
|
func (r *Resolver) Workgroup() generated.WorkgroupResolver { return &workgroupResolver{r} }
|
|
|
|
type queryResolver struct{ *Resolver }
|
|
type userResolver struct{ *Resolver }
|
|
type workgroupResolver struct{ *Resolver }
|