Skip to content

Commit

Permalink
Merge pull request #1944 from chevinbrown/patch-1
Browse files Browse the repository at this point in the history
Remove confusing non-relevant example
  • Loading branch information
Robert Mosolgo committed Nov 6, 2018
2 parents 8a9bfda + 4450f72 commit 67bc856
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions guides/authorization/authorization.md
Expand Up @@ -45,8 +45,6 @@ By default, GraphQL-Ruby silently replaces unauthorized objects with `nil`, as i
class MySchema < GraphQL::Schema
# Override this hook to handle cases when `authorized?` returns false:
def self.unauthorized_object(error)
# Increment a metric somewhere:
AppStats.increment("graphql:unauthorized:#{error.type.graphql_name}:#{error.object.class.name}")
# Add a top-level error to the response instead of returning nil:
raise GraphQL::ExecutionError, "An object of type #{error.type.graphql_name} was hidden due to permissions"
end
Expand Down

0 comments on commit 67bc856

Please sign in to comment.