{"action":"created","issue":{"url":"https://api.github.com/repos/drupal-graphql/graphql/issues/624","repository_url":"https://api.github.com/repos/drupal-graphql/graphql","labels_url":"https://api.github.com/repos/drupal-graphql/graphql/issues/624/labels{/name}","comments_url":"https://api.github.com/repos/drupal-graphql/graphql/issues/624/comments","events_url":"https://api.github.com/repos/drupal-graphql/graphql/issues/624/events","html_url":"https://github.com/drupal-graphql/graphql/issues/624","id":332165427,"node_id":"MDU6SXNzdWUzMzIxNjU0Mjc=","number":624,"title":"Return error message with response","user":{"login":"davidwhthomas","id":1858243,"node_id":"MDQ6VXNlcjE4NTgyNDM=","avatar_url":"https://avatars2.githubusercontent.com/u/1858243?v=4","gravatar_id":"","url":"https://api.github.com/users/davidwhthomas","html_url":"https://github.com/davidwhthomas","followers_url":"https://api.github.com/users/davidwhthomas/followers","following_url":"https://api.github.com/users/davidwhthomas/following{/other_user}","gists_url":"https://api.github.com/users/davidwhthomas/gists{/gist_id}","starred_url":"https://api.github.com/users/davidwhthomas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidwhthomas/subscriptions","organizations_url":"https://api.github.com/users/davidwhthomas/orgs","repos_url":"https://api.github.com/users/davidwhthomas/repos","events_url":"https://api.github.com/users/davidwhthomas/events{/privacy}","received_events_url":"https://api.github.com/users/davidwhthomas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-06-13T21:10:09Z","updated_at":"2018-06-13T22:34:30Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Currently I have an issue where `EntityById` will return `NULL` if the user doesn't have access to the node, and also if the node doesn't exist. \r\n\r\nIt's been requested to add some error message to the response for the access denied case, so the client knows to login for example for an unpublished node.\r\n\r\nI've found it doesn't appear possible to add the Exception to the GraphQL response and wondering if any suggestion on it.\r\n\r\nFor example, in the `resolve` function, throwing an exception always results in the generic error:\r\n\r\n```{\r\n  \"errors\": [\r\n    {\r\n      \"message\": \"Internal server error\",\r\n      \"category\": \"internal\",\r\n      \"locations\": [\r\n        {\r\n          \"line\": 3,\r\n          \"column\": 3\r\n        }\r\n      ],\r\n      \"path\": [\r\n        \"nodeById\"\r\n      ]\r\n    }\r\n  ],\r\n  \"data\": {\r\n    \"nodeById\": null\r\n  }\r\n}\r\n```\r\n\r\nIs there any way to customise the `message` and `category` in the error message there? Thanks!"},"comment":{"url":"https://api.github.com/repos/drupal-graphql/graphql/issues/comments/397109601","html_url":"https://github.com/drupal-graphql/graphql/issues/624#issuecomment-397109601","issue_url":"https://api.github.com/repos/drupal-graphql/graphql/issues/624","id":397109601,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NzEwOTYwMQ==","user":{"login":"fubhy","id":1172528,"node_id":"MDQ6VXNlcjExNzI1Mjg=","avatar_url":"https://avatars0.githubusercontent.com/u/1172528?v=4","gravatar_id":"","url":"https://api.github.com/users/fubhy","html_url":"https://github.com/fubhy","followers_url":"https://api.github.com/users/fubhy/followers","following_url":"https://api.github.com/users/fubhy/following{/other_user}","gists_url":"https://api.github.com/users/fubhy/gists{/gist_id}","starred_url":"https://api.github.com/users/fubhy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fubhy/subscriptions","organizations_url":"https://api.github.com/users/fubhy/orgs","repos_url":"https://api.github.com/users/fubhy/repos","events_url":"https://api.github.com/users/fubhy/events{/privacy}","received_events_url":"https://api.github.com/users/fubhy/received_events","type":"User","site_admin":false},"created_at":"2018-06-13T22:34:30Z","updated_at":"2018-06-13T22:34:30Z","author_association":"CONTRIBUTOR","body":"Note the \"isClientSafe\" flag. That will make sure it is also displayed in a non-dev environment,"}}
{"actor":{"display_login":"fubhy"}}