Module: GraphQL::FragmentCache::FieldExtension::Patch

Defined in:
lib/graphql/fragment_cache/field_extension.rb

Instance Method Summary collapse

Instance Method Details

#initialize(*args, **kwargs, &block) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/graphql/fragment_cache/field_extension.rb', line 10

def initialize(*args, **kwargs, &block)
  cache_fragment = kwargs.delete(:cache_fragment)

  if cache_fragment
    kwargs[:extensions] ||= []
    kwargs[:extensions] << build_extension(cache_fragment)
  end

  super
end