99designs / 99designs/gqlgen

GraphQL Multiple Fields Query

Open
#3,204 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
10.8k
Forks
1.3k
Avg merge
2d 36m
Merged PRs (30d)
26

Description

When I use a multiple fields query in GraphQL, if all the fields return success, the result from gqlgen in the resolver will return a JSON starting from data like this:

```
{
"data": {
"queryTaskConfig": {
"isTaskConfigExist": true
},
"isTaskExisted": {
"isTaskExist": true
},
"isScheduleExisted": {
"isScheduleExist": false
}
}
}
```
In the case where isScheduleExisted encounters an error, I expect only the error result of isScheduleExist because the other two elements are still functioning normally. However, the error result returned is as follows:

```
{
"errors": [
{
"message": "Connection to data source failed",
"locations": [{ "line": 7, "column": 3 }],
"path": ["isScheduleExisted"]
}
]
}
```

This is quite frustrating when implementing GraphQL Federation because an issue in the Schedule Service should not affect the Task Service or Task Config Service. So, could you please provide an explanation for this?

### versions
- `go run github.com/99designs/gqlgen v0.17.49`?
- `go version`22

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.