William Petit
676ddf3bc8
Types: type Workgroup { id: ID! name: String createdAt: Time! closedAt: Time members: [User]! } Mutations: joinWorkgroup(workgroupId: ID!): Workgroup! leaveWorkgroup(workgroupId: ID!): Workgroup! createWorkgroup(changes: WorkgroupChanges!): Workgroup! closeWorkgroup(workgroupId: ID!): Workgroup! updateWorkgroup(workgroupId: ID!, changes: WorkgroupChanges!): Workgroup! Queries: workgroups: [Workgroup]!
41 lines
1.5 KiB
Go
41 lines
1.5 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"
|
|
|
|
"forge.cadoles.com/Cadoles/daddy/internal/graph/generated"
|
|
"forge.cadoles.com/Cadoles/daddy/internal/model"
|
|
)
|
|
|
|
func (r *mutationResolver) UpdateProfile(ctx context.Context, changes model.ProfileChanges) (*model.User, error) {
|
|
return handleUpdateUserProfile(ctx, changes)
|
|
}
|
|
|
|
func (r *mutationResolver) JoinWorkgroup(ctx context.Context, workgroupID string) (*model.Workgroup, error) {
|
|
return handleJoinWorkgroup(ctx, workgroupID)
|
|
}
|
|
|
|
func (r *mutationResolver) LeaveWorkgroup(ctx context.Context, workgroupID string) (*model.Workgroup, error) {
|
|
return handleLeaveWorkgroup(ctx, workgroupID)
|
|
}
|
|
|
|
func (r *mutationResolver) CreateWorkgroup(ctx context.Context, changes model.WorkgroupChanges) (*model.Workgroup, error) {
|
|
return handleCreateWorkgroup(ctx, changes)
|
|
}
|
|
|
|
func (r *mutationResolver) CloseWorkgroup(ctx context.Context, workgroupID string) (*model.Workgroup, error) {
|
|
return handleCloseWorkgroup(ctx, workgroupID)
|
|
}
|
|
|
|
func (r *mutationResolver) UpdateWorkgroup(ctx context.Context, workgroupID string, changes model.WorkgroupChanges) (*model.Workgroup, error) {
|
|
return handleUpdateWorkgroup(ctx, workgroupID, changes)
|
|
}
|
|
|
|
// Mutation returns generated.MutationResolver implementation.
|
|
func (r *Resolver) Mutation() generated.MutationResolver { return &mutationResolver{r} }
|
|
|
|
type mutationResolver struct{ *Resolver }
|