Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
stanishev authored and exAspArk committed Oct 30, 2017
1 parent fafa6e4 commit a3d474b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@ Schema = GraphQL::Schema.define do
end
</pre>

When using a policy object, you may want to allow [introspection queries](http://graphql.org/learn/introspection/) to skip authorization. A simple way to avoid having to whitelist every introspection type in the `RULES` hash of your policy object is to check the `type` parameter in the `guard` method:

<pre>
def self.guard(type, field)
<b>type.introspection?</b> || RULES.dig(type, field)
end
</pre>

## Priority order

`GraphQL::Guard` will use the policy in the following order of priority:
Expand Down

0 comments on commit a3d474b

Please sign in to comment.