/
gql_mutation_input.go
55 lines (47 loc) · 1.39 KB
/
gql_mutation_input.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
// Code generated by ent, DO NOT EDIT.
package generated
// CreateTodoInput represents a mutation input for creating todos.
type CreateTodoInput struct {
Name string
Description *string
}
// Mutate applies the CreateTodoInput on the TodoMutation builder.
func (i *CreateTodoInput) Mutate(m *TodoMutation) {
m.SetName(i.Name)
if v := i.Description; v != nil {
m.SetDescription(*v)
}
}
// SetInput applies the change-set in the CreateTodoInput on the TodoCreate builder.
func (c *TodoCreate) SetInput(i CreateTodoInput) *TodoCreate {
i.Mutate(c.Mutation())
return c
}
// UpdateTodoInput represents a mutation input for updating todos.
type UpdateTodoInput struct {
Name *string
ClearDescription bool
Description *string
}
// Mutate applies the UpdateTodoInput on the TodoMutation builder.
func (i *UpdateTodoInput) Mutate(m *TodoMutation) {
if v := i.Name; v != nil {
m.SetName(*v)
}
if i.ClearDescription {
m.ClearDescription()
}
if v := i.Description; v != nil {
m.SetDescription(*v)
}
}
// SetInput applies the change-set in the UpdateTodoInput on the TodoUpdate builder.
func (c *TodoUpdate) SetInput(i UpdateTodoInput) *TodoUpdate {
i.Mutate(c.Mutation())
return c
}
// SetInput applies the change-set in the UpdateTodoInput on the TodoUpdateOne builder.
func (c *TodoUpdateOne) SetInput(i UpdateTodoInput) *TodoUpdateOne {
i.Mutate(c.Mutation())
return c
}