-
Notifications
You must be signed in to change notification settings - Fork 12
/
workspace.resolvers.go
45 lines (38 loc) · 1.88 KB
/
workspace.resolvers.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package resolver
// 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.
// Code generated by github.com/99designs/gqlgen version v0.17.46
import (
"context"
"github.com/99designs/gqlgen/graphql"
"github.com/openline-ai/openline-customer-os/packages/server/customer-os-api/graph/model"
"github.com/openline-ai/openline-customer-os/packages/server/customer-os-api/mapper"
"github.com/openline-ai/openline-customer-os/packages/server/customer-os-api/tracing"
"github.com/openline-ai/openline-customer-os/packages/server/customer-os-common-module/common"
)
// WorkspaceMergeToTenant is the resolver for the workspace_MergeToTenant field.
func (r *mutationResolver) WorkspaceMergeToTenant(ctx context.Context, workspace model.WorkspaceInput, tenant string) (*model.Result, error) {
ctx, span := tracing.StartGraphQLTracerSpan(ctx, "MutationResolver.WorkspaceMergeToTenant", graphql.GetOperationContext(ctx))
defer span.Finish()
tracing.SetDefaultResolverSpanTags(ctx, span)
result, err := r.Services.WorkspaceService.MergeToTenant(ctx, mapper.MapWorkspaceInputToEntity(workspace), tenant)
if err != nil {
return nil, err
}
return &model.Result{
Result: result,
}, nil
}
// WorkspaceMerge is the resolver for the workspace_Merge field.
func (r *mutationResolver) WorkspaceMerge(ctx context.Context, workspace model.WorkspaceInput) (*model.Result, error) {
ctx, span := tracing.StartGraphQLTracerSpan(ctx, "MutationResolver.WorkspaceMerge", graphql.GetOperationContext(ctx))
defer span.Finish()
tracing.SetDefaultResolverSpanTags(ctx, span)
result, err := r.Services.WorkspaceService.MergeToTenant(ctx, mapper.MapWorkspaceInputToEntity(workspace), common.GetContext(ctx).Tenant)
if err != nil {
return nil, err
}
return &model.Result{
Result: result,
}, nil
}