graphql
graphql copied to clipboard
params.Args of the nested element is empty
What am I trying to do:
var mutationKittensType = graphql.NewObject(
graphql.ObjectConfig{
Name: "kittens",
Fields: graphql.Fields{
"littleName": &graphql.Field{
Type: graphql.String,
},
"age": &graphql.Field{
Type: graphql.Float,
},
},
},
)
var mutationPropertiesType = graphql.NewObject(
graphql.ObjectConfig{
Name: "properties",
Fields: graphql.Fields{
"name": &graphql.Field{
Type: graphql.String,
},
"kittens": &graphql.Field{
Type: mutationKittensType,
},
},
},
)
var mutationType = graphql.NewObject(
graphql.ObjectConfig{
Name: "create_cat",
Fields: graphql.Fields{
"type": &graphql.Field{
Type: graphql.String,
},
"properties": &graphql.Field{
Type: mutationPropertiesType,
},
Resolve: func(params graphql.ResolveParams) (interface{}, error) {
log.Println("params.Args ", params.Args)`
For example, this curl:
curl -XPOST http://localhost/graphql -H 'Content-Type: application/graphql' -d'mutation{create_cat(type:"persian", properties:{name: "alice", kittens:{littleName: "little alice", age: 1}}){type, properties{name, kittens:{littleName, age}}}}'
I got this:
params.Args map[ ]
Why is my params.Args empty and how to fix it?
I have the same issue
I have the same issue too, but my args is a list and I got a list with nil values
addRule(
name: "test",
rule:"Meta[\"environment\"] in [\"dev\", \"test\"]",
triggers: [{
pre_condition: "a == b",
action:"http",
meta:"hello, world"
}, {
pre_condition: "a == b",
action:"http",
meta:"hello, world"
}, {
pre_condition: "a == b",
action:"http",
meta:"hello, world"
}]
) {
name
description
rule
}
when I print triggers
[<nil> <nil> <nil>]
has someone find a solution ?