graphql-go / graphql-go/graphql
how to query sub field without Resolve
- Dominant language
- Go
- Stars
- 10.1k
- Forks
- 845
- PR merge metrics
- No merged PRs in 30d
Description
this is my code:
```go
var MeType = graphql.NewObject(graphql.ObjectConfig{
Name: "me",
Fields: graphql.Fields{
"referral": &graphql.Field{
Type: ReferralType,
Resolve: func(p graphql.ResolveParams) (interface{}, error) {
return proxy.GetMeReferralById(p.Context)
},
},
},
})
var FIELD_API_V3_ME = graphql.Field{
Type: MeType,
}
var ReferralType = graphql.NewObject(graphql.ObjectConfig{
Name: "referral",
Fields: graphql.Fields{
"user_id": &graphql.Field{
Type: igraphql.Int64,
},
"invite_by_user_id": &graphql.Field{
Type: igraphql.Int64,
},
},
})
```
the `me` has no Resolve, the `referral` has Resolve.
when i query with
```
{
me{
referral{
user_id
}
}
}
```
i got:
```
{
"data": {
"me": null,
}
}
```
and the referral Resolve func not run
Contributor guide
Assessment
This issue has not been assessed yet.