Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphQL Multiple Fields Query #3204

Open
Golde34 opened this issue Jul 31, 2024 · 0 comments
Open

GraphQL Multiple Fields Query #3204

Golde34 opened this issue Jul 31, 2024 · 0 comments

Comments

@Golde34
Copy link

Golde34 commented Jul 31, 2024

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 version22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant