Skip to content

Instantly share code, notes, and snippets.

View dphaener's full-sized avatar

Darin Haener dphaener

View GitHub Profile
@dphaener
dphaener / application_resolver.rb
Created January 27, 2017 16:52
Base GraphQL Resolver
class ApplicationResolver
def self.get_policy_class
name.sub("Resolver", "Policy").safe_constantize
end
def self.authorize(ctx, record, action)
policy_class = get_policy_class
if policy_class
policy = policy_class.new(ctx, record, ctx.brewery)

Keybase proof

I hereby claim:

  • I am dphaener on github.
  • I am dphaener (https://keybase.io/dphaener) on keybase.
  • I have a public key ASCtvfS81AHlurJbXpzXrAU-TpRUTStPYqPqziO3g96fTgo

To claim this, I am signing this object: