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

Not to return an error as a whole if some queries fail #37

Open
narumincho opened this issue Oct 16, 2023 · 1 comment
Open

Not to return an error as a whole if some queries fail #37

narumincho opened this issue Oct 16, 2023 · 1 comment
Labels
simple_graphql_client_gen about simple_graphql_client_gen

Comments

@narumincho
Copy link
Owner

一部のクエリが失敗しても全体としてエラーを返さないように

query ExampleQuery($accountId: AccountId!) {
  account(id: $accountId) {
    id
    name
    birthDate
  }
}
{
  "data": {
    "account": {
      "id": "53ab13fdb5ae8b4caedcbdfe64fd679d",
      "name": "開発用アカウントB",
      "birthDate": null
    }
  },
  "errors": [
    {
      "message": "誕生日は、同じチームに所属しているアカウントのみ見ることができる",
      "locations": [
        {
          "line": 5,
          "column": 5
        }
      ],
      "path": [
        "account",
        "birthDate"
      ],
      "extensions": {
        "code": "accessDeniedError"
      }
    }
  ]
}
@narumincho narumincho added the simple_graphql_client_gen about simple_graphql_client_gen label Oct 16, 2023
@narumincho
Copy link
Owner Author

Dart の Future は成功か失敗であるため, Future として成功しているが, エラーも含むみたいな感じになりそう

Future<WithGraphQLError<Account>>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
simple_graphql_client_gen about simple_graphql_client_gen
Projects
None yet
Development

No branches or pull requests

1 participant