diff --git a/README.md b/README.md index 663979b..dd2767f 100644 --- a/README.md +++ b/README.md @@ -128,6 +128,14 @@ Schema = GraphQL::Schema.define do end +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: + +
+def self.guard(type, field)
+  type.introspection? || RULES.dig(type, field)
+end
+
+ ## Priority order `GraphQL::Guard` will use the policy in the following order of priority: