-
Notifications
You must be signed in to change notification settings - Fork 1
/
ent.resolvers.go
46 lines (36 loc) · 1.86 KB
/
ent.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
package graphql
// 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
import (
"context"
"fmt"
"entgo.io/contrib/entgql"
"github.com/woocoos/workflow/api/graphql/generated"
"github.com/woocoos/workflow/ent"
)
// Node is the resolver for the node field.
func (r *queryResolver) Node(ctx context.Context, id string) (ent.Noder, error) {
return r.client.NoderEx(ctx, id)
}
// Nodes is the resolver for the nodes field.
func (r *queryResolver) Nodes(ctx context.Context, ids []string) ([]ent.Noder, error) {
return r.client.NodersEx(ctx, ids)
}
// Deployments is the resolver for the deployments field.
func (r *queryResolver) Deployments(ctx context.Context) ([]*ent.Deployment, error) {
panic(fmt.Errorf("not implemented: Deployments - deployments"))
}
// ProcInsts is the resolver for the procInsts field.
func (r *queryResolver) ProcInsts(ctx context.Context, after *entgql.Cursor[int], first *int, before *entgql.Cursor[int], last *int, orderBy *ent.ProcInstOrder, where *ent.ProcInstWhereInput) (*ent.ProcInstConnection, error) {
return r.client.ProcInst.Query().Paginate(ctx, after, first, before, last,
ent.WithProcInstOrder(orderBy),
ent.WithProcInstFilter(where.Filter))
}
// Tasks is the resolver for the tasks field.
func (r *queryResolver) Tasks(ctx context.Context, after *entgql.Cursor[int], first *int, before *entgql.Cursor[int], last *int, where *ent.TaskWhereInput) (*ent.TaskConnection, error) {
return r.client.Task.Query().Paginate(ctx, after, first, before, last, ent.WithTaskFilter(where.Filter))
}
// Query returns generated.QueryResolver implementation.
func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} }
type queryResolver struct{ *Resolver }