This repository has been archived by the owner on Apr 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.resolvers.go
613 lines (522 loc) · 21.9 KB
/
schema.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
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.
// Code generated by github.com/99designs/gqlgen version v0.17.40
import (
"context"
"fmt"
"time"
"entgo.io/ent/dialect/sql"
"github.com/cble-platform/cble-backend/auth"
"github.com/cble-platform/cble-backend/ent"
"github.com/cble-platform/cble-backend/ent/deployment"
"github.com/cble-platform/cble-backend/ent/providercommand"
"github.com/cble-platform/cble-backend/ent/user"
"github.com/cble-platform/cble-backend/graph/generated"
"github.com/cble-platform/cble-backend/graph/model"
"github.com/google/uuid"
"github.com/vektah/gqlparser/v2/gqlerror"
)
// BlueprintTemplate is the resolver for the blueprintTemplate field.
func (r *blueprintResolver) BlueprintTemplate(ctx context.Context, obj *ent.Blueprint) (string, error) {
return string(obj.BlueprintTemplate), nil
}
// ParentGroup is the resolver for the parentGroup field.
func (r *blueprintResolver) ParentGroup(ctx context.Context, obj *ent.Blueprint) (*ent.Group, error) {
parentGroup, err := obj.QueryParentGroup().Only(ctx)
if ent.IsNotFound(err) {
return nil, nil
}
return parentGroup, err
}
// Provider is the resolver for the Provider field.
func (r *blueprintResolver) Provider(ctx context.Context, obj *ent.Blueprint) (*ent.Provider, error) {
entProvider, err := obj.QueryProvider().Only(ctx)
if ent.IsNotFound(err) {
return nil, nil
}
return entProvider, err
}
// Deployments is the resolver for the deployments field.
func (r *blueprintResolver) Deployments(ctx context.Context, obj *ent.Blueprint) ([]*ent.Deployment, error) {
return obj.QueryDeployments().All(ctx)
}
// Blueprint is the resolver for the blueprint field.
func (r *deploymentResolver) Blueprint(ctx context.Context, obj *ent.Deployment) (*ent.Blueprint, error) {
blueprint, err := obj.QueryBlueprint().Only(ctx)
if ent.IsNotFound(err) {
return nil, nil
}
return blueprint, err
}
// Requester is the resolver for the requester field.
func (r *deploymentResolver) Requester(ctx context.Context, obj *ent.Deployment) (*ent.User, error) {
requester, err := obj.QueryRequester().Only(ctx)
if ent.IsNotFound(err) {
return nil, nil
}
return requester, err
}
// Children is the resolver for the children field.
func (r *groupResolver) Children(ctx context.Context, obj *ent.Group) ([]*ent.Group, error) {
return obj.QueryChildren().All(ctx)
}
// Parent is the resolver for the parent field.
func (r *groupResolver) Parent(ctx context.Context, obj *ent.Group) (*ent.Group, error) {
parent, err := obj.QueryParent().Only(ctx)
if ent.IsNotFound(err) {
return nil, nil
}
return parent, err
}
// Users is the resolver for the users field.
func (r *groupResolver) Users(ctx context.Context, obj *ent.Group) ([]*ent.User, error) {
return obj.QueryUsers().All(ctx)
}
// PermissionPolicies is the resolver for the permissionPolicies field.
func (r *groupResolver) PermissionPolicies(ctx context.Context, obj *ent.Group) ([]*ent.PermissionPolicy, error) {
return obj.QueryPermissionPolicies().All(ctx)
}
// Blueprints is the resolver for the blueprints field.
func (r *groupResolver) Blueprints(ctx context.Context, obj *ent.Group) ([]*ent.Blueprint, error) {
return obj.QueryBlueprints().All(ctx)
}
// SelfChangePassword is the resolver for the selfChangePassword field.
func (r *mutationResolver) SelfChangePassword(ctx context.Context, currentPassword string, newPassword string) (bool, error) {
panic(fmt.Errorf("not implemented: SelfChangePassword - selfChangePassword"))
}
// CreateUser is the resolver for the createUser field.
func (r *mutationResolver) CreateUser(ctx context.Context, input model.UserInput) (*ent.User, error) {
// Convert Group IDs to UUIDS
groupUuids := make([]uuid.UUID, len(input.GroupIds))
for i, gid := range input.GroupIds {
gUuid, err := uuid.Parse(gid)
if err != nil {
return nil, gqlerror.Errorf("group id (%s) is not valid UUID: %v", gid, err)
}
groupUuids[i] = gUuid
}
// Create the user
entUser, err := r.ent.User.Create().
SetEmail(input.Email).
SetFirstName(input.FirstName).
SetLastName(input.LastName).
SetUsername(input.Username).
AddGroupIDs(groupUuids...).
Save(ctx)
if err != nil {
return nil, gqlerror.Errorf("failed to create user: %v", err)
}
return entUser, nil
}
// UpdateUser is the resolver for the updateUser field.
func (r *mutationResolver) UpdateUser(ctx context.Context, id uuid.UUID, input model.UserInput) (*ent.User, error) {
panic(fmt.Errorf("not implemented: UpdateUser - updateUser"))
}
// DeleteUser is the resolver for the deleteUser field.
func (r *mutationResolver) DeleteUser(ctx context.Context, id uuid.UUID) (bool, error) {
panic(fmt.Errorf("not implemented: DeleteUser - deleteUser"))
}
// CreateProvider is the resolver for the createProvider field.
func (r *mutationResolver) CreateProvider(ctx context.Context, input model.ProviderInput) (*ent.Provider, error) {
entProvider, err := r.ent.Provider.Create().
SetDisplayName(input.DisplayName).
SetProviderGitURL(input.ProviderGitURL).
SetProviderVersion(input.ProviderVersion).
SetConfigBytes([]byte(input.ConfigBytes)).
Save(ctx)
if err != nil {
return nil, gqlerror.Errorf("failed to create provider: %v", err)
}
return entProvider, nil
}
// UpdateProvider is the resolver for the updateProvider field.
func (r *mutationResolver) UpdateProvider(ctx context.Context, id uuid.UUID, input model.ProviderInput) (*ent.Provider, error) {
// Update the provider
entProvider, err := r.ent.Provider.UpdateOneID(id).
SetDisplayName(input.DisplayName).
SetProviderGitURL(input.ProviderGitURL).
SetProviderVersion(input.ProviderVersion).
SetConfigBytes([]byte(input.ConfigBytes)).
Save(ctx)
if err != nil {
return nil, gqlerror.Errorf("failed to update provider: %v", err)
}
return entProvider, nil
}
// DeleteProvider is the resolver for the deleteProvider field.
func (r *mutationResolver) DeleteProvider(ctx context.Context, id uuid.UUID) (bool, error) {
// Check if the provider is loaded
entProvider, err := r.ent.Provider.Get(ctx, id)
if err != nil {
return false, gqlerror.Errorf("failed to query provider with ID: %v", err)
}
// Don't allow deleting a loaded provider
if entProvider.IsLoaded {
return false, gqlerror.Errorf("cannot delete a provider while it is loaded")
}
// Delete the provider otherwise
err = r.ent.Provider.DeleteOneID(id).Exec(ctx)
if err != nil {
return false, gqlerror.Errorf("failed to delete provider: %v", err)
}
return true, nil
}
// CreateBlueprint is the resolver for the createBlueprint field.
func (r *mutationResolver) CreateBlueprint(ctx context.Context, input model.BlueprintInput) (*ent.Blueprint, error) {
// Get the edge objects
entParentGroup, err := r.ent.Group.Get(ctx, input.ParentGroupID)
if err != nil {
return nil, gqlerror.Errorf("failed to query parent group by ID: %v", err)
}
entProvider, err := r.ent.Provider.Get(ctx, input.ProviderID)
if err != nil {
return nil, gqlerror.Errorf("failed to query provider by ID: %v", err)
}
entBlueprint, err := r.ent.Blueprint.Create().
SetName(input.Name).
SetDescription(input.Description).
SetBlueprintTemplate([]byte(input.BlueprintTemplate)).
SetParentGroup(entParentGroup).
SetProvider(entProvider).
Save(ctx)
if err != nil {
return nil, gqlerror.Errorf("failed to create blueprint: %v", err)
}
return entBlueprint, nil
}
// UpdateBlueprint is the resolver for the updateBlueprint field.
func (r *mutationResolver) UpdateBlueprint(ctx context.Context, id uuid.UUID, input model.BlueprintInput) (*ent.Blueprint, error) {
// Get the object from ENT
entBlueprint, err := r.ent.Blueprint.Get(ctx, id)
if err != nil {
return nil, gqlerror.Errorf("failed to query blueprint: %v", err)
}
// Get the edge objects
entParentGroup, err := r.ent.Group.Get(ctx, input.ParentGroupID)
if err != nil {
return nil, gqlerror.Errorf("failed to query parent group by ID: %v", err)
}
entProvider, err := r.ent.Provider.Get(ctx, input.ProviderID)
if err != nil {
return nil, gqlerror.Errorf("failed to query provider by ID: %v", err)
}
entBlueprint, err = entBlueprint.Update().
SetName(input.Name).
SetDescription(input.Description).
SetBlueprintTemplate([]byte(input.BlueprintTemplate)).
SetParentGroup(entParentGroup).
SetProvider(entProvider).
Save(ctx)
if err != nil {
return nil, gqlerror.Errorf("failed to update blueprint: %v", err)
}
return entBlueprint, nil
}
// DeleteBlueprint is the resolver for the deleteBlueprint field.
func (r *mutationResolver) DeleteBlueprint(ctx context.Context, id uuid.UUID) (bool, error) {
panic(fmt.Errorf("not implemented: DeleteBlueprint - deleteBlueprint"))
}
// UpdateDeployment is the resolver for the updateDeployment field.
func (r *mutationResolver) UpdateDeployment(ctx context.Context, id uuid.UUID, input model.DeploymentInput) (*ent.Deployment, error) {
return r.ent.Deployment.UpdateOneID(id).SetName(input.Name).Save(ctx)
}
// LoadProvider is the resolver for the loadProvider field.
func (r *mutationResolver) LoadProvider(ctx context.Context, id uuid.UUID) (*ent.Provider, error) {
// Check the provider exists
entProvider, err := r.ent.Provider.Get(ctx, id)
if err != nil {
return nil, gqlerror.Errorf("could not find provider with id %s", id)
}
// Queue the provider to load
r.cbleServer.QueueLoadProvider(id.String())
return entProvider, nil
}
// UnloadProvider is the resolver for the unloadProvider field.
func (r *mutationResolver) UnloadProvider(ctx context.Context, id uuid.UUID) (*ent.Provider, error) {
// Check the provider exists
entProvider, err := r.ent.Provider.Get(ctx, id)
if err != nil {
return nil, gqlerror.Errorf("could not find provider with id %s", id)
}
// Queue the provider to unload
err = r.cbleServer.QueueUnloadProvider(id.String())
if err != nil {
return entProvider, fmt.Errorf("failed to unload provider: %v", err)
}
return entProvider, nil
}
// ConfigureProvider is the resolver for the configureProvider field.
func (r *mutationResolver) ConfigureProvider(ctx context.Context, id uuid.UUID) (*ent.Provider, error) {
// Convert ID string to UUID
entProvider, err := r.ent.Provider.Get(ctx, id)
if err != nil {
return nil, gqlerror.Errorf("could not find provider with id %s: %v", id, err)
}
// Queue a configure command for provider configuration
err = r.ent.ProviderCommand.Create().
SetCommandType(providercommand.CommandTypeCONFIGURE).
SetProvider(entProvider).
Exec(ctx)
if err != nil {
return nil, gqlerror.Errorf("failed to create initial provider CONFIGURE command: %v", err)
}
return entProvider, nil
}
// DeployBlueprint is the resolver for the deployBlueprint field.
func (r *mutationResolver) DeployBlueprint(ctx context.Context, id uuid.UUID) (*ent.Deployment, error) {
// Check the blueprint exists
entBlueprint, err := r.ent.Blueprint.Get(ctx, id)
if err != nil {
return nil, gqlerror.Errorf("could not find blueprint with id %s", id)
}
entProvider, err := entBlueprint.QueryProvider().Only(ctx)
if err != nil {
return nil, gqlerror.Errorf("failed to query provider from blueprint: %v", err)
}
entUser, err := auth.ForContext(ctx)
if err != nil {
return nil, gqlerror.Errorf("failed to get user from context: %v", err)
}
// Create the deployment
entDeployment, err := r.ent.Deployment.Create().
SetName(entBlueprint.Name).
SetBlueprint(entBlueprint).
SetRequester(entUser).
Save(ctx)
if err != nil {
return nil, gqlerror.Errorf("failed to create deployment from blueprint: %v", err)
}
// Queue a deployment command for blueprint
err = r.ent.ProviderCommand.Create().
SetCommandType(providercommand.CommandTypeDEPLOY).
SetProvider(entProvider).
SetDeployment(entDeployment).
Exec(ctx)
if err != nil {
return nil, gqlerror.Errorf("failed to create deployment DEPLOY command: %v", err)
}
return entDeployment, nil
}
// DestroyDeployment is the resolver for the destroyDeployment field.
func (r *mutationResolver) DestroyDeployment(ctx context.Context, id uuid.UUID) (*ent.Deployment, error) {
// Get the deployment
entDeployment, err := r.ent.Deployment.Get(ctx, id)
if err != nil {
return nil, gqlerror.Errorf("failed to create deployment from blueprint: %v", err)
}
entProvider, err := entDeployment.QueryBlueprint().QueryProvider().Only(ctx)
if err != nil {
return nil, gqlerror.Errorf("failed to query provider from deployment: %v", err)
}
// Queue a destroy command for blueprint
err = r.ent.ProviderCommand.Create().
SetCommandType(providercommand.CommandTypeDESTROY).
SetProvider(entProvider).
SetDeployment(entDeployment).
Exec(ctx)
if err != nil {
return nil, gqlerror.Errorf("failed to create deployment DESTROY command: %v", err)
}
return entDeployment, nil
}
// GetConsole is the resolver for the getConsole field.
func (r *mutationResolver) GetConsole(ctx context.Context, id uuid.UUID, hostKey string) (string, error) {
// Get the deployment
entDeployment, err := r.ent.Deployment.Get(ctx, id)
if err != nil {
return "", gqlerror.Errorf("failed to create deployment from blueprint: %v", err)
}
entProvider, err := entDeployment.QueryBlueprint().QueryProvider().Only(ctx)
if err != nil {
return "", gqlerror.Errorf("failed to query provider from deployment: %v", err)
}
// Queue a destroy command for blueprint
entCommand, err := r.ent.ProviderCommand.Create().
SetCommandType(providercommand.CommandTypeCONSOLE).
SetArguments([]string{hostKey}).
SetProvider(entProvider).
SetDeployment(entDeployment).
Save(ctx)
if err != nil {
return "", gqlerror.Errorf("failed to create deployment CONSOLE command: %v", err)
}
// Wait for the command to finish
// TODO: potentially make this command synchronous somehow
for {
entCommand, err = r.ent.ProviderCommand.Get(ctx, entCommand.ID)
if err != nil {
return "", fmt.Errorf("failed to query ent command")
}
if entCommand.Status == providercommand.StatusSUCCEEDED {
return entCommand.Output, nil
}
if entCommand.Status == providercommand.StatusFAILED {
return "", fmt.Errorf(entCommand.Error)
}
// Sleep before checking again
time.Sleep(1 * time.Second)
}
}
// PermissionPolicies is the resolver for the permissionPolicies field.
func (r *permissionResolver) PermissionPolicies(ctx context.Context, obj *ent.Permission) ([]*ent.PermissionPolicy, error) {
return obj.QueryPermissionPolicies().All(ctx)
}
// Type is the resolver for the type field.
func (r *permissionPolicyResolver) Type(ctx context.Context, obj *ent.PermissionPolicy) (model.PermissionPolicyType, error) {
return model.PermissionPolicyType(obj.Type), nil
}
// Permission is the resolver for the permission field.
func (r *permissionPolicyResolver) Permission(ctx context.Context, obj *ent.PermissionPolicy) (*ent.Permission, error) {
permission, err := obj.QueryPermission().Only(ctx)
if ent.IsNotFound(err) {
return nil, nil
}
return permission, err
}
// Group is the resolver for the group field.
func (r *permissionPolicyResolver) Group(ctx context.Context, obj *ent.PermissionPolicy) (*ent.Group, error) {
group, err := obj.QueryGroup().Only(ctx)
if ent.IsNotFound(err) {
return nil, nil
}
return group, err
}
// ConfigBytes is the resolver for the configBytes field.
func (r *providerResolver) ConfigBytes(ctx context.Context, obj *ent.Provider) (string, error) {
return string(obj.ConfigBytes), nil
}
// Blueprints is the resolver for the blueprints field.
func (r *providerResolver) Blueprints(ctx context.Context, obj *ent.Provider) ([]*ent.Blueprint, error) {
return obj.QueryBlueprints().All(ctx)
}
// CommandType is the resolver for the commandType field.
func (r *providerCommandResolver) CommandType(ctx context.Context, obj *ent.ProviderCommand) (model.CommandType, error) {
return model.CommandType(obj.CommandType), nil
}
// Status is the resolver for the status field.
func (r *providerCommandResolver) Status(ctx context.Context, obj *ent.ProviderCommand) (model.CommandStatus, error) {
return model.CommandStatus(obj.Status), nil
}
// Me is the resolver for the me field.
func (r *queryResolver) Me(ctx context.Context) (*ent.User, error) {
return auth.ForContext(ctx)
}
// MeHasPermission is the resolver for the meHasPermission field.
func (r *queryResolver) MeHasPermission(ctx context.Context, key string) (bool, error) {
currentUser, err := auth.ForContext(ctx)
if err != nil {
return false, gqlerror.Errorf("failed to get user from context: %v", err)
}
return r.permissionEngine.RequestPermission(ctx, currentUser, key)
}
// Users is the resolver for the users field.
func (r *queryResolver) Users(ctx context.Context) ([]*ent.User, error) {
return r.ent.User.Query().All(ctx)
}
// User is the resolver for the user field.
func (r *queryResolver) User(ctx context.Context, id uuid.UUID) (*ent.User, error) {
return r.ent.User.Get(ctx, id)
}
// Groups is the resolver for the groups field.
func (r *queryResolver) Groups(ctx context.Context) ([]*ent.Group, error) {
return r.ent.Group.Query().All(ctx)
}
// Group is the resolver for the group field.
func (r *queryResolver) Group(ctx context.Context, id uuid.UUID) (*ent.Group, error) {
return r.ent.Group.Get(ctx, id)
}
// Providers is the resolver for the Providers field.
func (r *queryResolver) Providers(ctx context.Context) ([]*ent.Provider, error) {
return r.ent.Provider.Query().All(ctx)
}
// Provider is the resolver for the Provider field.
func (r *queryResolver) Provider(ctx context.Context, id uuid.UUID) (*ent.Provider, error) {
return r.ent.Provider.Get(ctx, id)
}
// ProviderCommands is the resolver for the providerCommands field.
func (r *queryResolver) ProviderCommands(ctx context.Context) ([]*ent.ProviderCommand, error) {
return r.ent.ProviderCommand.Query().Order(providercommand.ByStartTime(sql.OrderDesc())).All(ctx)
}
// ProviderCommand is the resolver for the providerCommand field.
func (r *queryResolver) ProviderCommand(ctx context.Context, id uuid.UUID) (*ent.ProviderCommand, error) {
return r.ent.ProviderCommand.Get(ctx, id)
}
// Blueprints is the resolver for the blueprints field.
func (r *queryResolver) Blueprints(ctx context.Context) ([]*ent.Blueprint, error) {
return r.ent.Blueprint.Query().All(ctx)
}
// Blueprint is the resolver for the blueprint field.
func (r *queryResolver) Blueprint(ctx context.Context, id uuid.UUID) (*ent.Blueprint, error) {
return r.ent.Blueprint.Get(ctx, id)
}
// Deployments is the resolver for the deployments field.
func (r *queryResolver) Deployments(ctx context.Context) ([]*ent.Deployment, error) {
currentUser, err := auth.ForContext(ctx)
if err != nil {
return nil, gqlerror.Errorf("failed to get user from context: %v", err)
}
return r.ent.Deployment.Query().Where(deployment.HasRequesterWith(user.IDEQ(currentUser.ID))).All(ctx)
}
// Deployment is the resolver for the deployment field.
func (r *queryResolver) Deployment(ctx context.Context, id uuid.UUID) (*ent.Deployment, error) {
currentUser, err := auth.ForContext(ctx)
if err != nil {
return nil, gqlerror.Errorf("failed to get user from context: %v", err)
}
return r.ent.Deployment.Query().Where(deployment.And(
deployment.HasRequesterWith(user.IDEQ(currentUser.ID)),
deployment.IDEQ(id),
)).Only(ctx)
}
// Groups is the resolver for the groups field.
func (r *userResolver) Groups(ctx context.Context, obj *ent.User) ([]*ent.Group, error) {
return obj.QueryGroups().All(ctx)
}
// Deployments is the resolver for the deployments field.
func (r *userResolver) Deployments(ctx context.Context, obj *ent.User) ([]*ent.Deployment, error) {
return obj.QueryDeployments().All(ctx)
}
// Blueprint returns generated.BlueprintResolver implementation.
func (r *Resolver) Blueprint() generated.BlueprintResolver { return &blueprintResolver{r} }
// Deployment returns generated.DeploymentResolver implementation.
func (r *Resolver) Deployment() generated.DeploymentResolver { return &deploymentResolver{r} }
// Group returns generated.GroupResolver implementation.
func (r *Resolver) Group() generated.GroupResolver { return &groupResolver{r} }
// Mutation returns generated.MutationResolver implementation.
func (r *Resolver) Mutation() generated.MutationResolver { return &mutationResolver{r} }
// Permission returns generated.PermissionResolver implementation.
func (r *Resolver) Permission() generated.PermissionResolver { return &permissionResolver{r} }
// PermissionPolicy returns generated.PermissionPolicyResolver implementation.
func (r *Resolver) PermissionPolicy() generated.PermissionPolicyResolver {
return &permissionPolicyResolver{r}
}
// Provider returns generated.ProviderResolver implementation.
func (r *Resolver) Provider() generated.ProviderResolver { return &providerResolver{r} }
// ProviderCommand returns generated.ProviderCommandResolver implementation.
func (r *Resolver) ProviderCommand() generated.ProviderCommandResolver {
return &providerCommandResolver{r}
}
// 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} }
type blueprintResolver struct{ *Resolver }
type deploymentResolver struct{ *Resolver }
type groupResolver struct{ *Resolver }
type mutationResolver struct{ *Resolver }
type permissionResolver struct{ *Resolver }
type permissionPolicyResolver struct{ *Resolver }
type providerResolver struct{ *Resolver }
type providerCommandResolver struct{ *Resolver }
type queryResolver struct{ *Resolver }
type userResolver struct{ *Resolver }
// !!! WARNING !!!
// The code below was going to be deleted when updating resolvers. It has been copied here so you have
// one last chance to move it out of harms way if you want. There are two reasons this happens:
// - When renaming or deleting a resolver the old code will be put in here. You can safely delete
// it when you're done.
// - You have helper methods in this file. Move them out to keep these resolver files clean.
func (r *queryResolver) GetConsole(ctx context.Context, id uuid.UUID, hostKey string) (*ent.Deployment, error) {
panic(fmt.Errorf("not implemented: GetConsole - getConsole"))
}