/
mutation.go
36 lines (34 loc) · 936 Bytes
/
mutation.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
package mutation
import (
"github.com/cakazies/go-graphql/application/types"
"github.com/graphql-go/graphql"
)
var UsersMutation = graphql.NewObject(graphql.ObjectConfig{
Name: "UsersMutation",
Fields: graphql.Fields{
"CreateUser": &graphql.Field{
Type: graphql.NewList(types.UsersTypes),
Args: graphql.FieldConfigArgument{
"id": &graphql.ArgumentConfig{
Type: graphql.NewNonNull(graphql.Int),
},
"name": &graphql.ArgumentConfig{
Type: graphql.NewNonNull(graphql.String),
},
"age": &graphql.ArgumentConfig{
Type: graphql.NewNonNull(graphql.Int),
},
"profession": &graphql.ArgumentConfig{
Type: graphql.NewNonNull(graphql.String),
},
"friendly": &graphql.ArgumentConfig{
Type: graphql.NewNonNull(graphql.String),
},
"deleted_at": &graphql.ArgumentConfig{
Type: graphql.NewNonNull(graphql.String),
},
},
Resolve: UsersRevolver,
},
},
})