GraphQL Multiple Fields Query
- 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
Assessment
This issue has not been assessed yet.