Class: Graphlyte::Editors::InlineFragments

Inherits:
Object
  • Object
show all
Defined in:
lib/graphlyte/editors/inline_fragments.rb

Overview

Replace all uses of fragment spreads by inlining the fragment. This will increase the size of the document, sometimes by rather a lot.

But doing so then makes other analysis (such as variable usage) much simpler.

Constant Summary collapse

FragmentNotFound =
Class.new(StandardError)

Instance Method Summary collapse

Instance Method Details

#edit(doc) ⇒ Object



14
15
16
17
# File 'lib/graphlyte/editors/inline_fragments.rb', line 14

def edit(doc)
  inliner.edit(doc)
  defragmenter.edit(doc)
end