class KittyPolicy::GraphQL::AssignFallbackKey
Public Class Methods
new(key)
click to toggle source
# File lib/kitty_policy/graphql/field_authorization.rb, line 78 def initialize(key) @key = key end
Public Instance Methods
call(defn, value = [])
click to toggle source
NOTE(rstankov): This is needed because when we have empty array([]) as fallback
internally graphql-ruby does a *args and this loses the empty array
# File lib/kitty_policy/graphql/field_authorization.rb, line 84 def call(defn, value = []) defn.metadata[@key] = value end