zf

zenflows testing
git clone https://s.sonu.ch/~srfsh/zf.git
Log | Files | Refs | Submodules | README | LICENSE

fragment_spread.ex (716B)


      1 defmodule Absinthe.Language.FragmentSpread do
      2   @moduledoc false
      3 
      4   alias Absinthe.{Blueprint, Language}
      5 
      6   defstruct name: nil,
      7             directives: [],
      8             loc: %{line: nil}
      9 
     10   @type t :: %__MODULE__{
     11           name: String.t(),
     12           directives: [Language.Directive.t()]
     13         }
     14 
     15   defimpl Blueprint.Draft do
     16     def convert(node, doc) do
     17       %Blueprint.Document.Fragment.Spread{
     18         name: node.name,
     19         directives: Blueprint.Draft.convert(node.directives, doc),
     20         source_location: source_location(node)
     21       }
     22     end
     23 
     24     defp source_location(%{loc: nil}) do
     25       nil
     26     end
     27 
     28     defp source_location(%{loc: loc}) do
     29       Blueprint.SourceLocation.at(loc)
     30     end
     31   end
     32 end