graphql-go / graphql-go/graphql

Resolver is not extracting nested structs

Open
#610 11 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
10.1k
Forks
845
PR merge metrics
No merged PRs in 30d

Description

I'm using last version of graphql v0.7.9

I have query "users" which should return a list of users:

![image](https://user-images.githubusercontent.com/22654219/129334764-222ace0a-1bc3-4b93-9a64-767aa863f5a3.png)

QueryType:
![image](https://user-images.githubusercontent.com/22654219/129334834-3da586b2-c10d-4966-afa5-78221352e8c5.png)

structs:
![image](https://user-images.githubusercontent.com/22654219/129334885-c75513c3-bd34-44d2-9b74-abd6d46198bb.png)

pgsql is *sqlx.DB

As you can see I'm using nested struct UserInput for UserType. Actually sqlx is binding values to it correctly and when I'm calling fmt.Println(user[0].First_name) it works good, but for graphql - not!

![image](https://user-images.githubusercontent.com/22654219/129335154-bc6737af-cfc9-414b-97d7-4655ee9cbda8.png)

When I'm not using nested structs - it works good.
Seems like a bug.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.